Handle new accounts with no buddies better - finish login when the first

Sun, 27 May 2007 12:39:24 +0000

author
Stu Tomlinson <nosnilmot@pidgin.im>
date
Sun, 27 May 2007 12:39:24 +0000
changeset 17404
f940e48b4caf
parent 17403
b0e8707193b5
child 17405
b56460e16477

Handle new accounts with no buddies better - finish login when the first
group is received, this allows us to handle the GTC, BLP & PRP commands for
new accounts.

libpurple/protocols/msn/notification.c file | annotate | diff | comparison | revisions
libpurple/protocols/msn/sync.c file | annotate | diff | comparison | revisions
--- a/libpurple/protocols/msn/notification.c	Sun May 27 01:41:02 2007 +0000
+++ b/libpurple/protocols/msn/notification.c	Sun May 27 12:39:24 2007 +0000
@@ -901,6 +901,7 @@
 syn_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
 {
 	MsnSession *session;
+	MsnSync *sync;
 	int total_users;
 
 	session = cmdproc->session;
@@ -919,22 +920,12 @@
 
 	total_users  = atoi(cmd->params[2]);
 
-	if (total_users == 0)
-	{
-		msn_session_finish_login(session);
-	}
-	else
-	{
-		/* syn_table */
-		MsnSync *sync;
+	sync = msn_sync_new(session);
+	sync->total_users = total_users;
+	sync->old_cbs_table = cmdproc->cbs_table;
 
-		sync = msn_sync_new(session);
-		sync->total_users = total_users;
-		sync->old_cbs_table = cmdproc->cbs_table;
-
-		session->sync = sync;
-		cmdproc->cbs_table = sync->cbs_table;
-	}
+	session->sync = sync;
+	cmdproc->cbs_table = sync->cbs_table;
 }
 
 /**************************************************************************
--- a/libpurple/protocols/msn/sync.c	Sun May 27 01:41:02 2007 +0000
+++ b/libpurple/protocols/msn/sync.c	Sun May 27 12:39:24 2007 +0000
@@ -99,8 +99,19 @@
 
 	/* HACK */
 	if (group_id == 0)
+	{
 		/* Group of ungroupped buddies */
+		if (session->sync->total_users == 0)
+		{
+			cmdproc->cbs_table = session->sync->old_cbs_table;
+
+			msn_session_finish_login(session);
+
+			msn_sync_destroy(session->sync);
+			session->sync = NULL;
+		}
 		return;
+	}
 
 	if ((purple_find_group(name)) == NULL)
 	{

mercurial