Index: protocols/msn/msn.c
===================================================================
--- protocols/msn/msn.c	(revision 6e74911ecf99c3b6ff635f7fab5dfe01badc5ce2)
+++ protocols/msn/msn.c	(revision c5a1502afefbebeeb37bfff71602e3af7d303db5)
@@ -96,5 +96,4 @@
 		msn_ns_close(md);
 
-		msn_msgq_purge(ic, &md->msgq);
 		msn_soapq_flush(ic, FALSE);
 
Index: protocols/msn/msn.h
===================================================================
--- protocols/msn/msn.h	(revision 6e74911ecf99c3b6ff635f7fab5dfe01badc5ce2)
+++ protocols/msn/msn.h	(revision c5a1502afefbebeeb37bfff71602e3af7d303db5)
@@ -218,5 +218,4 @@
 int msn_ns_finish_login(struct im_connection *ic);
 int msn_ns_sendmessage(struct im_connection *ic, struct bee_user *bu, const char *text);
-void msn_ns_oim_send_queue(struct im_connection *ic, GSList **msgq);
 int msn_ns_command(struct msn_data *md, char **cmd, int num_parts);
 int msn_ns_message(struct msn_data *md, char *msg, int msglen, char **cmd, int num_parts);
@@ -229,5 +228,4 @@
 char **msn_linesplit(char *line);
 int msn_handler(struct msn_data *h);
-void msn_msgq_purge(struct im_connection *ic, GSList **list);
 char *msn_p11_challenge(char *challenge);
 gint msn_domaintree_cmp(gconstpointer a_, gconstpointer b_);
Index: protocols/msn/msn_util.c
===================================================================
--- protocols/msn/msn_util.c	(revision 6e74911ecf99c3b6ff635f7fab5dfe01badc5ce2)
+++ protocols/msn/msn_util.c	(revision c5a1502afefbebeeb37bfff71602e3af7d303db5)
@@ -55,46 +55,4 @@
 
 	*groupid = '\0';
