support uk.half-shot.bridge
This commit is contained in:
@@ -110,6 +110,23 @@ async function channelToKState(channel, guild) {
|
|||||||
},
|
},
|
||||||
"chat.schildi.hide_ui/read_receipts": {
|
"chat.schildi.hide_ui/read_receipts": {
|
||||||
hidden: true
|
hidden: true
|
||||||
|
},
|
||||||
|
[`uk.half-shot.bridge/moe.cadence.ooye://discord/${guild.id}/${channel.id}`]: {
|
||||||
|
bridgebot: `@${reg.sender_localpart}:${reg.ooye.server_name}`,
|
||||||
|
protocol: {
|
||||||
|
id: "discord",
|
||||||
|
displayname: "Discord"
|
||||||
|
},
|
||||||
|
network: {
|
||||||
|
id: guild.id,
|
||||||
|
displayname: guild.name,
|
||||||
|
avatar_url: file.DISCORD_IMAGES_BASE + file.guildIcon(guild)
|
||||||
|
},
|
||||||
|
channel: {
|
||||||
|
id: channel.id,
|
||||||
|
displayname: channel.name,
|
||||||
|
external_url: `https://discord.com/channels/${guild.id}/${channel.id}`
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -295,6 +312,9 @@ async function _unbridgeRoom(channelID) {
|
|||||||
await api.sendState(roomID, "m.space.parent", spaceID, {})
|
await api.sendState(roomID, "m.space.parent", spaceID, {})
|
||||||
await api.sendState(spaceID, "m.space.child", roomID, {})
|
await api.sendState(spaceID, "m.space.child", roomID, {})
|
||||||
|
|
||||||
|
// remove declaration that the room is bridged
|
||||||
|
await api.sendState(roomID, "uk.half-shot.bridge", `moe.cadence.ooye://discord/${channel.guild_id}/${channel.id}`, {})
|
||||||
|
|
||||||
// send a notification in the room
|
// send a notification in the room
|
||||||
await api.sendEvent(roomID, "m.room.message", {
|
await api.sendEvent(roomID, "m.room.message", {
|
||||||
msgtype: "m.notice",
|
msgtype: "m.notice",
|
||||||
|
@@ -99,6 +99,7 @@ function sticker(sticker) {
|
|||||||
return `/stickers/${sticker.id}.${ext}`
|
return `/stickers/${sticker.id}.${ext}`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module.exports.DISCORD_IMAGES_BASE = DISCORD_IMAGES_BASE
|
||||||
module.exports.guildIcon = guildIcon
|
module.exports.guildIcon = guildIcon
|
||||||
module.exports.userAvatar = userAvatar
|
module.exports.userAvatar = userAvatar
|
||||||
module.exports.memberAvatar = memberAvatar
|
module.exports.memberAvatar = memberAvatar
|
||||||
|
Reference in New Issue
Block a user