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()) // println(dataBytes.toUHexString())
if (dataBytes[0].toInt() != 59) { if (dataBytes[0].toInt() != 59) {
return@flatMap sequenceOf( return@flatMap if (group.name != message) {
GroupNameChangeEvent( sequenceOf(
origin = group.name.also { group._name = message }, GroupNameChangeEvent(
new = message, origin = group.name.also { group._name = message },
group = group, new = message,
isByBot = false group = group,
isByBot = false
)
) )
) } else {
sequenceOf()
}
} else { } else {
//println(message + ":" + dataBytes.toUHexString()) //println(message + ":" + dataBytes.toUHexString())
when (message) { when (message) {