1
0
Fork 0

fix a variety of bugs that snuck in

This commit is contained in:
Cadence Ember 2023-06-28 23:38:58 +12:00
parent 512f61422d
commit 584f19a011
6 changed files with 13 additions and 11 deletions

View file

@ -58,7 +58,7 @@ async function channelToKState(channel, guild) {
"m.room.join_rules/": {
join_rule: "restricted",
allow: [{
type: "m.room.membership",
type: "m.room_membership",
room_id: spaceID
}]
}
@ -179,7 +179,9 @@ async function createAllForGuild(guildID) {
const channelIDs = discord.guildChannelMap.get(guildID)
assert.ok(channelIDs)
for (const channelID of channelIDs) {
await syncRoom(channelID).then(r => console.log(`synced ${channelID}:`, r))
if (discord.channels.get(channelID)?.type === DiscordTypes.ChannelType.GuildText) { // TODO: guild sync thread channels and such. maybe make a helper function to check if a given channel is syncable?
await syncRoom(channelID).then(r => console.log(`synced ${channelID}:`, r))
}
}
}

View file

@ -15,14 +15,14 @@ const createRoom = sync.require("../actions/create-room")
/**
* @param {import("discord-api-types/v10").GatewayMessageCreateDispatchData} message
* @param {import("discord-api-types/v10").APIGuild} guild
*/
async function sendMessage(message) {
assert.ok(message.member)
async function sendMessage(message, guild) {
const roomID = await createRoom.ensureRoom(message.channel_id)
let senderMxid = null
if (!message.webhook_id) {
assert(message.member)
senderMxid = await registerUser.ensureSimJoined(message.author, roomID)
await registerUser.syncUser(message.author, message.member, message.guild_id, roomID)
}

View file

@ -24,7 +24,7 @@ module.exports = {
* @param {import("discord-api-types/v10").GatewayMessageReactionAddDispatchData} data
*/
onReactionAdd(client, data) {
if (data.emoji.id !== null) return // TOOD: image emoji reactions
if (data.emoji.id !== null) return // TODO: image emoji reactions
console.log(data)
addReaction.addReaction(data)
}