From 4f3fa38e8df34bd5860776491c03f5e46733717c Mon Sep 17 00:00:00 2001 From: btsai Date: Mon, 16 Mar 2009 02:56:13 +0000 Subject: [PATCH] Currently the WLM plugin does not display the message until it receives acknowledgment that the message got through. This patch changes the behavior so it displays the message immediately but uses the message sending state to indicate whether or not the message has gone through. Squashed commit of the following: commit 4cadc6bfff82d0c05f6801f6b5c5623361b48d7c Author: Benson Tsai Date: Sun Mar 15 10:36:25 2009 -0400 removed commented line commit 959f583c42fd05b19cb83c86e67ce56b2a60add7 Author: Benson Tsai Date: Sun Mar 15 10:29:11 2009 -0400 fixed sending message state added sending message state to initiating connection commit 86cbf0c38980a663078b7a2bbeb42113069d42dd Author: Benson Tsai Date: Sat Mar 14 20:02:34 2009 -0400 initial modification to make msn use sending states for messages git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/KDE/kdenetwork@939939 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kopete/protocols/wlm/wlmchatsession.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/kopete/protocols/wlm/wlmchatsession.cpp b/kopete/protocols/wlm/wlmchatsession.cpp index 0dc0c7c38..cb3a1d7c1 100644 --- a/kopete/protocols/wlm/wlmchatsession.cpp +++ b/kopete/protocols/wlm/wlmchatsession.cpp @@ -571,6 +571,12 @@ WlmChatSession::slotMessageSent (Kopete::Message & msg, } int trid = getChatService ()->sendMessage (&mmsg); + + // Show the message we just sent in the chat window as sending + msg.setState( Kopete::Message::StateSending ); + this->appendMessage(msg); + this->messageSucceeded(); + m_messagesSentQueue[trid] = msg; return; } @@ -600,6 +606,12 @@ WlmChatSession::slotMessageSent (Kopete::Message & msg, messageSucceeded (); return; } + + // Show the message we just sent in the chat window as sending + msg.setState( Kopete::Message::StateSending ); + this->appendMessage(msg); + this->messageSucceeded(); + // put the message in a queue m_messagesQueue.append (msg); return; @@ -607,6 +619,11 @@ WlmChatSession::slotMessageSent (Kopete::Message & msg, if (isConnecting ()) { + // Show the message we just sent in the chat window as sending + msg.setState( Kopete::Message::StateSending ); + this->appendMessage(msg); + this->messageSucceeded(); + // put the message in the queue, we are trying to connect to the // switchboard server m_messagesQueue.append (msg); @@ -647,7 +664,8 @@ WlmChatSession::sendTypingMsg (bool istyping) void WlmChatSession::messageSentACK (unsigned int trID) { - appendMessage (m_messagesSentQueue[trID]); + this->receivedMessageState(m_messagesSentQueue[trID].id(), Kopete::Message::StateSent ); + m_messagesSentQueue.remove (trID); // remove the blinking icon when there are no messages // waiting for delivery -- 2.11.4.GIT