Exemple #1
0
        public void ReceiveMessage(SendMessageOptions sendMessageOptions)
        {
            var chatMessage = this.mapper.Map <ChatMessage>(sendMessageOptions);

            this.chatMessageService.AddChatMessage(chatMessage);

            ChatEventsConnector.OnReceiveMessage(chatMessage);
        }
Exemple #2
0
        public void UpdateChatPermission(AddOrUpdateChatPermissionOptions options)
        {
            var chatPermission = this.mapper.Map <ChatPermission>(options);

            if (this.userService.IsCurrentClientUser(options.ChatMemberLogin))
            {
                this.userService.SaveClientChatPermission(chatPermission);
            }

            ChatEventsConnector.OnUpdateChatPermission(chatPermission);
        }
Exemple #3
0
        public void AddOrUpdateChat(CreateOrUpdateChatOptions options)
        {
            var chat = this.mapper.Map <Chat>(options);

            this.chatService.AddOrUpdateChat(chat);

            var chatPermissionOptions = (AddOrUpdateChatPermissionOptions)options.ExtraData;
            var chatPermission        = this.mapper.Map <ChatPermission>(chatPermissionOptions);

            this.userService.SaveClientChatPermission(chatPermission);

            ChatEventsConnector.OnAddOrUpdateChat(chat);
            ChatEventsConnector.OnUpdateChatPermission(chatPermission);
        }
Exemple #4
0
        public void RemoveMessage(int chatMessageId)
        {
            this.chatMessageService.DeleteMessage(chatMessageId);

            ChatEventsConnector.OnDeleteMessage(chatMessageId);
        }
Exemple #5
0
        public void RemoveChat(int chatId)
        {
            this.chatService.DeleteChat(chatId);

            ChatEventsConnector.OnDeleteChat(chatId);
        }