Prevent typing events double-bridging

This commit is contained in:
Cadence Ember
2026-07-20 21:45:44 +12:00
parent ed0bddaae0
commit fa716cd239
3 changed files with 4 additions and 5 deletions
+1
View File
@@ -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()
-2
View File
@@ -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)
}
}
module.exports.startTyping = startTyping
+1 -1
View File
@@ -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)