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

List:       kopete-devel
Subject:    Re: [Kopete-devel] [Long] next release
From:       Andres Krapf <dae () chez ! com>
Date:       2002-04-29 16:05:09
[Download RAW message or body]

> > advantages are:
> >  - a centralized place for contacts, no need to sync

> Huh? How can't it have it yet? The contact is created and added to the list
> waaaay before KMM even comes into play. Or am I missing a point here?

yup, but think of the plugins which do not use a QMap (aim/icq/jabber don't). 
when they receive a message, they currently have no way to do the mapping. 
their solution is the following: connect each KopeteContact to signal 
messageReceived, and each contact compares the sender's ID to it's own. the 
one which matches emits a messageReceived(foo,this). and this leads to 
less-than-obvious code to read. subobtimal too, but that's not a real problem 
(we all have fast machines right ? :-)

now i want to introdutce KMM in the AIM plugin. so i need to do my mapping 
right. if i go the QMap way, i'll have to track every place of 
(creation|modification|deletion) of contacts inside the plugin, to also 
update my QMap. that's what i mean by syncing. if i use a UniqueId solution, 
i only have to change the creation of the contacts (new AIMContact()) to 
include the uniqueid. that's only about one or two occurrences, usually.

this probably holds true for icq too.

> There is only a single method regarding the map that is not a one-liner,
> which is the reverse mapping. and that is exactly the one that would have
> to be created for each plugin anyway if you use UniqueId instead.

i hadn't thought of that, but using UniqueId would allow you to do something 
like KopeteContact->getUniqueId(), dynamic cast this and then 
->getProtocolId()

anyways, i've looked at the QMap in msn... i had no idea this was so 
extensively used there. i understand your concen about changing things... how 
about the following then:

introduce a UniqueId that will perform as mentioned. that way:
 aim/icq can be more easily ported to KMM.
 jabber might use it to change the flow of the incoming messages to not go to 
all KopeteContacts. (more readable/logical)
  the only change to msn would be create a dummy MSNUniqueId to include at 
creation time in the contacts. not too difficult...

would that be ok ?

-- 
Andres
 

_______________________________________________
Kopete-devel mailing list
Kopete-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/kopete-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

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