fix(client): do not dispatch empty messages
this happens when the difference contains messages from other bots that the current bot can't see.
This commit is contained in:
parent
645bd46e9d
commit
1371f935cd
1 changed files with 5 additions and 0 deletions
|
@ -554,6 +554,7 @@ async function _loadChannelDifference(
|
||||||
diff.messages.forEach((message) => {
|
diff.messages.forEach((message) => {
|
||||||
if (noDispatch && noDispatch.msg[channelId]?.[message.id])
|
if (noDispatch && noDispatch.msg[channelId]?.[message.id])
|
||||||
return
|
return
|
||||||
|
if (message._ === 'messageEmpty') return
|
||||||
|
|
||||||
this.dispatchUpdate(message, users, chats)
|
this.dispatchUpdate(message, users, chats)
|
||||||
})
|
})
|
||||||
|
@ -562,6 +563,7 @@ async function _loadChannelDifference(
|
||||||
|
|
||||||
diff.newMessages.forEach((message) => {
|
diff.newMessages.forEach((message) => {
|
||||||
if (noDispatch && noDispatch.msg[channelId]?.[message.id]) return
|
if (noDispatch && noDispatch.msg[channelId]?.[message.id]) return
|
||||||
|
if (message._ === 'messageEmpty') return
|
||||||
|
|
||||||
this.dispatchUpdate(message, users, chats)
|
this.dispatchUpdate(message, users, chats)
|
||||||
})
|
})
|
||||||
|
@ -577,6 +579,9 @@ async function _loadChannelDifference(
|
||||||
if (pts && noDispatch.pts[channelId]?.[pts]) return
|
if (pts && noDispatch.pts[channelId]?.[pts]) return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (upd._ === 'updateNewChannelMessage' && upd.message._ === 'messageEmpty')
|
||||||
|
return
|
||||||
|
|
||||||
this.dispatchUpdate(upd, users, chats)
|
this.dispatchUpdate(upd, users, chats)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue