[Gossip-dev] Questions about GossipContactManager

Martyn Russell martyn at imendio.com
Mon Feb 19 12:31:27 CET 2007


Xavier Claessens wrote:
> Hello,

Hi,

> I'm fixing telepathy backend to use the new API and contact manager.
> Here are my problems:
> 
> 1) Is gossip_protocol_find_contact() still useful ? Shouldn't we use
> gossip_contact_manager_find() instead now ?

Well, one finds contacts for a given protocol and the other finds ALL
contacts that we know about. So no I would say there is a good reason
for keeping them both.

> 2) When gossip starts, gossip_protocol_new_contact() is called to create
> all contacts saved in a xml file. That's useful for offline viewing logs
> and others reasons... But should the backend keep those contacts even if
> it's not connected ? 

Yes, why not? If it doesn't the GossipContactManager would have to keep
them all and the backend would have to query libgossip about contacts. I
think that is the wrong way round and shouldn't do that.

> Backend can't request avatar/alias/etc before
> connecting. When disonnecting GossipJabber protocol it removes all
> contacts from its hash table but contact manager don't, so the sate is
> not coerent between offline before first connection and offline after
> first connection. What should be done here ?

Then that is a bug. The backend shouldn't really remove the contacts
from the hash table. We need to check this to see what implications it
will have in the Jabber backend.

If this it not really plausible in the Jabber backend OR the Telepathy
backend, perhaps the GossipContactManager should keep the contacts and
be the place to create them too - allowing sync with the backend when
they connect? Either way, contacts should really only be created in one
place.

> 3) Using telepathy we can't know own-contact's ID before connecting
> account. GossipContactManager gets own contact from the protocol even if
> offline, is it a problem if it returns a GossipContact with NULL ID 

Yes, I can imagine that would be a problem in some places.

> and
> create a new GossipContact object (Previous one is finalized) with all
> information once the account is connected ?

Apart from protocols where you don't have an ID at any point, which
might be problematic, I can't see why you can't create a contact object
before connecting.

> 4) If jabber backend the own contact is created in jabber_setup() and
> its ID is set to the account's "account" param which is OK, but if we
> change the jid of the account and then connect it jid of the account and
> the one of own contact won't be equal I guess ? Potential problem here I
> think.

That's a good point. I think we should put something in place here to
make sure they are kept in step.

> 5) The contact manager should connect to "notify::name" on each
> GossipContact object and store the file when a name change I think.

Yes, we should be doing this.

-- 
Regards,
Martyn


More information about the Gossip-dev mailing list