diff --git a/src/d2m/event-dispatcher.js b/src/d2m/event-dispatcher.js index 31ef7ea..c0c33d9 100644 --- a/src/d2m/event-dispatcher.js +++ b/src/d2m/event-dispatcher.js @@ -412,6 +412,7 @@ module.exports = { * @param {DiscordTypes.GatewayTypingStartDispatchData} data */ async TYPING_START(client, data) { + if (data.user_id === client.user.id) return const roomID = select("channel_room", "room_id", {channel_id: data.channel_id}).pluck().get() if (!roomID) return const mxid = from("sim").join("sim_member", "mxid").where({user_id: data.user_id, room_id: roomID}).pluck("mxid").get() diff --git a/src/m2d/actions/typing.js b/src/m2d/actions/typing.js index 0c6732f..c56ce4a 100644 --- a/src/m2d/actions/typing.js +++ b/src/m2d/actions/typing.js @@ -31,10 +31,8 @@ function refreshTyping(channelID) { /** @param {string} channelID */ function stopTyping(channelID) { - if (isTyping.has(channelID)) { - // Schedule typing session to end - isTyping.delete(channelID) - } + // Schedule typing session to end + isTyping.delete(channelID) } module.exports.startTyping = startTyping diff --git a/src/m2d/event-dispatcher.js b/src/m2d/event-dispatcher.js index 7dfe102..0560f46 100644 --- a/src/m2d/event-dispatcher.js +++ b/src/m2d/event-dispatcher.js @@ -536,7 +536,7 @@ sync.addTemporaryListener(as, "ephemeral_type:m.typing", guard("m.typing", async event => { const channelID = select("channel_room", "channel_id", {room_id: event.room_id}).pluck().get() if (!channelID) return - if (event.content.user_ids.length) { + if (event.content.user_ids.some(mxid => !utils.eventSenderIsFromDiscord(mxid))) { typing.startTyping(channelID) } else { typing.stopTyping(channelID)