im.pidgin.pidgin: 716d84a169bb99b378b5268b6c4e6f337d4d7615
rekkanoryo at pidgin.im
rekkanoryo at pidgin.im
Tue Feb 26 20:00:44 EST 2008
-----------------------------------------------------------------
Revision: 716d84a169bb99b378b5268b6c4e6f337d4d7615
Ancestor: 3195166356877e091e9b3d663bc03f7682ed3a17
Author: rekkanoryo at pidgin.im
Date: 2008-02-27T00:41:51
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/716d84a169bb99b378b5268b6c4e6f337d4d7615
Modified files:
libpurple/server.c libpurple/server.h
ChangeLog:
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.
-------------- next part --------------
============================================================
--- libpurple/server.c 77022a785f6b2eb3ab0a89a1fa2c940d6270d2ec
+++ libpurple/server.c 2f84d197fbaa0bd1e623a3abb426260c3246df4c
@@ -274,6 +274,29 @@ serv_got_alias(PurpleConnection *gc, con
}
}
+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;
============================================================
--- libpurple/server.h 2b3e21036a4c50ee143021f2fd1b514ebd146f8a
+++ libpurple/server.h 28c75b20775231ef3c25d445bcf7a748bde04ae5
@@ -98,7 +98,18 @@ void serv_got_alias(PurpleConnection *gc
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
* or PURPLE_TYPED. If the user has stopped typing then use
More information about the Commits
mailing list