diff options
author | John Bailey <rekkanoryo@rekkanoryo.org> | 2008-02-27 00:41:51 +0000 |
---|---|---|
committer | John Bailey <rekkanoryo@rekkanoryo.org> | 2008-02-27 00:41:51 +0000 |
commit | 898e824089d700b7e7e1915ab8c1fb9c53b749c9 (patch) | |
tree | cbeb65d196513ecc576a26aafa320273c2e2d259 | |
parent | 4825b95f197684b2629191bc7bdb89c1e458834d (diff) | |
download | pidgin-898e824089d700b7e7e1915ab8c1fb9c53b749c9.tar.gz |
This is part of a patch from felipec, also known as shx, that adds
purple_serv_got_private_alias for prpls to call after receiving a private
alias from the server.
-rw-r--r-- | libpurple/server.c | 23 | ||||
-rw-r--r-- | libpurple/server.h | 11 |
2 files changed, 34 insertions, 0 deletions
diff --git a/libpurple/server.c b/libpurple/server.c index 4135d78154..9017204b9e 100644 --- a/libpurple/server.c +++ b/libpurple/server.c @@ -274,6 +274,29 @@ serv_got_alias(PurpleConnection *gc, const char *who, const char *alias) } } +void +purple_serv_got_private_alias(PurpleConnection *gc, const char *who, const char *alias) +{ + PurpleAccount *account = NULL; + GSList *buddies = NULL; + PurpleBuddy *b = NULL; + + account = purple_connection_get_account(gc); + buddies = purple_find_buddies(account, who); + + while(buddies != NULL) { + b = buddies->data; + + buddies = g_slist_delete_link(buddies, buddies); + + if((!b->alias && !alias) || (b->alias && alias && !strcmp(b->alias, alias))) + continue; + + purple_blist_alias_buddy(b, alias); + } +} + + PurpleAttentionType *purple_get_attention_type_from_code(PurpleAccount *account, guint type_code) { PurplePlugin *prpl; diff --git a/libpurple/server.h b/libpurple/server.h index 348b630c0f..ee4b70ad74 100644 --- a/libpurple/server.h +++ b/libpurple/server.h @@ -98,6 +98,17 @@ int serv_chat_send(PurpleConnection *, int, const char *, PurpleMessageFlags fl void serv_alias_buddy(PurpleBuddy *); void serv_got_alias(PurpleConnection *gc, const char *who, const char *alias); +/** + * A protocol plugin should call this when it retrieves a private alias from + * the server. Private aliases are the aliases the user sets, while public + * aliases are the aliases or display names that buddies set for themselves. + * + * @param gc The connection on which the alias was received. + * @param who The screen name of the buddy whose alias was received. + * @param alias The alias that was received. + */ +void purple_serv_got_private_alias(PurpleConnection *gc, const char *who, const char *alias); + /** * Receive a typing message from a remote user. Either PURPLE_TYPING |