Currently, in the roster, the contact displayed name is either :
 - the name if the user choosed one or
 - the first part of the jid ("user" for [EMAIL PROTECTED])

It may be a nice feature to display the nickname of the contact. With
this patch, the contact's displayed name is :
 - the name the user entered if it did like it does actually
 - the nickname of the contact if it's available in the vcard
 - the fullname of the contact if it's available in the vcard
 - firstname "middlename" lastname of the contact if it's available
 - the first part of the jid

(This could be extended with the as the xep 0154 describe it, but this
is enough for msn transport nick and gmail fullname display)

So I added the vcard in the contact class when one is received, and the
contact in the roster is updated. Then the get_shown_name() method of
the contact returns the name as it's described above.

I don't really know where it's better to query for vcards, so I put this
in the handle_event_notify() method. It'll query the vcard at every
"contact changed show". So on startup, all contacts became online and
all those vcards are queried. But for the offline users there is no name
change, and I don't really know if the vcard query is in the right
(Maybe it does too much vcard queries to the server too?)

Since It's one of my first coding with python and gajim, maybe I didn't
do it the right way, but I send this here because it may interest some
people :)

Damien Thebault

Key C15AB8AF
Fingerprint 8FB9 8576 7033 4B45 3DF5  88E8 5471 1A44 C15A B8AF

Attachment: signature.asc
Description: Ceci est une partie de message numériquement signée

Gajim-devel mailing list

Reply via email to