From 84e56c73fac2fd1304d5dcc05427d5ddd4ce8407 Mon Sep 17 00:00:00 2001 From: batuhan Date: Thu, 20 Mar 2025 15:23:00 +0100 Subject: [PATCH] portal: add `com.beeper.room_type.v2` to `m.bridge` events (#178) --- portal.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/portal.go b/portal.go index 6181eea..4a45a63 100644 --- a/portal.go +++ b/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() {