diff libpurple/protocols/msn/msn.c @ 25172:fd5eedf131b4

Generalize the FQY command so it can be used by different callbacks based on the place that called it. Then automatically call an FQY when sending the buddy list ADL's for a buddy with an unknown network. Then we can send a corrected ADL later with the network from the FQY. This should make it easier for people with OCS/Yahoo contacts that were added incorrectly by previous versions, as they shouldn't need to mess with their address book outside of Pidgin (but if there are multiple buddy copies, that may need fixing externally). I should probably figure out how to permanently fix the Membership lists, eventually. References #6755. References #3322
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Fri, 27 Feb 2009 07:13:20 +0000
parents b0c75121cf66
children 4b8c4870b13a c384d62009c0
line wrap: on
line diff
--- a/libpurple/protocols/msn/msn.c	Thu Feb 26 19:47:58 2009 +0000
+++ b/libpurple/protocols/msn/msn.c	Fri Feb 27 07:13:20 2009 +0000
@@ -1466,9 +1466,18 @@
 		   what to do with users already in the list and stuff... */
 		msn_userlist_add_buddy(userlist, who, group ? group->name : NULL);
 	} else {
+		char **tokens;
+		char *fqy;
 		/* We need to check the network for this buddy first */
 		msn_userlist_save_pending_buddy(userlist, who, group ? group->name : NULL);
-		msn_notification_send_fqy(session, who);
+		tokens = g_strsplit(who, "@", 2);
+		fqy = g_strdup_printf("<ml><d n=\"%s\"><c n=\"%s\"/></d></ml>",
+		                      tokens[1],
+		                      tokens[0]);
+		msn_notification_send_fqy(session, fqy, strlen(fqy),
+		                          (MsnFqyCb)msn_userlist_add_pending_buddy);
+		g_free(fqy);
+		g_strfreev(tokens);
 	}
 }