Filter repeated GroupNameChangeEvent

This commit is contained in:
ryoii 2020-04-04 07:02:38 +08:00
parent 2a7496c0b5
commit 5e553a56ca

View File

@ -311,14 +311,18 @@ internal class OnlinePush {
// println(dataBytes.toUHexString())
if (dataBytes[0].toInt() != 59) {
return@flatMap sequenceOf(
GroupNameChangeEvent(
origin = group.name.also { group._name = message },
new = message,
group = group,
isByBot = false
return@flatMap if (group.name != message) {
sequenceOf(
GroupNameChangeEvent(
origin = group.name.also { group._name = message },
new = message,
group = group,
isByBot = false
)
)
)
} else {
sequenceOf()
}
} else {
//println(message + ":" + dataBytes.toUHexString())
when (message) {