portal: add com.beeper.room_type.v2 to m.bridge events (#178)
This commit is contained in:
12
portal.go
12
portal.go
@@ -301,7 +301,8 @@ func (portal *Portal) MainIntent() *appservice.IntentAPI {
|
||||
|
||||
type CustomBridgeInfoContent struct {
|
||||
event.BridgeEventContent
|
||||
RoomType string `json:"com.beeper.room_type,omitempty"`
|
||||
RoomType string `json:"com.beeper.room_type,omitempty"`
|
||||
RoomTypeV2 string `json:"com.beeper.room_type.v2,omitempty"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
@@ -344,7 +345,14 @@ func (portal *Portal) getBridgeInfo() (string, CustomBridgeInfoContent) {
|
||||
if portal.Type == discordgo.ChannelTypeDM || portal.Type == discordgo.ChannelTypeGroupDM {
|
||||
roomType = "dm"
|
||||
}
|
||||
return bridgeInfoStateKey, CustomBridgeInfoContent{bridgeInfo, roomType}
|
||||
var roomTypeV2 string
|
||||
if portal.Type == discordgo.ChannelTypeDM {
|
||||
roomTypeV2 = "dm"
|
||||
} else if portal.Type == discordgo.ChannelTypeGroupDM {
|
||||
roomTypeV2 = "group_dm"
|
||||
}
|
||||
|
||||
return bridgeInfoStateKey, CustomBridgeInfoContent{bridgeInfo, roomType, roomTypeV2}
|
||||
}
|
||||
|
||||
func (portal *Portal) UpdateBridgeInfo() {
|
||||
|
||||
Reference in New Issue
Block a user