コード例 #1
0
        ///<summary>
        ///	SendMessage
        /// Sends Messages
        ///</summary>
        private void SendMessage()
        {
            /*
             * if (conv == null) {
             *      Logger.Info ("This window does not have a valid Conversation and cannot be used to chat with yet.");
             *      return;
             * }
             */

            // Grab the text from the TextBuffer and clear it out
            string text = typingTextView.Buffer.Text;

            typingTextView.Buffer.Clear();

            TextMessage msg = new TextMessage(text, PersonManager.Me.ProviderUser);

            conv.SendMessage(msg);
            Gnome.Sound.Play(System.IO.Path.Combine(Banter.Defines.SoundDir, "send.wav"));
        }
コード例 #2
0
ファイル: Conversation.cs プロジェクト: GNOME/banter
        /// <summary>
        /// Message receive indication called from telepathy
        /// </summary>
        private void OnReceiveMessageHandler(
			uint id,
			uint timeStamp,
			uint sender,
			org.freedesktop.Telepathy.MessageType messageType,
			org.freedesktop.Telepathy.MessageFlag messageFlag,
			string text)
        {
            if (this.peerUser != null)
            {
                Logger.Debug ("Conversation::OnReceiveMessageHandler - called");
                Logger.Debug ("  received message from: {0}", peerUser.Uri);
                Logger.Debug ("  peer id: {0}  incoming id: {1}", peerUser.ID, id);

                TextMessage txtMessage = new TextMessage (text, peerUser);
                messages.Add (txtMessage);

                if (current != 0) last = current;
                current = this.peerUser.ID;

                // Indicate the message to registered handlers
                if (MessageReceived != null)
                    MessageReceived (this, txtMessage);
            }
        }
コード例 #3
0
ファイル: Conversation.cs プロジェクト: GNOME/banter
 private void AddPendingMessages()
 {
     // Check for any pending messages and add them to our list
     try {
         TextMessage txtMessage;
         PendingMessageInfo[] msgInfos = txtChannel.ListPendingMessages (true);
         foreach (PendingMessageInfo info in msgInfos) {
             Logger.Debug ("Pending Message: {0}", info.Message);
             txtMessage = new TextMessage (info.Message, peerUser);
             messages.Add (txtMessage);
         }
     } catch{}
 }