onMessage method
Handles incoming packets.
This method is called when a new packet is received. It first calls the
superclass's onMessage method to handle the packet. Then, it updates
the peer status to online and returns the packet.
packet The incoming packet.
Returns the incoming packet.
Implementation
@override
Future<Packet> onMessage(Packet packet) async {
await super.onMessage(packet);
// Update the peer status to online.
_lastSeenController.add((peerId: packet.srcPeerId, isOnline: true));
return packet;
}