handlePublish method

Future<bool> handlePublish(
  1. String topic,
  2. String message
)

JSON RPC MESSAGE HANDLERS

Implementation

Future<bool> handlePublish(String topic, String message) async {
  // print('handle publish');
  // If we want to ignore the message, stop
  if (await _shouldIgnoreMessageEvent(topic, message)) return false;

  // Record a message event
  await messageTracker.recordMessageEvent(topic, message);

  // Broadcast the message
  onRelayClientMessage.broadcast(
    MessageEvent(
      topic,
      message,
    ),
  );
  return true;
}