changeset 20459:46437bdf316b

In the initial ADL listing, send the commands in the correct sequence as required by the server: BLP, ADL and PRP. When the server acknowledges this initial ADL, send CHG with status information
author Carlos Silva <typ0@pidgin.im>
date Thu, 05 Jul 2007 06:35:37 +0000
parents faad7d69de10
children 8f7ccadce62d
files libpurple/protocols/msn/contact.c libpurple/protocols/msn/msn.c libpurple/protocols/msn/msn.h libpurple/protocols/msn/notification.c
diffstat 4 files changed, 36 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/contact.c	Sat Jun 23 03:07:35 2007 +0000
+++ b/libpurple/protocols/msn/contact.c	Thu Jul 05 06:35:37 2007 +0000
@@ -544,9 +544,10 @@
 
 //	purple_debug_misc("msn", "soap contact server Reply: {%s}\n", soapconn->read_buf);
 	if (msn_parse_addressbook(contact)) {
+		msn_send_privacy(session->account->gc);
 		msn_notification_dump_contact(session);
-		msn_set_psm(session);
-		msn_session_finish_login(session);
+//		msn_set_psm(session);
+//		msn_session_finish_login(session);
 	} else {
 		msn_get_address_book(contact, NULL, NULL);
 	}
--- a/libpurple/protocols/msn/msn.c	Sat Jun 23 03:07:35 2007 +0000
+++ b/libpurple/protocols/msn/msn.c	Thu Jul 05 06:35:37 2007 +0000
@@ -407,6 +407,28 @@
 	return user && user->mobile;
 }
 
+void
+msn_send_privacy(PurpleConnection *gc)
+{
+       PurpleAccount *account;
+        MsnSession *session;
+        MsnCmdProc *cmdproc;
+
+        account = purple_connection_get_account(gc);
+        session = gc->proto_data;
+        cmdproc = session->notification->cmdproc;
+
+        if (account->perm_deny == PURPLE_PRIVACY_ALLOW_ALL ||
+                account->perm_deny == PURPLE_PRIVACY_DENY_USERS)
+        {
+                msn_cmdproc_send(cmdproc, "BLP", "%s", "AL");
+        }
+        else
+        {
+                msn_cmdproc_send(cmdproc, "BLP", "%s", "BL");
+        }
+}
+
 static void
 initiate_chat_cb(PurpleBlistNode *node, gpointer data)
 {
@@ -1228,23 +1250,7 @@
 static void
 msn_set_permit_deny(PurpleConnection *gc)
 {
-	PurpleAccount *account;
-	MsnSession *session;
-	MsnCmdProc *cmdproc;
-
-	account = purple_connection_get_account(gc);
-	session = gc->proto_data;
-	cmdproc = session->notification->cmdproc;
-
-	if (account->perm_deny == PURPLE_PRIVACY_ALLOW_ALL ||
-		account->perm_deny == PURPLE_PRIVACY_DENY_USERS)
-	{
-		msn_cmdproc_send(cmdproc, "BLP", "%s", "AL");
-	}
-	else
-	{
-		msn_cmdproc_send(cmdproc, "BLP", "%s", "BL");
-	}
+	msn_send_privacy(gc);
 }
 
 static void
--- a/libpurple/protocols/msn/msn.h	Sat Jun 23 03:07:35 2007 +0000
+++ b/libpurple/protocols/msn/msn.h	Thu Jul 05 06:35:37 2007 +0000
@@ -142,6 +142,6 @@
 	 (MSN_CLIENT_ID_CAPABILITIES))
 
 void msn_act_id(PurpleConnection *gc, const char *entry);
-
+void msn_send_privacy(PurpleConnection *gc);
 
 #endif /* _MSN_H_ */
--- a/libpurple/protocols/msn/notification.c	Sat Jun 23 03:07:35 2007 +0000
+++ b/libpurple/protocols/msn/notification.c	Thu Jul 05 06:35:37 2007 +0000
@@ -744,7 +744,16 @@
 static void
 adl_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
 {
+	static initial;
+
 	purple_debug_info("MaYuan","Process ADL\n");
+
+	if (!initial)
+        {
+                purple_debug_info("--[","Initial ADL received\n");
+                msn_set_psm(cmdproc->session);
+                msn_session_finish_login(cmdproc->session);
+        }
 }
 
 static void