portal: add com.beeper.room_type.v2 to m.bridge events (#178)
This commit is contained in:
10
portal.go
10
portal.go
@@ -302,6 +302,7 @@ func (portal *Portal) MainIntent() *appservice.IntentAPI {
|
|||||||
type CustomBridgeInfoContent struct {
|
type CustomBridgeInfoContent struct {
|
||||||
event.BridgeEventContent
|
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() {
|
func init() {
|
||||||
@@ -344,7 +345,14 @@ func (portal *Portal) getBridgeInfo() (string, CustomBridgeInfoContent) {
|
|||||||
if portal.Type == discordgo.ChannelTypeDM || portal.Type == discordgo.ChannelTypeGroupDM {
|
if portal.Type == discordgo.ChannelTypeDM || portal.Type == discordgo.ChannelTypeGroupDM {
|
||||||
roomType = "dm"
|
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() {
|
func (portal *Portal) UpdateBridgeInfo() {
|
||||||
|
|||||||
Reference in New Issue
Block a user