Shamrock: fix 重複したグループ参加イベントを削除する

This commit is contained in:
ikechan8370 2023-11-25 19:47:35 +08:00
parent 1a814e565a
commit 75a567d5cd

View File

@ -81,13 +81,7 @@ internal object PrimitiveListener {
732 -> when(subType) {
12 -> onGroupBan(msgTime, pb)
16 -> onGroupTitleChange(msgTime, pb)
17 -> {
try {
onGroupRecall(msgTime, pb)
// invite
onGroupMemIncreased(msgTime, pb)
} finally { }
}
17 -> onGroupRecall(msgTime, pb)
20 -> onGroupPoke(msgTime, pb)
21 -> onEssenceMessage(msgTime, pb)
}
@ -287,31 +281,6 @@ internal object PrimitiveListener {
}
private suspend fun onGroupMemIncreased(time: Long, pb: ProtoMap) {
when(pb[1, 2, 1].asInt) {
732 -> {
// invite
val groupCode = pb[1, 3, 2, 4].asULong
lateinit var target: String
lateinit var operation: String
pb[1, 3, 2, 26, 7].asList
.value
.forEach {
val value = it[2].asUtf8String
when (it[1].asUtf8String) {
"invitee" -> operation = value
"invitor" -> target = value
}
}
val type = 131
LogCenter.log("群成员增加($groupCode): $target, type = $type")
if(!GlobalEventTransmitter.GroupNoticeTransmitter
.transGroupMemberNumChanged(time, target.toLong(), groupCode, operation.toLong(), NoticeType.GroupMemIncrease, NoticeSubType.Invite)) {
LogCenter.log("群成员增加推送失败!", Level.WARN)
}
}
33 -> {
// approve
val groupCode = pb[1, 3, 2, 1].asULong
val targetUid = pb[1, 3, 2, 3].asUtf8String
val type = pb[1, 3, 2, 4].asInt
@ -328,8 +297,6 @@ internal object PrimitiveListener {
LogCenter.log("群成员增加推送失败!", Level.WARN)
}
}
}
}
private suspend fun onGroupMemberDecreased(time: Long, pb: ProtoMap) {
val groupCode = pb[1, 3, 2, 1].asULong