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:
teidesu 2021-06-18 19:20:58 +03:00
parent 645bd46e9d
commit 1371f935cd

View file

@ -554,6 +554,7 @@ async function _loadChannelDifference(
diff.messages.forEach((message) => {
if (noDispatch && noDispatch.msg[channelId]?.[message.id])
return
if (message._ === 'messageEmpty') return
this.dispatchUpdate(message, users, chats)
})
@ -562,6 +563,7 @@ async function _loadChannelDifference(
diff.newMessages.forEach((message) => {
if (noDispatch && noDispatch.msg[channelId]?.[message.id]) return
if (message._ === 'messageEmpty') return
this.dispatchUpdate(message, users, chats)
})
@ -577,6 +579,9 @@ async function _loadChannelDifference(
if (pts && noDispatch.pts[channelId]?.[pts]) return
}
if (upd._ === 'updateNewChannelMessage' && upd.message._ === 'messageEmpty')
return
this.dispatchUpdate(upd, users, chats)
})