فهرست منبع

Add state key to m.bridge events

Tulir Asokan 5 سال پیش
والد
کامیت
b8de8544e1
1فایلهای تغییر یافته به همراه3 افزوده شده و 0 حذف شده
  1. 3 0
      portal.go

+ 3 - 0
portal.go

@@ -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{{
 		Type: event.StatePowerLevels,
 		Content: event.Content{
@@ -863,10 +864,12 @@ func (portal *Portal) CreateMatrixRoom(user *User) error {
 	}, {
 		Type:    StateBridgeInfo,
 		Content: bridgeInfo,
+		StateKey: &bridgeInfoStateKey,
 	}, {
 		// TODO remove this once https://github.com/matrix-org/matrix-doc/pull/2346 is in spec
 		Type:    StateHalfShotBridgeInfo,
 		Content: bridgeInfo,
+		StateKey: &bridgeInfoStateKey,
 	}}
 	if !portal.AvatarURL.IsEmpty() {
 		initialState = append(initialState, &event.Event{