Ejemplo n.º 1
0
 public virtual ChatMessageInfo BuildChatParticipantBlockedMessage(IChatParticipantBlockedEvent <ChatParticipant> @event)
 {
     return(new ChatMessageInfo(MessageType.ChatRef, 0, style: MessageStyle("ParticipantBlocked"), contacts: new List <ContactMessage>()
     {
         new ContactMessage(@event.Participant)
     }));
 }
Ejemplo n.º 2
0
        public virtual async Task Handle(IChatParticipantBlockedEvent <TChatParticipant> @event, IChatBusContext chatBusContext)
        {
            var notification = ChatParticipantsNotificationBuilder.BuildChatParticipantBlockedNotification(@event);

            await Notify(@event.ChatId, notification);

            await NotificationRouteService.RemoveUserFromChat(@event.Participant.UserId, @event.ChatId);
        }
Ejemplo n.º 3
0
        public virtual async Task Handle(IChatParticipantBlockedEvent <TChatParticipant> @event, IChatBusContext chatBusContext)
        {
            if (ChatWorkersConfiguration.DisableSystemMessages)
            {
                return;
            }
            var messageInfo = SystemMessagesBuilder.BuildChatParticipantBlockedMessage(@event);

            await AddMessage(@event, messageInfo, chatBusContext);
        }
 public virtual IChatParticipantBlockedNotification <ChatParticipant> BuildChatParticipantBlockedNotification(IChatParticipantBlockedEvent <ChatParticipant> @event)
 {
     return(new ChatParticipantBlockedNotification(@event.InitiatorUserId, @event.ChatId, @event.Participant));
 }