Version: 0.7.1 (using KDE 3.1.9) Compiler: gcc version 3.3.2 20030812 (Debian prerelease) OS: Linux (i686) release 2.4.21-ck3 When being logged in with another client to the same Jabber account, renaming an account in the foreign client causes Kopete to send out the renaming request again.
Reassigning to self and adding Matthias Wimmer (amessage admin). Matthias: I discovered this when experimenting with renaming the AIM transport in Psi and Kopete while being logged in with both at the same time. Could it be that your users causing AIM to fail are logged in with two Kopete instances at the same time? This is very unlikely to happen on the same machine because Kopete only opens up once per session per default. However, it could be that they have a Kopete instance running remotely which "catches" a rename command and replies with the same command again - causing both clients to play ping-pong.
Trying to read Till's mind and set things up correctly.
Till, I'm tempted to close this bug due to non-response for months. Any objections? Martijn
Please keep it open, it's still valid (I submitted it myself). I am in Sweden right now and only have Internet access today for a few minutes, will get cut off again. I hope to be back and active by the second half of February.
CVS commit by gerken: Fix Kopete echoing packets on pushed roster changes from other clients. On revisiting this issue, it could possibly have led to a packet storm if two Kopete instances were logged in at the same time - seemingly similar to bug #63508, except for that the flood could never be reproduced. (packets were only sent out twice per Kopete instance, then everything settled) CCMAIL: 63588-done@bugs.kde.org M +35 -12 jabbercontact.cpp 1.166 M +3 -1 jabbercontact.h 1.92 M +1 -1 ui/dlgjabbervcard.cpp 1.25 --- kdenetwork/kopete/protocols/jabber/jabbercontact.cpp #1.165:1.166 @@ -80,7 +80,10 @@ JabberContact::JabberContact (QString us slotUpdatePresence (static_cast<JabberProtocol *>(protocol())->JabberKOSOffline, QString::null); - connect(this, SIGNAL(displayNameChanged(const QString &, const QString &)), this, SLOT(slotRenameContact(const QString &, const QString &))); + connect(this, SIGNAL(displayNameChanged(const QString &, const QString &)), this, SLOT(slotDisplayNameChanged(const QString &, const QString &))); actionSendAuth = 0L; + + mIsNetworkPush = false; + } @@ -265,13 +268,23 @@ void JabberContact::slotUpdateContact (c // only update the nickname if its not empty if (!item.name ().isEmpty () && !item.name ().isNull ()) + { + /* + * The setDisplayName() call unfortunately emits displayNameChanged() + * which is also used for local renames. This means that we have to + * differentiate in slotDisplayNameChanged() if the rename was actually + * due to a network push or a local action. mIsNetworkPush keeps + * this information. + */ + mIsNetworkPush = true; setDisplayName (item.name ()); + } } -void JabberContact::slotRenameContact (const QString &oldName, const QString &newName) +void JabberContact::slotDisplayNameChanged (const QString &oldName, const QString &newName) { - QString name = newName; + kdDebug (JABBER_DEBUG_GLOBAL) << k_funcinfo << "Display name changed from " << oldName << " to " << newName << ", network push: " << mIsNetworkPush << endl; - kdDebug (JABBER_DEBUG_GLOBAL) << k_funcinfo << "Renaming contact " << oldName << " to " << newName << endl; + QString name = newName; // if the name has been deleted, revert @@ -282,5 +295,11 @@ void JabberContact::slotRenameContact (c rosterItem.setName (name); - // send rename request to protocol backend + /* + * Only send a rename request if this is a local change + * See slotUpdateContact() for details. + */ + if(!mIsNetworkPush) + { + // our display name has been changed, forward the change to the roster if (!account()->isConnected()) { @@ -293,4 +312,8 @@ void JabberContact::slotRenameContact (c rosterTask->set (rosterItem.jid (), rosterItem.name (), rosterItem.groups ()); rosterTask->go (true); + } + + // make sure the flag is being reset + mIsNetworkPush = false; } --- kdenetwork/kopete/protocols/jabber/jabbercontact.h #1.91:1.92 @@ -147,5 +147,5 @@ public slots: * Catch the rename dialog's results */ - void slotRenameContact (const QString &oldName, const QString &newName); + void slotDisplayNameChanged (const QString &oldName, const QString &newName); protected slots: @@ -249,4 +249,6 @@ private: bool resourceOverride, mEditingVCard; + bool mIsNetworkPush; + /** * Message manager in use to display a message --- kdenetwork/kopete/protocols/jabber/ui/dlgjabbervcard.cpp #1.24:1.25 @@ -230,5 +230,5 @@ void dlgJabberVCard::slotSaveNickname () else { - jc->slotRenameContact(m_mainWidget->leNick->text(), m_mainWidget->leNick->text()); + jc->slotDisplayNameChanged(m_mainWidget->leNick->text(), m_mainWidget->leNick->text()); }