MSNp14 status?
Felipe Contreras
felipe.contreras at gmail.com
Fri Feb 1 04:45:59 EST 2008
2008/2/1 Ethan Blanton <elb at pidgin.im>:
> Felipe Contreras spake unto us the following wisdom:
> > 2008/2/1 Ethan Blanton <elb at pidgin.im>:
> > > Sure; protocols which can store this on the server, do so. OSCAR
> > > does, I know, as does XMPP, I believe. If MSN doesn't, and the server
> > > supports that field, it should.
> >
> > Where to? server alias, or local alias?
> >
> > What about the nickname?
>
> MSN is unique in the complete stupidity of the *client* storing a
> *server alias* on the server, to my knowledge. If, indeed, that is
> standard practice and not just brokenness in our prpl.
Geez, I'll explain it one more time for you.
If by *server alias* you mean "nickname", then that's not exactly
stored on the server; you receive your buddies' nickname at
initialization and later on you receive updates.
A nickname is something your buddy sets for himself for others to see
as the displayed name.
The name *server alias* doesn't quite fit, but there is no way to set
a nickname, there's only one function available for prpl's to report
back to libpurple: serv_got_alias.
> If the server doesn't have a dedicated field for storing the alias
> that a user wants to see for a buddy (regardless of that buddy's MSN
> ID or "friendly name"), which we call the "local alias", then it has
> to stay in the local blist.xml, I guess. If it does, we should use
> whatever field that is.
The server _does_ have such a field; it's called "display name".
So, in MSN you get two things from the server; the "display name", and
the "nickname". Both should be sent to libpurple, and libpurple should
allow clients to retrieve both so clients can decide how to display
them. But libpurple has only _one_ function.
I worked around this problem by re-implementing serv_got_alias inside
the prpl so you have an extra function like serv_got_nickname:
http://gitweb.freedesktop.org/?p=users/felipec/purple-msn-pecan.git;a=blob_plain;h=b76b30957b8d2fa00215ee87dc834ae442d193c4;f=fix-purple.c
I consider that hacky, but in the jabber prpl you are doing something
even hackier. In add_purple_buddies_to_groups you are calling directly
purple_blist_alias_buddy. Why not use purple_blist_server_alias_buddy
instead of serv_got_alias? There's a reason why serv_got_alias exists;
that is so prpls can forget about iterating all over the
PurpleBuddies, and hence avoid code duplication and reduce possible
bugs.
So, in xmpp jargon:
display name = name
nickname= servnick
libpurple doess _not_ provide a way to report back the display
name/name/alias and confuses things by having a serv_got_alias that
doesn't receive a display name/name/alias, but instead receives a
nickname/servnick.
So when you store a "server alias" is a display name/name/alias, but
when you read then "server alias" is nickname/servnick.
Is that clearer?
--
Felipe Contreras
More information about the Devel
mailing list