portal: add com.beeper.room_type.v2 to m.bridge events (#178)

This commit is contained in:
batuhan
2025-03-20 15:23:00 +01:00
committed by GitHub
parent 5854ad0c14
commit 84e56c73fa

View File

@@ -301,7 +301,8 @@ 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() {