Exemplo n.º 1
0
        private void HandleOnGroupMessage(ITextMessage textMessage)
        {
            var groupname = textMessage.GetStringProperty("groupName");
            var author    = textMessage.GetStringProperty("author");

            if (author.Equals(_username))
            {
                return;
            }
            var grp = GetGroupConversationByGroupname(groupname);
            var cm  = new ChatMessage(author, DateTime.Now, textMessage.Text);

            grp.AddMessage(cm);
            UpdateScreen(grp);
        }
Exemplo n.º 2
0
        private void HandleOnPersonalMessage(ITextMessage textMessage)
        {
            var author = textMessage.GetStringProperty("author");

            if (author.Equals(_username))
            {
                return;
            }
            var srp = GetPersonalConversationByAuthor(author);

            if (srp == null)
            {
                srp = new PersonalConversation(new ChatMessage(author, DateTime.Now, textMessage.Text),
                                               GetDestination("/queue/" + author));
                _conversations.Add(srp);
            }
            var cm = new ChatMessage(author, DateTime.Now, textMessage.Text);

            srp.AddMessage(cm);
            UpdateScreen(srp);
        }