-#if 0
-	if (group) {
-		int i;
-		for (i = 0; i < md->groupcount; i++) {
-			if (g_strcasecmp(md->grouplist[i], group) == 0) {
-				g_snprintf(groupid, sizeof(groupid), " %d", i);
-				break;
-			}
-		}
-
-		if (*groupid == '\0') {
-			/* Have to create this group, it doesn't exist yet. */
-			struct msn_groupadd *ga;
-			GSList *l;
-
-			for (l = md->grpq; l; l = l->next) {
-				ga = l->data;
-				if (g_strcasecmp(ga->group, group) == 0) {
-					break;
-				}
-			}
-
-			ga = g_new0(struct msn_groupadd, 1);
-			ga->who = g_strdup(who);
-			ga->group = g_strdup(group);
-			md->grpq = g_slist_prepend(md->grpq, ga);
-
-			if (l == NULL) {
-				char groupname[strlen(group) + 1];
-				strcpy(groupname, group);
-				http_encode(groupname);
-				g_snprintf(buf, sizeof(buf), "ADG %d %s %d\r\n", ++md->trId, groupname, 0);
-				return msn_write(ic, buf, strlen(buf));
-			} else {
-				/* This can happen if the user's doing lots of adds to a
-				   new group at once; we're still waiting for the server
-				   to confirm group creation. */
-				return 1;
-			}
-		}
-	}
-#endif
 
 	if (!((bu = bee_user_by_handle(ic->bee, ic, who)) ||
@@ -132,15 +90,4 @@
 
 	*groupid = '\0';
-#if 0
-	if (group) {
-		int i;
-		for (i = 0; i < md->groupcount; i++) {
-			if (g_strcasecmp(md->grouplist[i], group) == 0) {
-				g_snprintf(groupid, sizeof(groupid), " %d", i);
-				break;
-			}
-		}
-	}
-#endif
 
 	if (!(bu = bee_user_by_handle(ic->bee, ic, who)) ||
@@ -369,44 +316,4 @@
 }
 
-void msn_msgq_purge(struct im_connection *ic, GSList **list)
-{
-	struct msn_message *m;
-	GString *ret;
-	GSList *l;
-	int n = 0;
-
-	l = *list;
-	if (l == NULL) {
-		return;
-	}
-
-	m = l->data;
-	ret = g_string_sized_new(1024);
-	g_string_printf(ret, "Warning: Cleaning up MSN (switchboard) connection with unsent "
-	                "messages to %s:", m->who ? m->who : "unknown recipient");
-
-	while (l) {
-		m = l->data;
-
-		if (strncmp(m->text, "\r\r\r", 3) != 0) {
-			g_string_append_printf(ret, "\n%s", m->text);
-			n++;
-		}
-
-		g_free(m->who);
-		g_free(m->text);
-		g_free(m);
-
-		l = l->next;
-	}
-	g_slist_free(*list);
-	*list = NULL;
-
-	if (n > 0) {
-		imcb_log(ic, "%s", ret->str);
-	}
-	g_string_free(ret, TRUE);
-}
-
 /* Copied and heavily modified from http://tmsnc.sourceforge.net/chl.c */
 char *msn_p11_challenge(char *challenge)
Index: protocols/msn/ns.c
===================================================================
--- protocols/msn/ns.c	(revision 6e74911ecf99c3b6ff635f7fab5dfe01badc5ce2)
+++ protocols/msn/ns.c	(revision c5a1502afefbebeeb37bfff71602e3af7d303db5)
@@ -248,6 +248,4 @@
 			handler->msglen = atoi(cmd[2]);
 		}
-	} else if (strcmp(cmd[0], "PRP") == 0) {
-		imcb_connected(ic);
 	} else if (strcmp(cmd[0], "CHL") == 0) {
 		char *resp;
@@ -267,51 +265,4 @@
 		g_free(resp);
 		return st;
-	} else if (strcmp(cmd[0], "ILN") == 0 || strcmp(cmd[0], "NLN") == 0) {
-		const struct msn_away_state *st;
-		const char *handle;
-		int cap = 0;
-
-		if (num_parts < 6) {
-			imcb_error(ic, "Syntax error");
-			imc_logout(ic, TRUE);
-			return(0);
-		}
-		/* ILN and NLN are more or less the same, except ILN has a trId
-		   at the start, and NLN has a capability field at the end.
-		   Does ILN still exist BTW? */
-		if (cmd[0][1] == 'I') {
-			cmd++;
-		} else {
-			cap = atoi(cmd[4]);
-		}
-
-		handle = msn_normalize_handle(cmd[2]);
-		if (strcmp(handle, ic->acc->user) == 0) {
-			return 1; /* That's me! */
-
-		}
-		http_decode(cmd[3]);
-		imcb_rename_buddy(ic, handle, cmd[3]);
-
-		st = msn_away_state_by_code(cmd[1]);
-		if (!st) {
-			/* FIXME: Warn/Bomb about unknown away state? */
-			st = msn_away_state_list + 1;
-		}
-
-		imcb_buddy_status(ic, handle, OPT_LOGGED_IN |
-		                  (st != msn_away_state_list ? OPT_AWAY : 0) |
-		                  (cap & 1 ? OPT_MOBILE : 0),
-		                  st->name, NULL);
-
-	} else if (strcmp(cmd[0], "FLN") == 0) {
-		const char *handle;
-
-		if (cmd[1] == NULL) {
-			return 1;
-		}
-
-		handle = msn_normalize_handle(cmd[1]);
-		imcb_buddy_status(ic, handle, 0, NULL, NULL);
 	} else if (strcmp(cmd[0], "OUT") == 0) {
 		int allow_reconnect = TRUE;
@@ -329,78 +280,11 @@
 		imc_logout(ic, allow_reconnect);
 		return(0);
-	} else if (strcmp(cmd[0], "IPG") == 0) {
-		imcb_error(ic, "Received IPG command, we don't handle them yet.");
-
-		handler->msglen = atoi(cmd[1]);
-
-		if (handler->msglen <= 0) {
-			imcb_error(ic, "Syntax error");
-			imc_logout(ic, TRUE);
-			return(0);
-		}
-	}
-#if 0
-	else if (strcmp(cmd[0], "ADG") == 0) {
-		char *group = g_strdup(cmd[3]);
-		int groupnum, i;
-		GSList *l, *next;
-
-		http_decode(group);
-		if (sscanf(cmd[4], "%d", &groupnum) == 1) {
-			if (groupnum >= md->groupcount) {
-				md->grouplist = g_renew(char *, md->grouplist, groupnum + 1);
-				for (i = md->groupcount; i <= groupnum; i++) {
-					md->grouplist[i] = NULL;
-				}
-				md->groupcount = groupnum + 1;
-			}
-			g_free(md->grouplist[groupnum]);
-			md->grouplist[groupnum] = group;
-		} else {
-			/* Shouldn't happen, but if it does, give up on the group. */
-			g_free(group);
-			imcb_error(ic, "Syntax error");
-			imc_logout(ic, TRUE);
-			return 0;
-		}
-
-		for (l = md->grpq; l; l = next) {
-			struct msn_groupadd *ga = l->data;
-			next = l->next;
-			if (g_strcasecmp(ga->group, group) == 0) {
-				if (!msn_buddy_list_add(ic, "FL", ga->who, ga->who, group)) {
-					return 0;
-				}
-
-				g_free(ga->group);
-				g_free(ga->who);
-				g_free(ga);
-				md->grpq = g_slist_remove(md->grpq, ga);
-			}
-		}
-	}
-#endif
-	else if (strcmp(cmd[0], "GCF") == 0) {
+	} else if (strcmp(cmd[0], "GCF") == 0) {
 		/* Coming up is cmd[2] bytes of stuff we're supposed to
 		   censore. Meh. */
 		handler->msglen = atoi(cmd[2]);
-	} else if (strcmp(cmd[0], "UBX") == 0) {
-		/* Status message. */
-		if (num_parts >= 3) {
-			handler->msglen = atoi(cmd[2]);
-		}
-	} else if (strcmp(cmd[0], "NOT") == 0) {
-		/* Some kind of notification, poorly documented but
-		   apparently used to announce address book changes. */
-		if (num_parts >= 2) {
-			handler->msglen = atoi(cmd[1]);
-		}
 	} else if ((strcmp(cmd[0], "NFY") == 0) || (strcmp(cmd[0], "SDG") == 0)) {
 		if (num_parts >= 3) {
 			handler->msglen = atoi(cmd[2]);
-		}
-	} else if (strcmp(cmd[0], "UBM") == 0) {
-		if (num_parts >= 7) {
-			handler->msglen = atoi(cmd[6]);
 		}
 	} else if (strcmp(cmd[0], "QNG") == 0) {
@@ -422,5 +306,5 @@
 		}
 	} else {
-		/* debug( "Received unknown command from main server: %s", cmd[0] ); */
+		imcb_error(ic, "Received unknown command from main server: %s", cmd[0]);
 	}
 
