Ignore auto reply message (#607)

* try to fix #358 according to @Mar8s comment

* Disable mirror

* Cancel group coroutine when bot leave group and fire event separately

* Re-add 0x82 and 0x83

* Revert else logic

* Fix build

* ignore auto reply message

Co-authored-by: Him188 <Him188@mamoe.net>
This commit is contained in:
sandtechnology 2020-09-28 12:45:26 +08:00 committed by GitHub
parent b8bb129ac1
commit 648777e1bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -328,9 +328,12 @@ internal object MessageSvcPbGetMsg : OutgoingPacketFactory<MessageSvcPbGetMsg.Re
if (!bot.firstLoginSucceed) { if (!bot.firstLoginSucceed) {
return@mapNotNull null return@mapNotNull null
} }
friend.lastMessageSequence.loop { friend.lastMessageSequence.loop {
if (friend.lastMessageSequence.compareAndSet(it, msg.msgHead.msgSeq)) { if (friend.lastMessageSequence.compareAndSet(
it,
msg.msgHead.msgSeq
) && msg.contentHead?.autoReply != 1
) {
return@mapNotNull FriendMessageEvent( return@mapNotNull FriendMessageEvent(
friend, friend,
msg.toMessageChain(bot, groupIdOrZero = 0, onlineSource = true), msg.toMessageChain(bot, groupIdOrZero = 0, onlineSource = true),