mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-08 17:20:11 +08:00
More logical event broadcasting
This commit is contained in:
parent
1ff206a420
commit
3c818dad9f
@ -221,9 +221,14 @@ internal class TIMPCBotNetworkHandler internal constructor(coroutineContext: Cor
|
||||
}
|
||||
}
|
||||
|
||||
when (packet) {
|
||||
is Cancellable /* Cancellable : Subscribable */ -> if ((packet as Cancellable).broadcast().cancelled) return
|
||||
is Subscribable -> if ((packet as? BroadcastControllable)?.shouldBroadcast != false) packet.broadcast()
|
||||
if (packet is Subscribable) {
|
||||
if (packet is BroadcastControllable) {
|
||||
if (packet.shouldBroadcast) packet.broadcast()
|
||||
} else {
|
||||
packet.broadcast()
|
||||
}
|
||||
|
||||
if (packet is Cancellable && packet.cancelled) return
|
||||
}
|
||||
|
||||
temporaryPacketHandlers.forEach {
|
||||
|
Loading…
Reference in New Issue
Block a user