Fix sending updated bridge info
This commit is contained in:
parent
59e2015fa7
commit
8e30262275
10
portal.go
10
portal.go
@ -812,9 +812,8 @@ var (
|
|||||||
StateHalfShotBridgeInfo = event.Type{Type: "uk.half-shot.bridge", Class: event.StateEventType}
|
StateHalfShotBridgeInfo = event.Type{Type: "uk.half-shot.bridge", Class: event.StateEventType}
|
||||||
)
|
)
|
||||||
|
|
||||||
func (portal *Portal) getBridgeInfo() (string, event.Content) {
|
func (portal *Portal) getBridgeInfo() (string, BridgeInfoContent) {
|
||||||
bridgeInfo := event.Content{
|
bridgeInfo := BridgeInfoContent{
|
||||||
Parsed: BridgeInfoContent{
|
|
||||||
BridgeBot: portal.bridge.Bot.UserID,
|
BridgeBot: portal.bridge.Bot.UserID,
|
||||||
Creator: portal.MainIntent().UserID,
|
Creator: portal.MainIntent().UserID,
|
||||||
Protocol: BridgeInfoSection{
|
Protocol: BridgeInfoSection{
|
||||||
@ -828,7 +827,6 @@ func (portal *Portal) getBridgeInfo() (string, event.Content) {
|
|||||||
DisplayName: portal.Name,
|
DisplayName: portal.Name,
|
||||||
AvatarURL: portal.AvatarURL.CUString(),
|
AvatarURL: portal.AvatarURL.CUString(),
|
||||||
},
|
},
|
||||||
},
|
|
||||||
}
|
}
|
||||||
bridgeInfoStateKey := fmt.Sprintf("net.maunium.whatsapp://whatsapp/%s", portal.Key.JID)
|
bridgeInfoStateKey := fmt.Sprintf("net.maunium.whatsapp://whatsapp/%s", portal.Key.JID)
|
||||||
return bridgeInfoStateKey, bridgeInfo
|
return bridgeInfoStateKey, bridgeInfo
|
||||||
@ -897,12 +895,12 @@ func (portal *Portal) CreateMatrixRoom(user *User) error {
|
|||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
Type: StateBridgeInfo,
|
Type: StateBridgeInfo,
|
||||||
Content: bridgeInfo,
|
Content: event.Content{Parsed: bridgeInfo},
|
||||||
StateKey: &bridgeInfoStateKey,
|
StateKey: &bridgeInfoStateKey,
|
||||||
}, {
|
}, {
|
||||||
// TODO remove this once https://github.com/matrix-org/matrix-doc/pull/2346 is in spec
|
// TODO remove this once https://github.com/matrix-org/matrix-doc/pull/2346 is in spec
|
||||||
Type: StateHalfShotBridgeInfo,
|
Type: StateHalfShotBridgeInfo,
|
||||||
Content: bridgeInfo,
|
Content: event.Content{Parsed: bridgeInfo},
|
||||||
StateKey: &bridgeInfoStateKey,
|
StateKey: &bridgeInfoStateKey,
|
||||||
}}
|
}}
|
||||||
if !portal.AvatarURL.IsEmpty() {
|
if !portal.AvatarURL.IsEmpty() {
|
||||||
|
Loading…
Reference in New Issue
Block a user