Exemple #1
0
        public BaseRoutableChatTextMessageEnteredEventListener(IChatTextMessageEnteredEventSubscribable subscriptionService,
                                                               [NotNull] IChatChannelJoinedEventSubscribable channelJoinedSubscriptionService,
                                                               [NotNull] ILog logger,
                                                               ChatChannelType channelType)
        {
            if (channelJoinedSubscriptionService == null)
            {
                throw new ArgumentNullException(nameof(channelJoinedSubscriptionService));
            }
            Logger      = logger ?? throw new ArgumentNullException(nameof(logger));
            ChannelType = channelType;

            //This just registers and wires up that when we join a channel we'll start recieveing that channels messages.
            channelJoinedSubscriptionService.OnChatChannelJoined += (o, e) =>
            {
                if (!CheckType(e))
                {
                    return;
                }

                subscriptionService.OnChatMessageEntered += (o2, e2) =>
                {
                    if (!CheckType(e2))
                    {
                        return;
                    }

                    OnEventFired(e.MessageSender, e2);
                };
            };
        }
Exemple #2
0
 public ProximityTextChatMessageManagerEventListener(IChatTextMessageEnteredEventSubscribable subscriptionService,
                                                     [NotNull] IChatChannelJoinedEventSubscribable channelJoinedSubscriptionService,
                                                     [NotNull] ILog logger)
     : base(subscriptionService, channelJoinedSubscriptionService, logger, ChatChannelType.Proximity)
 {
 }