Наследование: BaseChatElement
Пример #1
0
 public BaseChatElement ReceiveMessage(String message, String speaker)
 {
     BaseChatElement newMessage = new TargetChatElement()
     {
         Message = message,
         Speaker = speaker,
         SpeakTime = DateTime.Now
     };
     _addToExchange(newMessage);
     return newMessage;
 }
Пример #2
0
 internal void ReceiveChatMessage(String message, String chatId, String interactionId, String shortCode, string userName)
 {
     BaseChatElement newMessage = new TargetChatElement()
     {
         Message = message,
         Speaker = _to,
         SpeakTime = DateTime.Now,
         UserName = userName,
         Avatar = _engagement.SecondParty.Party.Avatar,
     };
     Conversation.AddMessage(newMessage);
     if (chatId != null)
     {
         _threadId = chatId;
     }
     // Fire the event
     OnActivate(EventArgs.Empty);
     OnNewActivity(new ChatActivity(_engagement, ChatActivity.CHAT_RECEIVE)
                      {
                          From = _to,
                          To = _appContext.CurrentUserManager.CurrentUser.Username,
                          Message = message
                      });
     OnDeactivate(EventArgs.Empty);
 }