pidgin: e5d6fce6: Don't attempt to change the alias on the...
qulogic at pidgin.im
qulogic at pidgin.im
Sat Oct 3 17:06:32 EDT 2009
-----------------------------------------------------------------
Revision: e5d6fce6e0c43fe410e8aec7c79150b4a12858a0
Ancestor: a8e4e84ce253f2fb43245d2722cb73ab86e0f9b5
Author: qulogic at pidgin.im
Date: 2009-10-03T21:01:57
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/e5d6fce6e0c43fe410e8aec7c79150b4a12858a0
Modified files:
libpurple/protocols/msn/contact.c
ChangeLog:
Don't attempt to change the alias on the server if the contact is not (yet)
on it.
Fixes #9242 and #10393.
-------------- next part --------------
============================================================
--- libpurple/protocols/msn/contact.c 43a2b59cd3bd3765824068ed83d8dc0e3d989667
+++ libpurple/protocols/msn/contact.c 98eb479e1b4f7fc7bc4d25ad6055c18809bdcf8f
@@ -1417,6 +1417,7 @@ msn_update_contact(MsnSession *session,
xmlnode *contact;
xmlnode *contact_info;
xmlnode *changes;
+ MsnUser *user = NULL;
purple_debug_info("msn", "Update contact information for %s with new %s: %s\n",
passport ? passport : "(null)",
@@ -1424,6 +1425,12 @@ msn_update_contact(MsnSession *session,
value ? value : "(null)");
g_return_if_fail(passport != NULL);
+ if (strcmp(passport, "Me") != 0) {
+ user = msn_userlist_find_user(session->userlist, passport);
+ if (!user)
+ return;
+ }
+
contact_info = xmlnode_new("contactInfo");
changes = xmlnode_new("propertiesChanged");
@@ -1464,14 +1471,13 @@ msn_update_contact(MsnSession *session,
xmlnode_insert_child(contact, contact_info);
xmlnode_insert_child(contact, changes);
- if (!strcmp(passport, "Me")) {
- xmlnode *contactType = xmlnode_new_child(contact_info, "contactType");
- xmlnode_insert_data(contactType, "Me", -1);
- } else {
- MsnUser *user = msn_userlist_find_user(session->userlist, passport);
+ if (user) {
xmlnode *contactId = xmlnode_new_child(contact, "contactId");
msn_callback_state_set_uid(state, user->uid);
xmlnode_insert_data(contactId, state->uid, -1);
+ } else {
+ xmlnode *contactType = xmlnode_new_child(contact_info, "contactType");
+ xmlnode_insert_data(contactType, "Me", -1);
}
msn_contact_request(state);
More information about the Commits
mailing list