@@ -501,56 +385,5 @@
 				}
 			} else if (g_strncasecmp(ct, "text/x-msmsgsactivemailnotification", 35) == 0) {
-			} else if (g_strncasecmp(ct, "text/x-msmsgsinitialmdatanotification", 37) == 0 ||
-			           g_strncasecmp(ct, "text/x-msmsgsoimnotification", 28) == 0) {
-				/* We received an offline message. Or at least notification
-				   that there is one waiting for us. Fetching the message(s)
-				   and purging them from the server is a lot of SOAPy work
-				   not worth doing IMHO. Also I thought it was possible to
-				   have the notification server send them directly, I was
-				   pretty sure I saw Pidgin do it..
-
-				   At least give a notification for now, seems like a
-				   reasonable thing to do. Only problem is, they'll keep
-				   coming back at login time until you read them using a
-				   different client. :-( */
-
-				char *xml = get_rfc822_header(body, "Mail-Data:", blen);
-				struct xt_node *md, *m;
-
-				if (!xml) {
-					return 1;
-				}
-				md = xt_from_string(xml, 0);
-				if (!md) {
-					return 1;
-				}
-
-				for (m = md->children; (m = xt_find_node(m, "M")); m = m->next) {
-					struct xt_node *e = xt_find_node(m->children, "E");
-					struct xt_node *rt = xt_find_node(m->children, "RT");
-					struct tm tp;
-					time_t msgtime = 0;
-
-					if (!e || !e->text) {
-						continue;
-					}
-
-					memset(&tp, 0, sizeof(tp));
-					if (rt && rt->text &&
-					    sscanf(rt->text, "%4d-%2d-%2dT%2d:%2d:%2d.",
-					           &tp.tm_year, &tp.tm_mon, &tp.tm_mday,
-					           &tp.tm_hour, &tp.tm_min, &tp.tm_sec) == 6) {
-						tp.tm_year -= 1900;
-						tp.tm_mon--;
-						msgtime = mktime_utc(&tp);
-
-					}
-					imcb_buddy_msg(ic, e->text,
-					               "<< \002BitlBee\002 - Received offline message. BitlBee can't show these. >>", 0,
-					               msgtime);
-				}
-
-				g_free(xml);
-				xt_free_node(md);
+				/* Notification that a message has been read... Ignore it */
 			} else {
 				debug("Can't handle %s packet from notification server", ct);
@@ -559,16 +392,4 @@
 			g_free(ct);
 		}
-	} else if (strcmp(cmd[0], "UBX") == 0) {
-		struct xt_node *ubx, *psm;
-		char *psm_text = NULL;
-
-		ubx = xt_from_string(msg, msglen);
-		if (ubx && strcmp(ubx->name, "Data") == 0 &&
-		    (psm = xt_find_node(ubx->children, "PSM"))) {
-			psm_text = psm->text;
-		}
-
-		imcb_buddy_status_msg(ic, msn_normalize_handle(cmd[1]), psm_text);
-		xt_free_node(ubx);
 	} else if (strcmp(cmd[0], "ADL") == 0) {
 		struct xt_node *adl, *d, *c;
@@ -782,9 +603,5 @@
 
 	if ((md->flags & MSN_DONE_ADL) && (md->flags & MSN_GOT_PROFILE)) {
-		if (md->flags & MSN_EMAIL_UNVERIFIED) {
-			imcb_connected(ic);
-		} else {
-			return msn_ns_set_display_name(ic, set_getstr(&ic->acc->set, "display_name"));
-		}
+		imcb_connected(ic);
 	}
 
@@ -810,27 +627,2 @@
 	return retval;
 }
-
-void msn_ns_oim_send_queue(struct im_connection *ic, GSList **msgq)
-{
-	GSList *l;
-
-	for (l = *msgq; l; l = l->next) {
-		struct msn_message *m = l->data;
-		bee_user_t *bu = bee_user_by_handle(ic->bee, ic, m->who);
-
-		if (bu) {
-			if (!msn_ns_sendmessage(ic, bu, m->text)) {
-				return;
-			}
-		}
-	}
-
-	while (*msgq != NULL) {
-		struct msn_message *m = (*msgq)->data;
-
-		*msgq = g_slist_remove(*msgq, m);
-		g_free(m->who);
-		g_free(m->text);
-		g_free(m);
-	}
-}
