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

List:       kde-commits
Subject:    kdenonbeta/kopete/protocols/jabber
From:       Till Gerken <till () tantalo ! net>
Date:       2003-07-18 13:29:00
[Download RAW message or body]

CVS commit by gerken: 

Fixing initial presence notification to the server, this caused some users
(especially those using autoconnect) to not be able to see their contacts'
status.


  M +0 -1      TODO   1.58
  M +48 -33    jabberaccount.cpp   1.55


--- kdenonbeta/kopete/protocols/jabber/TODO  #1.57:1.58
@@ -12,5 +12,4 @@
 - in JabberAccount::disconnect(), the iteration about the contacts to set the \
                offline should be obsolete and incorrect
 - JabberAccount::slotGoAway() etc. don't use the global away dialog
-- when going online, setPresence() is called twice, once too early -> investigate
 - using "online" presence emits "Going online"?
 - should the away dialog pop up when going away using the account context menu?

--- kdenonbeta/kopete/protocols/jabber/jabberaccount.cpp  #1.54:1.55
@@ -297,10 +297,10 @@ void JabberAccount::connect ()
 void JabberAccount::slotPsiDebug (const QString & msg)
 {
-        kdDebug (JABBER_DEBUG_PROTOCOL) << "[JabberAccount] Psi: " << msg << endl;
+        kdDebug (JABBER_DEBUG_PROTOCOL) << k_funcinfo << "Psi: " << msg << endl;
 }
 
 void JabberAccount::slotHandshaken ()
 {
-        kdDebug (JABBER_DEBUG_GLOBAL) << "[JabberAccount] Performing login..." << \
endl; +        kdDebug (JABBER_DEBUG_GLOBAL) << k_funcinfo << "Performing login..." \
<< endl;  
         if (registerFlag)
@@ -488,9 +488,21 @@ void JabberAccount::slotError (const Jab
 void JabberAccount::setPresence (const KopeteOnlineStatus & status, const QString & \
reason, int priority)  {
-        kdDebug(JABBER_DEBUG_GLOBAL) << k_funcinfo << "Setting new presence." << \
endl;  
-        if (isConnected () || (status == protocol()->JabberConnecting) ||
-           (myContact->onlineStatus() == protocol()->JabberConnecting))
+        // if we are in the process of connecting, only update our local presence
+        // and don't send anything across the wire
+        if(status == protocol()->JabberConnecting)
         {
+                kdDebug(JABBER_DEBUG_GLOBAL) << k_funcinfo << "Setting new presence \
locally (-> connecting)." << endl; +
+                myContact->slotUpdatePresence (status, reason);
+        }
+        else
+        {
+                // if we are already connected and changing our presence or if we \
are connecting +                // and set our initial presence, send new presence \
packet to the server +                if (isConnected () || \
(myContact->onlineStatus() == protocol()->JabberConnecting)) +                {
+                        kdDebug(JABBER_DEBUG_GLOBAL) << k_funcinfo << "Sending new \
presence to the server." << endl; +
                 Jabber::Status presence;
 
@@ -527,5 +539,8 @@ void JabberAccount::setPresence (const K
         }
         else
+                {
                 kdDebug(JABBER_DEBUG_GLOBAL) << k_funcinfo << "We were not \
connected, presence update aborted." << endl; +                }
+        }
 
 }


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

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