Commit 3c818dad authored by Him188's avatar Him188

More logical event broadcasting

parent 1ff206a4
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment