Bug 62607 - duplicate contacts added to list on Add Contact
Summary: duplicate contacts added to list on Add Contact
Status: RESOLVED FIXED
Alias: None
Product: kopete
Classification: Unmaintained
Component: libkopete (show other bugs)
Version: 0.7
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Kopete Developers
URL:
Keywords:
: 62217 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-08-13 17:58 UTC by Paul Sandulescu
Modified: 2004-02-14 00:01 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
screenshot with erronuous contact list (100.09 KB, image/png)
2004-02-13 20:46 UTC, Stefan Winter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Sandulescu 2003-08-13 17:58:01 UTC
Version:           0.7 (using KDE KDE 3.1.3)
Installed from:    Debian testing/unstable Packages
Compiler:          gcc 3.3.1 20030728 (Debian prerelease)
OS:          Linux

Whenever i try to add a contact (i mostly tried from MSN), there are two metacontacts added to the CL, both named the same, and when i rename one of them, the other also gets renamed. If i move one to another group, the other one follows. IIRC, immediately after addition, both show as online. After reconnect, only one shows online, and usually if i delete the offline one, the other one stays on the CL, but it's moved outside of the group, at the top level.
Comment 1 Heinrich Wendel 2003-08-13 19:37:35 UTC
same here for icq
Comment 2 Paul Sandulescu 2003-08-13 21:00:34 UTC
Sorry, my bad. Kopete wasn't not installed from the Debian unstable packages, 
i compiled it from source. 
Comment 3 Heinrich Wendel 2003-08-26 18:23:47 UTC
it happens here on gentoo, in my opinion a bug that should be fixed for 0.7.2 
Comment 4 Stefan Gehn 2003-08-26 20:05:33 UTC
Never happend here, please try to find a 100% working way of reproducing it. Just 
simply adding a contact can't be it. Maybe it's protocol related. 
Comment 5 Olivier Goffart 2003-08-26 20:09:50 UTC
Never happened here too. 
And i will add that libkopete don't allow to add two contact with the same id.  
(At least if we use the libkopete way to add contact, which is not always the 
case) 
 
Comment 6 Paul Sandulescu 2003-08-26 20:14:36 UTC
ok, it most probably happens because the user is already on the remote contact 
list. now if i think about it, i just did it with user who were already on the 
remote MSN list, but i had deleted them from the Kopete CL. 
Comment 7 Olivier Goffart 2003-08-26 20:25:49 UTC
I just retried it (HEAD, but there are not so many changes) . 
And if i add an already existing MSN contact, nothing happen, the contact is 
not added. (but i don't get any error message, which is maybe bad) 
 
Maybe you did a typo:  blah@msn.com  <> blha@msn.com    
(i am just searching for stupid solution :-s ) 
 
Or it is possible that the same contact was placed in two groups (kopete allow 
that) 
Comment 8 Paul Sandulescu 2003-08-26 20:42:21 UTC
No, there was no typo, i was able to communicate with the users. 
Ok, i admit that i just tried it now and it doesn't do it anymore. But now i 
remember deleting the actual account(s) while the client was offline, then 
readding it. I just retried it now and it says that the user already belongs 
to that group, then the metacontact appears in the right group AND in the top 
level, but both with a blank name and no subcontacts. Tried adding it to 
another group, and it gave me the same error message, but it added it with the 
right subcontact, and didn't add it in the top level. Now i also moved it to 
the previous group and again the same error message saying that it is already 
there, but it actually moved it correctly. 
Comment 9 Tais P. Hansen 2003-08-26 21:04:16 UTC
Subject: Re: [Kopete-devel]   duplicate contacts added to list on Add Contact

On Tuesday 26 August 2003 20:05, Stefan Gehn wrote:
> Never happend here, please try to find a 100% working way of reproducing
> it. Just simply adding a contact can't be it. Maybe it's protocol related.

This actually also happens to me every time I add an unknown ICQ contact who's 
just sent me a message.

Maybe that's where it goes wrong... I'll dig.

Comment 10 Heinrich Wendel 2003-08-26 22:10:51 UTC
> This actually also happens to me every time I add an unknown ICQ contact who's  
> just sent me a message.  
  
same here, in contactlist.xml they are shown *exactly* the same then. 
Comment 11 Tais P. Hansen 2003-08-26 23:01:23 UTC
Subject: Re: [Kopete-devel]   duplicate contacts added to list on Add Contact

On Tuesday 26 August 2003 20:05, Stefan Gehn wrote:
> Never happend here, please try to find a 100% working way of reproducing
> it. Just simply adding a contact can't be it. Maybe it's protocol related.

ICQ: Receiving a message from a contact not in list, reading the message and 
then right clicking contact in message window contact list and selecting add 
contact, leaves you with two similar contacts in the contact list. Deleting 
any one of them will remove both from the contact list.

Comment 12 Paul Sandulescu 2003-08-26 23:23:47 UTC
yes, this also happened to me with MSN. for example, if you get in a chatroom 
with more than one other person, and some are not on your CL, if you choose to 
add one of the not-on-list contacts, they will appear twice in your CL. 
Comment 13 Olivier Goffart 2003-08-30 17:33:22 UTC
*** Bug 62217 has been marked as a duplicate of this bug. ***
Comment 14 Chris Chapin 2003-09-11 22:50:13 UTC
Subject: Re: duplicate contacts added to list on Add Contact

see my fix on 62622. i believe this is the same problem. from what I gather 
the problem has to do with pickyness about caps. ie server has contact 
JimBo11 saved as jimbo11. therefor they both show up. like i mentioned above 
try merging both contacts into one metacontact. that solved the problem for 
me. hope it helps for now. thanks. 

Comment 15 Matt Rogers 2003-10-26 05:47:43 UTC
works for me here. I recreated my whole entire MSN contact list from scratch and didn't have a problem with it.
Comment 16 Heinrich Wendel 2003-11-10 14:40:26 UTC
This still happens in kde 3.1.93. If I receive an icq message from a contact not in my list and i add this contact, it's added twice. In the metadata.xml it's *excactly* the same contact.
Comment 17 Heinrich Wendel 2003-11-10 14:47:33 UTC
this bug only appear if you right click the icq icon -> add contact
if you right click the user id -> add contact to your contact list only one contact is added
Comment 18 Grzegorz Jaskiewicz 2003-11-10 14:49:49 UTC
Subject: Re: [Kopete-devel]  duplicate contacts added to list on
 Add Contact 

This bug apperas not only in ICQ, this is libkopete bug.



Comment 19 Matt Rogers 2003-11-10 15:27:39 UTC
Reopening since it never worked for me in the first place, I was just doing it wrong. ;(
Comment 20 Olivier Goffart 2003-11-12 15:58:03 UTC
I definitively can't reproduce this on MSN.
I tried too with ICQ without success (Just that it showed me another ICQ bug that contact can't be added if the group is not on the server)

Can someone tell me a way to reproduce it?
Comment 21 Paul Sandulescu 2003-11-27 21:36:28 UTC
Ok, i think i have a way to reproduce this. I received a message from somebody not in my ICQ list, so it went in the "Not on your contact list" group. When i right-clicked on it (and i think it was the ICQ icon because i got a small menu) then clicked on Add Contact, the metacontact appeared a second time in the list (and i think they both went to Top Level). When i tried to delete one of them, i lost both of them. They reappeared after a kopete restart. Moving one of them to a different group and renaming it, then removing the other one works, although when i quit kopete again to see if a second one reappears, it crashed, couldn't figure out why.
I am using 0.7.4, from Debian sid (0.7.4-1).
Comment 22 Richard Smith 2003-11-27 23:10:44 UTC
Subject: Re: [Kopete-devel]  duplicate contacts added to list on Add Contact

Don't know if this is related or not, but it seems suitably similar:

Open an IRC channel. Right-click on someone not on your list. Go Add to 
Contact List. Delete them from your contact list. They disappear from the 
channel as well.

lilac

Comment 23 Jason Keirstead 2003-11-27 23:25:17 UTC
Subject: Re: [Kopete-devel]  duplicate contacts added to list on Add Contact

On November 27, 2003 06:10 pm, Richard Smith wrote:
> Add Contact 
> Don't know if this is related or not, but it seems suitably similar:
> 
> Open an IRC channel. Right-click on someone not on your list. Go Add to 
> Contact List. Delete them from your contact list. They disappear from the 
> channel as well.
> 
> lilac
 
Dunno if it is related, but this is not an IRC issue, it would happen with any protocol.

The code is not checking if a contact is in a conversation. A contact in a conversation
shouldn't be deleted from memory, it should just be changed into a temporary contact
and then removed from the contact list.


Comment 24 Casey Allen Shobe 2003-12-21 08:54:08 UTC

*** This bug has been marked as a duplicate of 65305 ***
Comment 25 Heinrich Wendel 2004-01-20 15:38:57 UTC
this is not a duplicate of 65305 and still a bug in kopete 3.2_rc1, steps to reproduce:

- start kopete
- login to icq
- receive a message from a contact not in your list
- right click on the icq sign on the right of the username (not on the username)
- click Add Contact
=> The contact is added twice, it's exactly the same in your contactlist.xml:

    <meta-contact contactId="" >
        <display-name trackChildNameChanges="0" >156319987</display-name>
        <groups>
            <group id="1" />
        </groups>
        <plugin-data plugin-id="ICQProtocol" >
            <plugin-data-field key="Encoding" >0</plugin-data-field>
            <plugin-data-field key="accountId" >114830049</plugin-data-field>
            <plugin-data-field key="awaitingAuth" >0</plugin-data-field>
            <plugin-data-field key="contactId" >156319987</plugin-data-field>
            <plugin-data-field key="displayName" >156319987</plugin-data-field>
            <plugin-data-field key="groupID" >13601</plugin-data-field>
        </plugin-data>
    </meta-contact>
    <meta-contact contactId="" >
        <display-name trackChildNameChanges="0" >156319987</display-name>
        <groups>
            <group id="1" />
        </groups>
        <plugin-data plugin-id="ICQProtocol" >
            <plugin-data-field key="Encoding" >0</plugin-data-field>
            <plugin-data-field key="accountId" >114830049</plugin-data-field>
            <plugin-data-field key="awaitingAuth" >0</plugin-data-field>
            <plugin-data-field key="contactId" >156319987</plugin-data-field>
            <plugin-data-field key="displayName" >156319987</plugin-data-field>
            <plugin-data-field key="groupID" >13601</plugin-data-field>
        </plugin-data>
    </meta-contact
Comment 26 Marcelo Penna Guerra 2004-01-20 19:23:35 UTC
Heinrich: is this a top-level contact? If it is, does it happen if you, instead of right->click add, add it by moving the contact to the default group?
Comment 27 Heinrich Wendel 2004-01-20 21:22:38 UTC
it's in a temporary group "not in your contact list" and i am trying to add it to top-level. doing this via drag and drop works perfectly :)
Comment 28 Heinrich Wendel 2004-02-04 10:28:45 UTC
so could you please reopen this bug
Comment 29 Stefan Gehn 2004-02-04 12:01:46 UTC
> so could you please reopen this bug
Isn't reopening allowed for everybody or why do I see this message so often?
Comment 30 Heinrich Wendel 2004-02-04 12:07:05 UTC
just developers and the reporter of a bug can reopen it
Comment 31 Stefan Winter 2004-02-13 20:45:12 UTC
Same thing for me... Some of my ICQ contact are duplicate. For me this is due to erronuous saving of the contact list in the contactlist.xml. I will attach a screenshot that shows an ICQ-contact MuH-Hudson, once with the correct numerical identifier (online), and one with an illegal alphabetic character (offline, since the UIN is no good).
Comment 32 Stefan Winter 2004-02-13 20:46:34 UTC
Created attachment 4681 [details]
screenshot with erronuous contact list
Comment 33 Martijn Klingens 2004-02-14 00:01:25 UTC
CVS commit by mklingens: 

Don't add entries twice to the contact list

Credits go mostly to lilachaze, if I had committed my version the patch
would have gone into the less accurate KopeteContact instead :)

CCMAIL: 62607-done@bugs.kde.org


  M +3 -0      kopetecontactlist.cpp   1.117.2.2


--- kdenetwork/kopete/libkopete/kopetecontactlist.cpp  #1.117.2.1:1.117.2.2
@@ -97,4 +97,7 @@ KopeteMetaContact *KopeteContactList::fi
 void KopeteContactList::addMetaContact( KopeteMetaContact *mc )
 {
+        if ( d->contacts.contains( mc ) )
+                return;
+
         d->contacts.append( mc );