broadcast method

  1. @override
Future<void> broadcast(
  1. List<int> data, {
  2. required Client from,
  3. required String to,
})
override

Implementation

@override
broadcast(data, {required from, required to}) async {
  final chan = _channels[to];
  if (chan == null) {
    from.sendNumericWith(NumericReply.ERR_NOSUCHCHANNEL, [to]);
    return;
  }

  if (chan.isFlagOn('n') && !chan.isOnChannel(client: from)) {
    from.sendNumericWith(NumericReply.ERR_NOTONCHANNEL, [to]);
    return;
  }

  chan.broadcast(data, from: from, echo: false);
}