public void Subscribe(PresenceAction action, Action <PresenceMessage> handler) { if ((_channel.State != ChannelState.Attached) && (_channel.State != ChannelState.Attaching)) { _channel.Attach(); } _handlers.Add(action.ToString(), new MessageHandlerAction <PresenceMessage>(handler)); }
public bool Unsubscribe(PresenceAction presenceAction, Action <PresenceMessage> handler) { return(_handlers.Remove(presenceAction.ToString(), handler.ToHandlerAction())); }