changeset 9194:364aa73323b5

[gaim-migrate @ 9989] A few things here. First, some spelling corrections. Second, make sure we always send a group ID when we add somebody. Default to 0 if nothing else. We were sending an ADD in some cases without a group ID, and then MSN sent back a 224 - Invalid Group (I swear that never happened before?), and we misinterpreted the error and figured the passport was invalid. Third, don't spit out the "Unhandled command 'BLP'" errors. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sun, 06 Jun 2004 03:19:41 +0000
parents 502707ca1836
children d5487fdec696
files src/protocols/msn/notification.c src/protocols/msn/switchboard.c src/protocols/msn/userlist.c
diffstat 3 files changed, 22 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/msn/notification.c	Sun Jun 06 02:39:08 2004 +0000
+++ b/src/protocols/msn/notification.c	Sun Jun 06 03:19:41 2004 +0000
@@ -444,6 +444,7 @@
 	MsnUser *user;
 	MsnObject *msnobj;
 	int status = 0;
+	int idle = 0;
 	const char *state, *passport, *friendly;
 	GaimBuddy *b;
 
@@ -473,7 +474,10 @@
 	if (!g_ascii_strcasecmp(state, "BSY"))
 		status |= UC_UNAVAILABLE | (MSN_BUSY << 1);
 	else if (!g_ascii_strcasecmp(state, "IDL"))
+	{
 		status |= UC_UNAVAILABLE | (MSN_IDLE << 1);
+		idle = -1;
+	}
 	else if (!g_ascii_strcasecmp(state, "BRB"))
 		status |= UC_UNAVAILABLE | (MSN_BRB << 1);
 	else if (!g_ascii_strcasecmp(state, "AWY"))
@@ -483,7 +487,7 @@
 	else if (!g_ascii_strcasecmp(state, "LUN"))
 		status |= UC_UNAVAILABLE | (MSN_LUNCH << 1);
 
-	serv_got_update(gc, passport, 1, 0, 0, 0, status);
+	serv_got_update(gc, passport, 1, 0, 0, idle, status);
 }
 
 static void
@@ -512,6 +516,7 @@
 	const char *passport;
 	const char *friendly;
 	int status = 0;
+	int idle = 0;
 
 	session = cmdproc->session;
 	gc = session->account->gc;
@@ -536,7 +541,10 @@
 	if (!g_ascii_strcasecmp(state, "BSY"))
 		status |= UC_UNAVAILABLE | (MSN_BUSY << 1);
 	else if (!g_ascii_strcasecmp(state, "IDL"))
+	{
 		status |= UC_UNAVAILABLE | (MSN_IDLE << 1);
+		idle = -1;
+	}
 	else if (!g_ascii_strcasecmp(state, "BRB"))
 		status |= UC_UNAVAILABLE | (MSN_BRB << 1);
 	else if (!g_ascii_strcasecmp(state, "AWY"))
@@ -546,7 +554,7 @@
 	else if (!g_ascii_strcasecmp(state, "LUN"))
 		status |= UC_UNAVAILABLE | (MSN_LUNCH << 1);
 
-	serv_got_update(gc, passport, 1, 0, 0, 0, status);
+	serv_got_update(gc, passport, 1, 0, 0, idle, status);
 }
 
 static void
@@ -1130,16 +1138,11 @@
 	MsnCmdProc *cmdproc;
 	cmdproc = notification->servconn->cmdproc;
 
-	if (group_id >= 0)
-	{
-		msn_cmdproc_send(cmdproc, "ADD", "%s %s %s %d", list, who,
-						 store_name, group_id);
-	}
-	else
-	{
-		msn_cmdproc_send(cmdproc, "ADD", "%s %s %s", list, who,
-						 store_name);
-	}
+	if (group_id < 0)
+		group_id = 0;
+
+	msn_cmdproc_send(cmdproc, "ADD", "%s %s %s %d",
+					 list, who, store_name, group_id);
 }
 
 void
@@ -1181,6 +1184,7 @@
 	msn_table_add_cmd(cbs_table, "REA", "REA", rea_cmd);
 	/* msn_table_add_cmd(cbs_table, "PRP", "PRP", prp_cmd); */
 	/* msn_table_add_cmd(cbs_table, "BLP", "BLP", blp_cmd); */
+	msn_table_add_cmd(cbs_table, "BLP", "BLP", NULL);
 	msn_table_add_cmd(cbs_table, "REG", "REG", reg_cmd);
 	msn_table_add_cmd(cbs_table, "ADG", "ADG", adg_cmd);
 	msn_table_add_cmd(cbs_table, "RMG", "RMG", rmg_cmd);
@@ -1204,7 +1208,7 @@
 	msn_table_add_cmd(cbs_table, NULL, "RNG", rng_cmd);
 
 	msn_table_add_cmd(cbs_table, NULL, "URL", url_cmd);
-	
+
 	/* msn_table_add_cmd(cbs_table, NULL, "XFR", xfr_cmd); */
 
 	msn_table_add_error(cbs_table, "ADD", add_error);
--- a/src/protocols/msn/switchboard.c	Sun Jun 06 02:39:08 2004 +0000
+++ b/src/protocols/msn/switchboard.c	Sun Jun 06 03:19:41 2004 +0000
@@ -150,7 +150,7 @@
 	{
 		GList *l;	
 
-		/* But we alredy know the switchboard... */
+		/* But we already know the switchboard... */
 		/* What if there is more than one user? */
 		for (l = swboard->users; l != NULL; l = l->next)
 		{
@@ -266,7 +266,7 @@
 
 #if 1
 	if (session->protocol_ver >= 9)
-		/* But we alredy know the switchboard... */
+		/* But we already know the switchboard... */
 		msn_request_buddy_icon(gc, passport);
 #endif
 }
--- a/src/protocols/msn/userlist.c	Sun Jun 06 02:39:08 2004 +0000
+++ b/src/protocols/msn/userlist.c	Sun Jun 06 03:19:41 2004 +0000
@@ -549,7 +549,7 @@
 	int group_id;
 	const char *list;
 	const char *store_name;
-	
+
 	group_id = -1;
 
 	if (group_name != NULL)
@@ -566,12 +566,11 @@
 
 	user = msn_userlist_find_user(userlist, who);
 
-	/* First we're going to check if it's alredy there. */
+	/* First we're going to check if it's already there. */
 	if (user_is_there(user, list_id, group_id))
 	{
 		list = lists[list_id];
-		gaim_debug_error("msn", "User '%s' is alredy there: %s\n",
-						 who, list);
+		gaim_debug_error("msn", "User '%s' is already there: %s\n", who, list);
 		return;
 	}