diff src/protocols/msn/msn.c @ 6885:66dd420d3d23

[gaim-migrate @ 7431] Add support for removing groups in protocols. Currently, only MSN supports it, but you cannot delete group 0 (aka, "The evil ~ group of DOOM!"), so I'll add a GrossHack (TM) to not show that group if it's empty. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Thu, 18 Sep 2003 05:39:44 +0000
parents 17514a2f976a
children 31a8936bbccc
line wrap: on
line diff
--- a/src/protocols/msn/msn.c	Thu Sep 18 02:56:04 2003 +0000
+++ b/src/protocols/msn/msn.c	Thu Sep 18 05:39:44 2003 +0000
@@ -1191,6 +1191,29 @@
 }
 
 static void
+msn_remove_group(GaimConnection *gc, const char *name)
+{
+	MsnSession *session = (MsnSession *)gc->proto_data;
+	MsnGroup *group;
+
+	if ((group = msn_groups_find_with_name(session->groups, name)) != NULL)
+	{
+		char outparams[MSN_BUF_LEN];
+
+		g_snprintf(outparams, sizeof(outparams), "%d",
+				   msn_group_get_id(group));
+
+		if (!msn_servconn_send_command(session->notification_conn,
+									   "RMG", outparams))
+		{
+			gaim_connection_error(gc, _("Write error"));
+
+			return;
+		}
+	}
+}
+
+static void
 msn_got_info(gpointer data, char *url_text, unsigned long len)
 {
 	char *stripped, *p, *q;
@@ -1460,7 +1483,9 @@
 	msn_rename_group,
 	msn_buddy_free,
 	msn_convo_closed,
-	msn_normalize
+	msn_normalize,
+	NULL,
+	msn_remove_group
 };
 
 static GaimPluginInfo info =