Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

#961 closed defect (invalid)

Use nickname from the vcard on the roster

Reported by: anonymous Owned by: asterix
Priority: normal Milestone:
Component: roster Version: 0.8.1
Severity: normal Keywords:
Cc: Blocked By:
Blocking: OS:


If my contact set him nickname in the vcard, I should be able to see this nickname automatically in my roster (and not the thing before the @ of the JID).

Attachments (2)

parse_for_roster.patch (2.6 KB) - added by FishFace 11 years ago.
parse_for_roster.2.patch (2.8 KB) - added by FishFace 11 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 11 years ago by FishFace

I've been working on a patch that allows you to change the displayed text in the roster. Currently the syntax goes like this:

'$nick<span size="smaller"> - $vcard_NICKNAME</span><span size="smaller" style="italic">\n$status</span'

The parser automatically replaces $nick, $status and $vcard_* with the appropriate text. If there is no text, then the parser also removes the <span> and </span> surrounding the variable. Currently, this means that there can be no nesting of spans for variables, otherwise odd behaviour occurs. A slightly complex way of dealing with this would be to use {..} to group together bits that go together. (this is useful because if there's no status message, you don't want the newline that would also display the message) An example might then look like this:

'{$nick}<small>{ - $vcard_NICKNAME}{<i>\n$status</i>}</small>'

What do you guys think?

comment:2 Changed 11 years ago by nk

when you're patch is ready or you want comments attach code

Changed 11 years ago by FishFace

comment:3 Changed 11 years ago by FishFace

OK, this uses the latter curly brackets formatting. Road tests are promising, but I've not done anything rigorous, at all...

Current issues:

If there's no vcard cache, then fields appear blank until we download a vcard. There needs to be something that makes sure this information exists. There aren't yet enough fields - only $nick, $status and $vcard_*. But this is easy enough to correct.

comment:4 Changed 11 years ago by FishFace

Oh, and no configuration - the string's hardcoded.

I hope you appreciate that this is more of a proof-of-concept than something that's ready for deployment!

comment:5 Changed 11 years ago by nk

from that every patcher should read

s = _('%(nick)s has been kicked by %(who)s: %(reason)s') % {

'nick': nick, 'who': actor, 'reason': reason }

that is pythonic way of doing what you do with $ stuff

and in general, don't stay at proof-of-concept :)

comment:6 Changed 11 years ago by FishFace

I have two immediate reservations with this:

Firstly, is this easy for a user to modify? The reason I elected to use $s firstly is because it's easier for a user to type in $nick than %(nick)s. Not only does it take fewer characters, it's also easier to understand.

And also, will this actually work in the required way? Bear in mind that we need to include almost all of the vcard fields and more, and will have only a few of them in the string at a time. It's also not as easy to remove the {} bits, span bits or whatever.

In other words, at first I tried to use the %s method, but it didn't seem particularly feasible, or good in terms of usability/codability. I assume there's some sensible way of using the pythonic way, though, so i'll change it if you can explain how to do it properly.

New patch, removes some bugs, but haven't changed the $/%s issue.

comment:7 Changed 11 years ago by nk

come in room so we can discuss sync

Changed 11 years ago by FishFace

comment:8 Changed 10 years ago by nk

  • Resolution set to invalid
  • Status changed from new to closed

vcard-temp is not the right place. there is a jep being prepared for nicknames. when this comes, we'll do it. atm it's jsut overhead and complex

comment:9 Changed 10 years ago by anonymous

  • Type set to defect

World of Warcraft gold(wow gold)--buy

cheap,sell wow gold.welcome to buy cheap --cheap, easy, purchasing.World of Warcraft,Super fastdelivery of gold, items,and accounts


Note: See TracTickets for help on using tickets.