Esempio n. 1
0
        void AddChatState(MessageModel msg)
        {
            DeleteOldChatState();
            var buffer = OutputMessageTextView.Buffer;

            buffer.AddMark(ChatStateStartPosition, buffer.EndIter);

            OutputMessageTextView.AddMessage(msg, false, false);

            ChatStatePositionValid = true;
        }
Esempio n. 2
0
        void DeleteOldChatState()
        {
            if (!ChatStatePositionValid)
            {
                return;
            }
            var buffer = OutputMessageTextView.Buffer;
            var start  = buffer.GetIterAtMark(ChatStateStartPosition);
            var end    = buffer.EndIter;

            buffer.Delete(ref start, ref end);
            buffer.DeleteMark(ChatStateStartPosition);
            if (buffer.EndIter.Offset < OutputMessageTextView.MarkerlineBufferPosition)
            {
                // in the rare case that the markeline is below the dots, move it to the correct position
                OutputMessageTextView.UpdateMarkerline();
            }
            ChatStatePositionValid = false;
        }
Esempio n. 3
0
        void UpdateChatState()
        {
            DeleteOldChatState();
            if (LastPresenceMessage == null && TypingDots == null)
            {
                // nothing to display
                return;
            }
            var buffer = OutputMessageTextView.Buffer;

            buffer.AddMark(ChatStateStartPosition, buffer.EndIter);

            if (TypingDots != null)
            {
                OutputMessageTextView.AddMessage(TypingDots, true, false);
            }
            if (LastPresenceMessage != null)
            {
                OutputMessageTextView.AddMessage(LastPresenceMessage, false);
            }

            ChatStatePositionValid = true;
        }