# HG changeset patch
# Node ID c99cef5d7c1e
# Parent  70144e5e0a89
diff --git a/ChangeLog.API b/ChangeLog.API
--- a/ChangeLog.API
+++ b/ChangeLog.API
@@ -940,6 +940,7 @@
 		* pidgin_mini_dialog_links_supported
 		* pidgin_notify_emails_pending
 		* pidgin_notify_emails_present
+		* pidgin_parse_x_im_contact
 		* pidgin_pixbuf_button_from_stock
 		* pidgin_pixbuf_toolbar_button_from_stock
 		* pidgin_dialogs_plugins_info
diff --git a/pidgin/gtkutils.h b/pidgin/gtkutils.h
--- a/pidgin/gtkutils.h
+++ b/pidgin/gtkutils.h
@@ -155,28 +155,6 @@
 void pidgin_retrieve_user_info_in_chat(PurpleConnection *conn, const char *name, int chatid);
 
 /**
- * pidgin_parse_x_im_contact:
- * @msg:          The MIME message.
- * @all_accounts: If TRUE, check all compatible accounts, online or
- *                     offline. If FALSE, check only online accounts.
- * @ret_account:  The best guess at a compatible protocol,
- *                     based on ret_protocol. If NULL, no account was found.
- * @ret_protocol: The returned protocol type.
- * @ret_username: The returned username.
- * @ret_alias:    The returned alias.
- *
- * Parses an application/x-im-contact MIME message and returns the
- * data inside.
- *
- * Returns: TRUE if the message was parsed for the minimum necessary data.
- *         FALSE otherwise.
- */
-gboolean pidgin_parse_x_im_contact(const char *msg, gboolean all_accounts,
-									 PurpleAccount **ret_account,
-									 char **ret_protocol, char **ret_username,
-									 char **ret_alias);
-
-/**
  * pidgin_set_accessible_label:
  * @w: The widget that we want to name.
  * @l: A GtkLabel that we want to use as the ATK name for the widget.
diff --git a/pidgin/gtkutils.c b/pidgin/gtkutils.c
--- a/pidgin/gtkutils.c
+++ b/pidgin/gtkutils.c
@@ -306,146 +306,6 @@
 	g_free(who);
 }
 
-gboolean
-pidgin_parse_x_im_contact(const char *msg, gboolean all_accounts,
-                          PurpleAccount **ret_account, char **ret_protocol,
-                          char **ret_username, char **ret_alias)
-{
-	char *protocol = NULL;
-	char *username = NULL;
-	char *alias    = NULL;
-	char *str;
-	char *s;
-	gboolean valid;
-
-	g_return_val_if_fail(msg          != NULL, FALSE);
-	g_return_val_if_fail(ret_protocol != NULL, FALSE);
-	g_return_val_if_fail(ret_username != NULL, FALSE);
-
-	s = str = g_strdup(msg);
-
-	while (*s != '\r' && *s != '\n' && *s != '\0')
-	{
-		char *key, *value;
-
-		key = s;
-
-		/* Grab the key */
-		while (*s != '\r' && *s != '\n' && *s != '\0' && *s != ' ')
-			s++;
-
-		if (*s == '\r') s++;
-
-		if (*s == '\n')
-		{
-			s++;
-			continue;
-		}
-
-		if (*s != '\0') *s++ = '\0';
-
-		/* Clear past any whitespace */
-		while (*s == ' ')
-			s++;
-
-		/* Now let's grab until the end of the line. */
-		value = s;
-
-		while (*s != '\r' && *s != '\n' && *s != '\0')
-			s++;
-
-		if (*s == '\r') *s++ = '\0';
-		if (*s == '\n') *s++ = '\0';
-
-		if (strchr(key, ':') != NULL)
-		{
-			if (!g_ascii_strcasecmp(key, "X-IM-Username:"))
-				username = g_strdup(value);
-			else if (!g_ascii_strcasecmp(key, "X-IM-Protocol:"))
-				protocol = g_strdup(value);
-			else if (!g_ascii_strcasecmp(key, "X-IM-Alias:"))
-				alias = g_strdup(value);
-		}
-	}
-
-	if (username != NULL && protocol != NULL)
-	{
-		valid = TRUE;
-
-		*ret_username = username;
-		*ret_protocol = protocol;
-
-		if (ret_alias != NULL)
-			*ret_alias = alias;
-
-		/* Check for a compatible account. */
-		if(ret_account != NULL) {
-			PurpleAccount *account = NULL;
-			GList *list;
-			GList *l;
-			const char *protoname;
-
-
-			if(all_accounts) {
-				PurpleAccountManager *manager = NULL;
-
-				manager = purple_account_manager_get_default();
-				list = purple_account_manager_get_all(manager);
-			} else {
-				list = purple_connections_get_all();
-			}
-
-			for (l = list; l != NULL; l = l->next)
-			{
-				PurpleConnection *gc;
-				PurpleProtocol *proto = NULL;
-
-				if (all_accounts)
-				{
-					account = (PurpleAccount *)l->data;
-
-					proto = purple_account_get_protocol(account);
-
-					if (proto == NULL)
-					{
-						account = NULL;
-
-						continue;
-					}
-				}
-				else
-				{
-					gc = (PurpleConnection *)l->data;
-					account = purple_connection_get_account(gc);
-
-					proto = purple_connection_get_protocol(gc);
-				}
-
-				protoname = purple_protocol_get_list_icon(proto, account, NULL);
-
-				if (purple_strequal(protoname, protocol))
-					break;
-
-				account = NULL;
-			}
-
-			*ret_account = account;
-		}
-	}
-	else
-	{
-		valid = FALSE;
-
-		g_free(username);
-		g_free(protocol);
-		g_free(alias);
-	}
-
-	g_free(str);
-
-	return valid;
-}
-
 void
 pidgin_set_accessible_label(GtkWidget *w, GtkLabel *l)
 {
