Esempio n. 1
0
 public virtual ChatMessageInfo BuildChatParticipantAddedMessage(IChatParticipantAddedEvent <ChatParticipant> @event)
 {
     return(new ChatMessageInfo(MessageType.ChatRef, 0, style: MessageStyle("ParticipantAdded"), contacts: new List <ContactMessage>()
     {
         new ContactMessage(@event.Participant)
     }));
 }
Esempio n. 2
0
        public virtual async Task Handle(IChatParticipantAddedEvent <TChatParticipant> @event, IChatBusContext chatBusContext)
        {
            await NotificationRouteService.AddUserToChat(@event.Participant.UserId, @event.ChatId);

            var notification = ChatParticipantsNotificationBuilder.BuildChatParticipantAddedNotification(@event);

            await Notify(@event.ChatId, notification);
        }
Esempio n. 3
0
        public virtual async Task Handle(IChatParticipantAddedEvent <TChatParticipant> @event, IChatBusContext chatBusContext)
        {
            if (ChatWorkersConfiguration.DisableSystemMessages)
            {
                return;
            }
            var messageInfo = SystemMessagesBuilder.BuildChatParticipantAddedMessage(@event);

            await AddMessage(@event, messageInfo, chatBusContext);
        }
 public virtual IChatParticipantAddedNotification <ChatParticipant> BuildChatParticipantAddedNotification(IChatParticipantAddedEvent <ChatParticipant> @event)
 {
     return(new ChatParticipantAddedNotification(@event.InitiatorUserId, @event.ChatId, @event.Participant, @event.PreviousStatus));
 }