[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/3.5/kdenetwork/kopete/protocols/groupwise
From:       Will Stephenson <wstephenson () kde ! org>
Date:       2007-08-29 14:15:56
Message-ID: 1188396956.814842.4807.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 706131 by wstephens:

Fix message loss bug (bnc:299155) that manifests when a user goes offline, and \
reconnects, while keeping a chatwindow open all the time.  The old GUID was not \
invalidated, and subsequent messages to this GUID were silently dropped.  Warn the \
user if this happens, and invalidate all GUIDs on any disconnect.

 M  +14 -0     gwaccount.cpp  
 M  +1 -0      gwaccount.h  
 M  +16 -0     libgroupwise/client.cpp  
 M  +3 -1      libgroupwise/client.h  


--- branches/KDE/3.5/kdenetwork/kopete/protocols/groupwise/gwaccount.cpp \
#706130:706131 @@ -358,8 +358,15 @@
 	myself()->setOnlineStatus( protocol()->groupwiseConnecting );
 	m_client->connectToServer( m_clientStream, dn, true );
 
+    QObject::connect( m_client, SIGNAL( messageSendingFailed() ), SLOT( \
slotMessageSendingFailed() ) );  }
 
+void GroupWiseAccount::slotMessageSendingFailed()
+{
+	KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), \
KMessageBox::Sorry, +				i18n("Message Sending Failed", "Kopete was not able to send \
the last message sent on account '%1'.\nIf possible, please send the console output \
from Kopete to <wstephenson@novell.com> for analysis." ).arg( accountId() ) , i18n \
("Unable to Send Message on Account '%1'").arg( accountId() ) ); +}
+
 void GroupWiseAccount::setOnlineStatus( const Kopete::OnlineStatus& status, const \
QString &reason )  {
 	kdDebug ( GROUPWISE_DEBUG_GLOBAL ) << k_funcinfo << endl;
@@ -408,6 +415,10 @@
 	if( isConnected () )
 	{
 		kdDebug (GROUPWISE_DEBUG_GLOBAL) << k_funcinfo << "Still connected, closing \
connection..." << endl; +		QValueList<GroupWiseChatSession *>::ConstIterator it;
+		for ( it = m_chatSessions.begin() ; it != m_chatSessions.end(); ++it )
+			(*it)->setClosed();
+
 		/* Tell backend class to disconnect. */
 		m_client->close ();
 	}
@@ -650,6 +661,9 @@
 {
 	kdDebug ( GROUPWISE_DEBUG_GLOBAL ) << k_funcinfo << "Disconnected from Groupwise \
server." << endl;  myself()->setOnlineStatus( protocol()->groupwiseOffline );
+	QValueList<GroupWiseChatSession *>::ConstIterator it;
+	for ( it = m_chatSessions.begin() ; it != m_chatSessions.end(); ++it )
+		(*it)->setClosed();
 	setAllContactsStatus( protocol()->groupwiseOffline );
 	client()->close();
 }
--- branches/KDE/3.5/kdenetwork/kopete/protocols/groupwise/gwaccount.h #706130:706131
@@ -163,6 +163,7 @@
 
 	
 protected slots:
+    void slotMessageSendingFailed();
 	/**
 	 * Set an auto reply message for use when the account is away
 	 * TODO: Extend Kopete::AwayAction so you can set multiple ones there.
--- branches/KDE/3.5/kdenetwork/kopete/protocols/groupwise/libgroupwise/client.cpp \
#706130:706131 @@ -238,6 +238,7 @@
 {
 	SendMessageTask * smt = new SendMessageTask( d->root );
 	smt->message( addresseeDNs, message );
+	connect( smt, SIGNAL( finished() ), SLOT( smt_messageSent() ) );
 	smt->go( true );
 }
 
@@ -522,4 +523,19 @@
 	kat->setup();
 	kat->go( true );
 }
+
+void Client::smt_messageSent()
+{
+	const SendMessageTask * smt = ( SendMessageTask * )sender();
+	if ( smt->success() )
+	{
+		debug( "message sent OK" );
+	}
+	else
+	{
+		debug( "message sending failed!" );
+		emit messageSendingFailed();
+	}
+}
+
 #include "client.moc"
--- branches/KDE/3.5/kdenetwork/kopete/protocols/groupwise/libgroupwise/client.h \
#706130:706131 @@ -351,6 +351,7 @@
 		void systemBroadcastReceived ( const ConferenceEvent & );
 		/** CONTACT LIST MANAGEMENT EVENTS */
 		/** TBD! */
+        void messageSendingFailed();
 	protected:
 		/**
 		 * Instantiate all the event handling tasks
@@ -389,7 +390,8 @@
 		 * sendout a 'ping' keepalive message so that the server does not disconnect us
 		 */
 		void sendKeepAlive();
-
+        void smt_messageSent();
+    
 	private:
 		void distribute( Transfer *transfer );
 		class ClientPrivate;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic