Send uk.half-shot.bridge in addition to m.bridge
This commit is contained in:
@@ -307,24 +307,30 @@ class PortalMetadata(BasePortal, ABC):
|
|||||||
for invite in invites:
|
for invite in invites:
|
||||||
power_levels.users.setdefault(invite, 100)
|
power_levels.users.setdefault(invite, 100)
|
||||||
self.title = puppet.displayname
|
self.title = puppet.displayname
|
||||||
|
bridge_info = {
|
||||||
|
"bridgebot": self.az.bot_mxid,
|
||||||
|
"creator": self.main_intent.mxid,
|
||||||
|
"protocol": {
|
||||||
|
"id": "telegram",
|
||||||
|
"displayname": "Telegram",
|
||||||
|
"avatar_url": config["appservice.bot_avatar"],
|
||||||
|
},
|
||||||
|
"channel": {
|
||||||
|
"id": self.tgid
|
||||||
|
}
|
||||||
|
}
|
||||||
initial_state = [{
|
initial_state = [{
|
||||||
"type": EventType.ROOM_POWER_LEVELS.serialize(),
|
"type": EventType.ROOM_POWER_LEVELS.serialize(),
|
||||||
"content": power_levels.serialize(),
|
"content": power_levels.serialize(),
|
||||||
}, {
|
}, {
|
||||||
"type": "m.bridge",
|
"type": "m.bridge",
|
||||||
"state_key": f"net.maunium.telegram://telegram/{self.tgid}",
|
"state_key": f"net.maunium.telegram://telegram/{self.tgid}",
|
||||||
"content": {
|
"content": bridge_info
|
||||||
"bridgebot": self.az.bot_mxid,
|
}, {
|
||||||
"creator": self.main_intent.mxid,
|
# TODO remove this once https://github.com/matrix-org/matrix-doc/pull/2346 is in spec
|
||||||
"protocol": {
|
"type": "uk.half-shot.bridge",
|
||||||
"id": "telegram",
|
"state_key": f"net.maunium.telegram://telegram/{self.tgid}",
|
||||||
"displayname": "Telegram",
|
"content": bridge_info
|
||||||
"avatar_url": config["appservice.bot_avatar"],
|
|
||||||
},
|
|
||||||
"channel": {
|
|
||||||
"id": self.tgid
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}]
|
}]
|
||||||
if config["bridge.encryption.default"] and self.matrix.e2ee:
|
if config["bridge.encryption.default"] and self.matrix.e2ee:
|
||||||
self.encrypted = True
|
self.encrypted = True
|
||||||
|
|||||||
Reference in New Issue
Block a user