im.pidgin.pidgin: 5a8a1c7157bbb174029ef625cbf079604f7ad7fa
khc at pidgin.im
khc at pidgin.im
Mon Nov 19 03:00:37 EST 2007
-----------------------------------------------------------------
Revision: 5a8a1c7157bbb174029ef625cbf079604f7ad7fa
Ancestor: a41a12c3718fde3c2e793af5ad8f093942ba2802
Author: khc at pidgin.im
Date: 2007-11-19T07:56:50
Branch: im.pidgin.pidgin
Modified files:
libpurple/protocols/msnp9/notification.c
libpurple/protocols/msnp9/notification.h
libpurple/protocols/msnp9/user.c
libpurple/protocols/msnp9/user.h
libpurple/protocols/msnp9/userlist.c
ChangeLog:
QuLogic submitted this patch a long time ago, References #2571. I believe
we need to do something for MSNP14 as well, but I haven't figured out
exactly what
-------------- next part --------------
============================================================
--- libpurple/protocols/msnp9/notification.c cbedda79fceb1d07ca3c9a8fa4f5461cae25e2c0
+++ libpurple/protocols/msnp9/notification.c dd690580185c00b68db4240fd22732b5e3770c36
@@ -1348,7 +1348,7 @@ msn_notification_add_buddy(MsnNotificati
void
msn_notification_add_buddy(MsnNotification *notification, const char *list,
- const char *who, const char *store_name,
+ const char *who, const char *friendly_name,
int group_id)
{
MsnCmdProc *cmdproc;
@@ -1360,11 +1360,11 @@ msn_notification_add_buddy(MsnNotificati
if (group_id >= 0)
{
msn_cmdproc_send(cmdproc, "ADD", "%s %s %s %d",
- list, who, store_name, group_id);
+ list, who, friendly_name, group_id);
}
else
{
- msn_cmdproc_send(cmdproc, "ADD", "%s %s %s", list, who, store_name);
+ msn_cmdproc_send(cmdproc, "ADD", "%s %s %s", list, who, friendly_name);
}
}
============================================================
--- libpurple/protocols/msnp9/notification.h 681e80141cc08b532276ee779c47cf0a1a770fc3
+++ libpurple/protocols/msnp9/notification.h 406a9a4531fb254608f808567abfdf88d0239149
@@ -46,7 +46,7 @@ void msn_notification_add_buddy(MsnNotif
void msn_notification_add_buddy(MsnNotification *notification,
const char *list, const char *who,
- const char *store_name, int group_id);
+ const char *friendly_name, int group_id);
void msn_notification_rem_buddy(MsnNotification *notification,
const char *list, const char *who,
int group_id);
============================================================
--- libpurple/protocols/msnp9/user.c bd0a32e939658130a876b77028bf17c07beef542
+++ libpurple/protocols/msnp9/user.c b166fe2436a48a3a6ddabeaa6491a1daba57b6c5
@@ -27,7 +27,7 @@ msn_user_new(MsnUserList *userlist, cons
MsnUser *
msn_user_new(MsnUserList *userlist, const char *passport,
- const char *store_name)
+ const char *friendly_name)
{
MsnUser *user;
@@ -36,17 +36,8 @@ msn_user_new(MsnUserList *userlist, cons
user->userlist = userlist;
msn_user_set_passport(user, passport);
- msn_user_set_store_name(user, store_name);
+ msn_user_set_friendly_name(user, friendly_name);
- /*
- * XXX This seems to reset the friendly name from what it should be
- * to the passport when moving users. So, screw it :)
- */
-#if 0
- if (name != NULL)
- msn_user_set_name(user, name);
-#endif
-
return user;
}
@@ -66,7 +57,6 @@ msn_user_destroy(MsnUser *user)
g_free(user->passport);
g_free(user->friendly_name);
- g_free(user->store_name);
g_free(user->phone.home);
g_free(user->phone.work);
g_free(user->phone.mobile);
@@ -135,22 +125,24 @@ msn_user_set_friendly_name(MsnUser *user
void
msn_user_set_friendly_name(MsnUser *user, const char *name)
{
+ MsnCmdProc *cmdproc;
+
g_return_if_fail(user != NULL);
+ if (user->friendly_name && strcmp(user->friendly_name, name)) {
+ /* copy the new name to the server list, but only when new */
+ /* should we check this more thoroughly? */
+ cmdproc = user->userlist->session->notification->cmdproc;
+ msn_cmdproc_send(cmdproc, "REA", "%s %s",
+ user->passport,
+ purple_url_encode(name));
+ }
+
g_free(user->friendly_name);
user->friendly_name = g_strdup(name);
}
void
-msn_user_set_store_name(MsnUser *user, const char *name)
-{
- g_return_if_fail(user != NULL);
-
- g_free(user->store_name);
- user->store_name = g_strdup(name);
-}
-
-void
msn_user_set_buddy_icon(MsnUser *user, PurpleStoredImage *img)
{
MsnObject *msnobj = msn_user_get_object(user);
@@ -344,14 +336,6 @@ const char *
}
const char *
-msn_user_get_store_name(const MsnUser *user)
-{
- g_return_val_if_fail(user != NULL, NULL);
-
- return user->store_name;
-}
-
-const char *
msn_user_get_home_phone(const MsnUser *user)
{
g_return_val_if_fail(user != NULL, NULL);
============================================================
--- libpurple/protocols/msnp9/user.h 87bbce26849a85fe6ebd26e5e17bae42c4584e86
+++ libpurple/protocols/msnp9/user.h 1f2a234258f80b8bb5a60c88d0e50ec9e57ff0e9
@@ -42,7 +42,6 @@ struct _MsnUser
MsnUserList *userlist;
char *passport; /**< The passport account. */
- char *store_name; /**< The name stored in the server. */
char *friendly_name; /**< The friendly name. */
const char *status; /**< The state of the user. */
@@ -83,7 +82,7 @@ MsnUser *msn_user_new(MsnUserList *userl
* @return A new user structure.
*/
MsnUser *msn_user_new(MsnUserList *userlist, const char *passport,
- const char *store_name);
+ const char *friendly_name);
/**
* Destroys a user structure.
@@ -127,14 +126,6 @@ void msn_user_set_friendly_name(MsnUser
void msn_user_set_friendly_name(MsnUser *user, const char *name);
/**
- * Sets the store name for a user.
- *
- * @param user The user.
- * @param name The store name.
- */
-void msn_user_set_store_name(MsnUser *user, const char *name);
-
-/**
* Sets the buddy icon for a local user.
*
* @param user The user.
@@ -226,15 +217,6 @@ const char *msn_user_get_friendly_name(c
const char *msn_user_get_friendly_name(const MsnUser *user);
/**
- * Returns the store name for a user.
- *
- * @param user The user.
- *
- * @return The store name.
- */
-const char *msn_user_get_store_name(const MsnUser *user);
-
-/**
* Returns the home phone number for a user.
*
* @param user The user.
============================================================
--- libpurple/protocols/msnp9/userlist.c c8f65c75fc2dd9e294412c7e84d8c51b468d8552
+++ libpurple/protocols/msnp9/userlist.c 002c944871d49e9117c2bd4d9f970a9a907aba37
@@ -132,18 +132,18 @@ static const char*
}
static const char*
-get_store_name(MsnUser *user)
+get_friendly_name(MsnUser *user)
{
- const char *store_name;
+ const char *friendly_name;
g_return_val_if_fail(user != NULL, NULL);
- store_name = msn_user_get_store_name(user);
+ friendly_name = msn_user_get_friendly_name(user);
- if (store_name != NULL)
- store_name = purple_url_encode(store_name);
+ if (friendly_name != NULL)
+ friendly_name = purple_url_encode(friendly_name);
else
- store_name = msn_user_get_passport(user);
+ friendly_name = msn_user_get_passport(user);
/* this might be a bit of a hack, but it should prevent notification server
* disconnections for people who have buddies with insane friendly names
@@ -153,10 +153,10 @@ get_store_name(MsnUser *user)
/* Stu: yeah, that's why it's a bit of a hack, as you pointed out, we're
* probably decoding the incoming store_name wrong, or something. bleh. */
- if (strlen(store_name) > BUDDY_ALIAS_MAXLEN)
- store_name = msn_user_get_passport(user);
+ if (strlen(friendly_name) > BUDDY_ALIAS_MAXLEN)
+ friendly_name = msn_user_get_passport(user);
- return store_name;
+ return friendly_name;
}
static void
@@ -360,7 +360,7 @@ msn_got_lst_user(MsnSession *session, Ms
gc = purple_account_get_connection(account);
passport = msn_user_get_passport(user);
- store = msn_user_get_store_name(user);
+ store = msn_user_get_friendly_name(user);
if (list_op & MSN_LIST_FL_OP)
{
@@ -639,7 +639,7 @@ msn_userlist_add_buddy(MsnUserList *user
MsnUser *user;
int group_id;
const char *list;
- const char *store_name;
+ const char *friendly_name;
group_id = -1;
@@ -681,13 +681,13 @@ msn_userlist_add_buddy(MsnUserList *user
return;
}
- store_name = (user != NULL) ? get_store_name(user) : who;
+ friendly_name = (user != NULL) ? get_friendly_name(user) : who;
/* Then request the add to the server. */
list = lists[list_id];
msn_notification_add_buddy(userlist->session->notification, list, who,
- store_name, group_id);
+ friendly_name, group_id);
}
void
More information about the Commits
mailing list