mirror of
https://github.com/tulir/mautrix-whatsapp
synced 2024-12-14 09:23:51 +01:00
Add state key to m.bridge events
This commit is contained in:
parent
47a1d7f6cb
commit
b8de8544e1
1 changed files with 3 additions and 0 deletions
|
@ -855,6 +855,7 @@ func (portal *Portal) CreateMatrixRoom(user *User) error {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
bridgeInfoStateKey := fmt.Sprintf("net.maunium.whatsapp://whatsapp/%s", portal.Key.JID)
|
||||||
initialState := []*event.Event{{
|
initialState := []*event.Event{{
|
||||||
Type: event.StatePowerLevels,
|
Type: event.StatePowerLevels,
|
||||||
Content: event.Content{
|
Content: event.Content{
|
||||||
|
@ -863,10 +864,12 @@ func (portal *Portal) CreateMatrixRoom(user *User) error {
|
||||||
}, {
|
}, {
|
||||||
Type: StateBridgeInfo,
|
Type: StateBridgeInfo,
|
||||||
Content: bridgeInfo,
|
Content: bridgeInfo,
|
||||||
|
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: bridgeInfo,
|
||||||
|
StateKey: &bridgeInfoStateKey,
|
||||||
}}
|
}}
|
||||||
if !portal.AvatarURL.IsEmpty() {
|
if !portal.AvatarURL.IsEmpty() {
|
||||||
initialState = append(initialState, &event.Event{
|
initialState = append(initialState, &event.Event{
|
||||||
|
|
Loading…
Reference in a new issue