pidgin/pidgin

Parents 14cda54c3fbf
Children e3934b4c2950
Remove pidgin_parse_x_im_contact as we're no longer using/support it.

Testing Done:
Compiled.

Reviewed at https://reviews.imfreedom.org/r/1447/
--- a/ChangeLog.API Tue May 17 01:49:31 2022 -0500
+++ b/ChangeLog.API Tue May 17 01:53:55 2022 -0500
@@ -948,6 +948,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
--- a/pidgin/gtkutils.c Tue May 17 01:49:31 2022 -0500
+++ b/pidgin/gtkutils.c Tue May 17 01:53:55 2022 -0500
@@ -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)
{
--- a/pidgin/gtkutils.h Tue May 17 01:49:31 2022 -0500
+++ b/pidgin/gtkutils.h Tue May 17 01:53:55 2022 -0500
@@ -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.