The e2ee api appears to not be used anywhere. It could use a bunch of cleanup, but I'd rather do that when we're implementing e2ee in protocols as we'll have a better understanding of what it needs then.

Thu, 20 Feb 2020 23:56:05 -0600

author
Gary Kramlich <grim@reaperworld.com>
date
Thu, 20 Feb 2020 23:56:05 -0600
changeset 40304
a3d49ff045a8
parent 40303
0a01f2c891c2
child 40305
d0aa478e8e8a
child 40307
507f9d1dae10

The e2ee api appears to not be used anywhere. It could use a bunch of cleanup, but I'd rather do that when we're implementing e2ee in protocols as we'll have a better understanding of what it needs then.

doc/reference/libpurple/libpurple-docs.xml file | annotate | diff | comparison | revisions
finch/gntconv.c file | annotate | diff | comparison | revisions
finch/gntconv.h file | annotate | diff | comparison | revisions
libpurple/conversation.c file | annotate | diff | comparison | revisions
libpurple/conversation.h file | annotate | diff | comparison | revisions
libpurple/e2ee.c file | annotate | diff | comparison | revisions
libpurple/e2ee.h file | annotate | diff | comparison | revisions
libpurple/meson.build file | annotate | diff | comparison | revisions
pidgin/gtkconv.c file | annotate | diff | comparison | revisions
pidgin/gtkconvwin.h file | annotate | diff | comparison | revisions
pidgin/gtkinternal.h file | annotate | diff | comparison | revisions
pidgin/gtkrequest.c file | annotate | diff | comparison | revisions
po/POTFILES.in file | annotate | diff | comparison | revisions
--- a/doc/reference/libpurple/libpurple-docs.xml	Fri Feb 21 02:45:13 2020 +0000
+++ b/doc/reference/libpurple/libpurple-docs.xml	Thu Feb 20 23:56:05 2020 -0600
@@ -46,7 +46,6 @@
       <xi:include href="xml/conversations.xml" />
       <xi:include href="xml/countingnode.xml" />
       <xi:include href="xml/debug.xml" />
-      <xi:include href="xml/e2ee.xml" />
       <xi:include href="xml/eventloop.xml" />
       <xi:include href="xml/group.xml" />
       <xi:include href="xml/xfer.xml" />
--- a/finch/gntconv.c	Fri Feb 21 02:45:13 2020 +0000
+++ b/finch/gntconv.c	Thu Feb 20 23:56:05 2020 -0600
@@ -64,7 +64,6 @@
 #include "config.h"
 
 static void generate_send_to_menu(FinchConv *ggc);
-static void generate_e2ee_menu(FinchConv *ggc);
 
 static int color_message_receive;
 static int color_message_send;
@@ -253,18 +252,10 @@
 static char *
 get_conversation_title(PurpleConversation *conv, PurpleAccount *account)
 {
-	PurpleE2eeState *e2ee;
-
-	e2ee = purple_conversation_get_e2ee_state(conv);
-
-	return g_strdup_printf(_("%s (%s -- %s)%s%s%s%s"),
+	return g_strdup_printf(_("%s (%s -- %s)"),
 		purple_conversation_get_title(conv),
 		purple_account_get_username(account),
-		purple_account_get_protocol_name(account),
-		e2ee ? " | " : "",
-		e2ee ? purple_e2ee_provider_get_name(purple_e2ee_state_get_provider(e2ee)) : "",
-		e2ee ? ": " : "",
-		e2ee ? purple_e2ee_state_get_name(e2ee) : "");
+		purple_account_get_protocol_name(account));
 }
 
 static void
@@ -434,19 +425,6 @@
 		gg_extended_menu(purple_conversation_get_ui_data(conv));
 		return;
 	}
-	if (type == PURPLE_CONVERSATION_UPDATE_E2EE) {
-		FinchConv *ggconv = FINCH_CONV(conv);
-		gchar *title;
-
-		title = get_conversation_title(conv,
-			purple_conversation_get_account(conv));
-		gnt_screen_rename_widget(ggconv->window, title);
-		g_free(title);
-
-		generate_e2ee_menu(ggconv);
-
-		return;
-	}
 }
 
 static void
@@ -633,41 +611,6 @@
 }
 
 static void
-generate_e2ee_menu(FinchConv *ggc)
-{
-	GntMenu *sub;
-	GntWidget *menu = ggc->menu;
-	PurpleConversation *conv = ggc->active_conv;
-	GntMenuItem *item;
-	PurpleE2eeProvider *eprov;
-	GList *menu_actions, *it;
-
-	eprov = purple_e2ee_provider_get_main();
-
-	item = ggc->u.im->e2ee_menu;
-	if (item == NULL) {
-		item = gnt_menuitem_new(NULL);
-		gnt_menu_add_item(GNT_MENU(menu), item);
-		ggc->u.im->e2ee_menu = item;
-	}
-	sub = GNT_MENU(gnt_menu_new(GNT_MENU_POPUP));
-	gnt_menuitem_set_submenu(item, GNT_MENU(sub));
-
-	gnt_menuitem_set_visible(item, (eprov != NULL));
-	if (eprov == NULL)
-		return;
-	gnt_menuitem_set_text(item, purple_e2ee_provider_get_name(eprov));
-
-	menu_actions = purple_e2ee_provider_get_conv_menu_actions(eprov, conv);
-	for (it = menu_actions; it; it = g_list_next(it)) {
-		PurpleActionMenu *action = it->data;
-
-		finch_append_menu_action(sub, action, conv);
-	}
-	g_list_free(menu_actions);
-}
-
-static void
 invite_cb(GntMenuItem *item, gpointer ggconv)
 {
 	FinchConv *fc = ggconv;
@@ -741,8 +684,6 @@
 		gnt_menuitem_set_callback(item, invite_cb, ggc);
 	}
 
-	generate_e2ee_menu(ggc);
-
 	item = gnt_menuitem_new(_("View Log..."));
 	gnt_menu_add_item(GNT_MENU(sub), item);
 	gnt_menuitem_set_callback(item, view_log_cb, ggc);
@@ -1561,8 +1502,6 @@
 	title = get_conversation_title(conv, account);
 	gnt_screen_rename_widget(ggconv->window, title);
 	g_free(title);
-
-	generate_e2ee_menu(ggconv);
 }
 
 void finch_conversation_set_info_widget(PurpleConversation *conv, GntWidget *widget)
--- a/finch/gntconv.h	Fri Feb 21 02:45:13 2020 +0000
+++ b/finch/gntconv.h	Thu Feb 20 23:56:05 2020 -0600
@@ -113,15 +113,12 @@
  * FinchConvIm:
  * @sendto: The sendto widget which allows the user to select who they're
  *          messaging.
- * @e2ee_menu: The end-to-end-encryption widget which lets the user configure
- *             the encryption.
  *
  * The instant message implementation for a conversation.
  */
 struct _FinchConvIm
 {
 	GntMenuItem *sendto;
-	GntMenuItem *e2ee_menu;
 
 	/*< private >*/
 	void *finch_reserved1;
--- a/libpurple/conversation.c	Fri Feb 21 02:45:13 2020 +0000
+++ b/libpurple/conversation.c	Thu Feb 20 23:56:05 2020 -0600
@@ -53,8 +53,6 @@
 	PurpleConnectionFlags features;   /* The supported features            */
 	GList *message_history; /* Message history, as a GList of PurpleMessages */
 
-	PurpleE2eeState *e2ee_state;      /* End-to-end encryption state.      */
-
 	/* The list of remote smileys. This should be per-buddy (PurpleBuddy),
 	 * but we don't have any class for people not on our buddy
 	 * list (PurpleDude?). So, if we have one, we should switch to it. */
@@ -417,60 +415,6 @@
 }
 
 void
-purple_conversation_set_e2ee_state(PurpleConversation *conv,
-	PurpleE2eeState *state)
-{
-	PurpleConversationPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_CONVERSATION(conv));
-	priv = purple_conversation_get_instance_private(conv);
-
-	if (state != NULL && purple_e2ee_state_get_provider(state) !=
-		purple_e2ee_provider_get_main())
-	{
-		purple_debug_error("conversation",
-			"This is not the main e2ee provider");
-
-		return;
-	}
-
-	if (state == priv->e2ee_state)
-		return;
-
-	if (state)
-		purple_e2ee_state_ref(state);
-	purple_e2ee_state_unref(priv->e2ee_state);
-	priv->e2ee_state = state;
-
-	purple_conversation_update(conv, PURPLE_CONVERSATION_UPDATE_E2EE);
-}
-
-PurpleE2eeState *
-purple_conversation_get_e2ee_state(PurpleConversation *conv)
-{
-	PurpleConversationPrivate *priv = NULL;
-	PurpleE2eeProvider *provider;
-
-	g_return_val_if_fail(PURPLE_IS_CONVERSATION(conv), NULL);
-	priv = purple_conversation_get_instance_private(conv);
-
-	if (priv->e2ee_state == NULL)
-		return NULL;
-
-	provider = purple_e2ee_provider_get_main();
-	if (provider == NULL)
-		return NULL;
-
-	if (purple_e2ee_state_get_provider(priv->e2ee_state) != provider) {
-		purple_debug_warning("conversation",
-			"e2ee state has invalid provider set");
-		return NULL;
-	}
-
-	return priv->e2ee_state;
-}
-
-void
 purple_conversation_set_logging(PurpleConversation *conv, gboolean log)
 {
 	PurpleConversationPrivate *priv = NULL;
@@ -1029,10 +973,7 @@
 
 	purple_request_close_with_handle(conv);
 
-	purple_e2ee_state_unref(priv->e2ee_state);
-	priv->e2ee_state = NULL;
-
-	/* remove from conversations and im/chats lists prior to emit */
+ 	/* remove from conversations and im/chats lists prior to emit */
 	purple_conversations_remove(conv);
 
 	purple_signal_emit(purple_conversations_get_handle(),
--- a/libpurple/conversation.h	Fri Feb 21 02:45:13 2020 +0000
+++ b/libpurple/conversation.h	Thu Feb 20 23:56:05 2020 -0600
@@ -65,8 +65,6 @@
  * @PURPLE_CONVERSATION_UPDATE_LOGGING:  Logging for this conversation was
  *                                       enabled or disabled.
  * @PURPLE_CONVERSATION_UPDATE_TOPIC:    The topic for a chat was updated.
- * @PURPLE_CONVERSATION_UPDATE_E2EE:     The End-to-end encryption state was
- *                                       updated.
  * @PURPLE_CONVERSATION_ACCOUNT_ONLINE:  One of the user's accounts went online.
  * @PURPLE_CONVERSATION_ACCOUNT_OFFLINE: One of the user's accounts went
  *                                       offline.
@@ -88,7 +86,6 @@
 	PURPLE_CONVERSATION_UPDATE_UNSEEN,
 	PURPLE_CONVERSATION_UPDATE_LOGGING,
 	PURPLE_CONVERSATION_UPDATE_TOPIC,
-	PURPLE_CONVERSATION_UPDATE_E2EE,
 
 	/*
 	 * XXX These need to go when we implement a more generic core/UI event
@@ -201,7 +198,6 @@
 
 #include "account.h"
 #include "buddyicon.h"
-#include "e2ee.h"
 #include "log.h"
 #include "smiley-list.h"
 
@@ -423,28 +419,6 @@
 const char *purple_conversation_get_name(PurpleConversation *conv);
 
 /**
- * purple_conversation_set_e2ee_state:
- * @conv:  The conversation.
- * @state: The E2EE state.
- *
- * Sets current E2EE state for the conversation.
- */
-void
-purple_conversation_set_e2ee_state(PurpleConversation *conv,
-	PurpleE2eeState *state);
-
-/**
- * purple_conversation_get_e2ee_state:
- * @conv: The conversation.
- *
- * Gets current conversation's E2EE state.
- *
- * Returns: (transfer none): Current E2EE state for conversation.
- */
-PurpleE2eeState *
-purple_conversation_get_e2ee_state(PurpleConversation *conv);
-
-/**
  * purple_conversation_set_logging:
  * @conv: The conversation.
  * @log:  %TRUE if logging should be enabled, or %FALSE otherwise.
--- a/libpurple/e2ee.c	Fri Feb 21 02:45:13 2020 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,251 +0,0 @@
-/* purple
- *
- * Purple is the legal property of its developers, whose names are too numerous
- * to list here.  Please refer to the COPYRIGHT file distributed with this
- * source distribution.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
- */
-
-#include "e2ee.h"
-
-#include "debug.h"
-
-struct _PurpleE2eeState
-{
-	PurpleE2eeProvider *provider;
-
-	gchar *name;
-	gchar *stock_icon;
-
-	guint ref_count;
-};
-
-struct _PurpleE2eeProvider
-{
-	gchar *name;
-	PurpleE2eeConvMenuCallback conv_menu_cb;
-};
-
-static PurpleE2eeProvider *main_provider = NULL;
-
-/*** Encryption states for conversations. *************************************/
-
-PurpleE2eeState *
-purple_e2ee_state_new(PurpleE2eeProvider *provider)
-{
-	PurpleE2eeState *state;
-
-	g_return_val_if_fail(provider != NULL, NULL);
-
-	state = g_new0(PurpleE2eeState, 1);
-	state->provider = provider;
-	state->ref_count = 1;
-
-	return state;
-}
-
-void
-purple_e2ee_state_ref(PurpleE2eeState *state)
-{
-	g_return_if_fail(state != NULL);
-
-	state->ref_count++;
-}
-
-PurpleE2eeState *
-purple_e2ee_state_unref(PurpleE2eeState *state)
-{
-	if (state == NULL)
-		return NULL;
-
-	state->ref_count--;
-	if (state->ref_count > 0)
-		return state;
-
-	g_free(state->name);
-	g_free(state->stock_icon);
-	g_free(state);
-
-	return NULL;
-}
-
-PurpleE2eeProvider *
-purple_e2ee_state_get_provider(PurpleE2eeState *state)
-{
-	g_return_val_if_fail(state != NULL, NULL);
-
-	return state->provider;
-}
-
-void
-purple_e2ee_state_set_name(PurpleE2eeState *state, const gchar *name)
-{
-	g_return_if_fail(state != NULL);
-	g_return_if_fail(name != NULL);
-
-	g_free(state->name);
-	state->name = g_strdup(name);
-}
-
-const gchar *
-purple_e2ee_state_get_name(PurpleE2eeState *state)
-{
-	g_return_val_if_fail(state != NULL, NULL);
-
-	return state->name;
-}
-
-void
-purple_e2ee_state_set_stock_icon(PurpleE2eeState *state,
-	const gchar *stock_icon)
-{
-	g_return_if_fail(state != NULL);
-	g_return_if_fail(stock_icon != NULL);
-
-	g_free(state->stock_icon);
-	state->stock_icon = g_strdup(stock_icon);
-}
-
-const gchar *
-purple_e2ee_state_get_stock_icon(PurpleE2eeState *state)
-{
-	g_return_val_if_fail(state, NULL);
-
-	return state->stock_icon;
-}
-
-/*** Encryption providers API. ************************************************/
-
-PurpleE2eeProvider *
-purple_e2ee_provider_new(void)
-{
-	PurpleE2eeProvider *provider;
-
-	provider = g_new0(PurpleE2eeProvider, 1);
-
-	return provider;
-}
-
-void
-purple_e2ee_provider_free(PurpleE2eeProvider *provider)
-{
-	g_return_if_fail(provider != NULL);
-
-	if (provider == main_provider) {
-		purple_debug_error("e2ee", "This provider is still registered");
-		return;
-	}
-
-	g_free(provider->name);
-	g_free(provider);
-}
-
-gboolean
-purple_e2ee_provider_register(PurpleE2eeProvider *provider)
-{
-	g_return_val_if_fail(provider != NULL, FALSE);
-
-	if (main_provider != NULL)
-		return FALSE;
-
-	main_provider = provider;
-	return TRUE;
-}
-
-void
-purple_e2ee_provider_unregister(PurpleE2eeProvider *provider)
-{
-	GList *it, *clear_states = NULL;
-	g_return_if_fail(provider != NULL);
-
-	if (main_provider != provider) {
-		purple_debug_warning("e2ee", "This provider is not registered");
-		return;
-	}
-
-	for (it = purple_conversations_get_all(); it; it = g_list_next(it)) {
-		PurpleConversation *conv = it->data;
-		PurpleE2eeState *state;
-
-		state = purple_conversation_get_e2ee_state(conv);
-		if (!state)
-			continue;
-		if (provider == purple_e2ee_state_get_provider(state))
-			clear_states = g_list_prepend(clear_states, conv);
-	}
-
-	main_provider = NULL;
-
-	g_list_foreach(clear_states, (GFunc)purple_conversation_set_e2ee_state, NULL);
-	g_list_free(clear_states);
-}
-
-PurpleE2eeProvider *
-purple_e2ee_provider_get_main(void)
-{
-	return main_provider;
-}
-
-void
-purple_e2ee_provider_set_name(PurpleE2eeProvider *provider, const gchar *name)
-{
-	g_return_if_fail(provider != NULL);
-	g_return_if_fail(name != NULL);
-
-	g_free(provider->name);
-	provider->name = g_strdup(name);
-}
-
-const gchar *
-purple_e2ee_provider_get_name(PurpleE2eeProvider *provider)
-{
-	g_return_val_if_fail(provider != NULL, NULL);
-
-	return provider->name;
-}
-
-void
-purple_e2ee_provider_set_conv_menu_cb(PurpleE2eeProvider *provider,
-	PurpleE2eeConvMenuCallback conv_menu_cb)
-{
-	g_return_if_fail(provider != NULL);
-
-	provider->conv_menu_cb = conv_menu_cb;
-}
-
-PurpleE2eeConvMenuCallback
-purple_e2ee_provider_get_conv_menu_cb(PurpleE2eeProvider *provider)
-{
-	g_return_val_if_fail(provider != NULL, NULL);
-
-	return provider->conv_menu_cb;
-}
-
-GList *
-purple_e2ee_provider_get_conv_menu_actions(PurpleE2eeProvider *provider,
-	PurpleConversation *conv)
-{
-	PurpleE2eeConvMenuCallback cb;
-
-	g_return_val_if_fail(provider, NULL);
-	g_return_val_if_fail(conv, NULL);
-
-	cb = purple_e2ee_provider_get_conv_menu_cb(provider);
-	if (cb == NULL)
-		return NULL;
-
-	return cb(conv);
-}
--- a/libpurple/e2ee.h	Fri Feb 21 02:45:13 2020 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,257 +0,0 @@
-/* purple
- *
- * Purple is the legal property of its developers, whose names are too numerous
- * to list here.  Please refer to the COPYRIGHT file distributed with this
- * source distribution.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
- */
-
-#ifndef PURPLE_E2EE_H
-#define PURPLE_E2EE_H
-/**
- * SECTION:e2ee
- * @section_id: libpurple-e2ee
- * @short_description: <filename>e2ee.h</filename>
- * @title: End-to-end Encryption API
- */
-
-typedef struct _PurpleE2eeState PurpleE2eeState;
-
-typedef struct _PurpleE2eeProvider PurpleE2eeProvider;
-
-#include <glib.h>
-#include "conversation.h"
-
-typedef GList * (*PurpleE2eeConvMenuCallback)(PurpleConversation *conv);
-
-G_BEGIN_DECLS
-
-/**************************************************************************/
-/* Encryption states for conversations.                                   */
-/**************************************************************************/
-
-/**
- * purple_e2ee_state_new:
- * @provider: The E2EE provider that created this state.
- *
- * Creates new E2EE state.
- *
- * State objects are global (shared between multiple conversations).
- *
- * Returns: (transfer full): New E2EE state.
- */
-PurpleE2eeState *
-purple_e2ee_state_new(PurpleE2eeProvider *provider);
-
-/**
- * purple_e2ee_state_ref:
- * @state: The E2EE state.
- *
- * Increment the reference count.
- */
-void
-purple_e2ee_state_ref(PurpleE2eeState *state);
-
-/**
- * purple_e2ee_state_unref:
- * @state: The E2EE state.
- *
- * Decrement the reference count.
- *
- * If the reference count reaches zero, the state will be freed.
- *
- * Returns: (transfer full): @state or %NULL if the reference count reached zero.
- */
-PurpleE2eeState *
-purple_e2ee_state_unref(PurpleE2eeState *state);
-
-/**
- * purple_e2ee_state_get_provider:
- * @state: The E2EE state.
- *
- * Gets the provider of specified E2EE state.
- *
- * Returns: (transfer none): The provider for this state.
- */
-PurpleE2eeProvider *
-purple_e2ee_state_get_provider(PurpleE2eeState *state);
-
-/**
- * purple_e2ee_state_set_name:
- * @state: The E2EE state.
- * @name:  The localized name.
- *
- * Sets the name for the E2EE state.
- */
-void
-purple_e2ee_state_set_name(PurpleE2eeState *state, const gchar *name);
-
-/**
- * purple_e2ee_state_get_name:
- * @state: The E2EE state.
- *
- * Gets the name of the E2EE state.
- *
- * Returns: The localized name.
- */
-const gchar *
-purple_e2ee_state_get_name(PurpleE2eeState *state);
-
-/**
- * purple_e2ee_state_set_stock_icon:
- * @state:      The E2EE state.
- * @stock_icon: The stock icon identifier.
- *
- * Sets the icon for the E2EE state.
- */
-void
-purple_e2ee_state_set_stock_icon(PurpleE2eeState *state,
-	const gchar *stock_icon);
-
-/**
- * purple_e2ee_state_get_stock_icon:
- * @state: The E2EE state.
- *
- * Gets the icon of the E2EE state.
- *
- * Returns: The stock icon identifier.
- */
-const gchar *
-purple_e2ee_state_get_stock_icon(PurpleE2eeState *state);
-
-
-/**************************************************************************/
-/* Encryption providers API.                                              */
-/**************************************************************************/
-
-/**
- * purple_e2ee_provider_new:
- *
- * Creates new E2EE provider.
- *
- * Returns: (transfer full): New E2EE provider.
- */
-PurpleE2eeProvider *
-purple_e2ee_provider_new(void);
-
-/**
- * purple_e2ee_provider_free:
- * @provider: The provider.
- *
- * Destroys the E2EE provider.
- *
- * The provider have to be unregistered prior.
- */
-void
-purple_e2ee_provider_free(PurpleE2eeProvider *provider);
-
-/**
- * purple_e2ee_provider_register:
- * @provider: The E2EE provider.
- *
- * Registers the E2EE provider.
- *
- * Currently, there is no support for multiple E2EE providers - only the first
- * one is registered.
- *
- * Returns: %TRUE, if the provider was successfully registered,
- *         %FALSE otherwise.
- */
-gboolean
-purple_e2ee_provider_register(PurpleE2eeProvider *provider);
-
-/**
- * purple_e2ee_provider_unregister:
- * @provider: The E2EE provider.
- *
- * Unregisters the E2EE provider.
- */
-void
-purple_e2ee_provider_unregister(PurpleE2eeProvider *provider);
-
-/**
- * purple_e2ee_provider_get_main:
- *
- * Gets main E2EE provider.
- *
- * Returns: (transfer none): The main E2EE provider.
- */
-PurpleE2eeProvider *
-purple_e2ee_provider_get_main(void);
-
-/**
- * purple_e2ee_provider_set_name:
- * @provider: The E2EE provider.
- * @name:     The localized name.
- *
- * Sets the name for the E2EE provider.
- */
-void
-purple_e2ee_provider_set_name(PurpleE2eeProvider *provider, const gchar *name);
-
-/**
- * purple_e2ee_provider_get_name:
- * @provider: The E2EE provider.
- *
- * Gets the name of the E2EE provider.
- *
- * Returns: The localized name of specified E2EE provider.
- */
-const gchar *
-purple_e2ee_provider_get_name(PurpleE2eeProvider *provider);
-
-/**
- * purple_e2ee_provider_set_conv_menu_cb:
- * @provider:     The E2EE provider.
- * @conv_menu_cb: (scope call): The callback.
- *
- * Sets the conversation menu callback for the E2EE provider.
- *
- * The function is called, when user extends the E2EE menu for the conversation
- * specified in its parameter.
- *
- * Function should return the GList of PurpleActionMenu objects.
- */
-void
-purple_e2ee_provider_set_conv_menu_cb(PurpleE2eeProvider *provider,
-	PurpleE2eeConvMenuCallback conv_menu_cb);
-
-/**
- * purple_e2ee_provider_get_conv_menu_cb:
- * @provider: The E2EE provider.
- *
- * Gets the conversation menu callback of the E2EE provider.
- *
- * Returns: The callback.
- */
-PurpleE2eeConvMenuCallback
-purple_e2ee_provider_get_conv_menu_cb(PurpleE2eeProvider *provider);
-
-/**
- * purple_e2ee_provider_get_conv_menu_actions:
- * @provider: The E2EE provider.
- * @conv: The conversation.
- *
- * Returns: (element-type PurpleActionMenu) (transfer full): The list of
- *          actions for an E2EE menu.
- */
-GList *
-purple_e2ee_provider_get_conv_menu_actions(PurpleE2eeProvider *provider,
-	PurpleConversation *conv);
-
-G_END_DECLS
-
-#endif /* PURPLE_E2EE_H */
--- a/libpurple/meson.build	Fri Feb 21 02:45:13 2020 +0000
+++ b/libpurple/meson.build	Thu Feb 20 23:56:05 2020 -0600
@@ -18,7 +18,6 @@
 	'core.c',
 	'countingnode.c',
 	'debug.c',
-	'e2ee.c',
 	'eventloop.c',
 	'group.c',
 	'idle.c',
@@ -100,7 +99,6 @@
 	'core.h',
 	'countingnode.h',
 	'debug.h',
-	'e2ee.h',
 	'eventloop.h',
 	'group.h',
 	'idle.h',
--- a/pidgin/gtkconv.c	Fri Feb 21 02:45:13 2020 +0000
+++ b/pidgin/gtkconv.c	Thu Feb 20 23:56:05 2020 -0600
@@ -119,7 +119,6 @@
 	PIDGIN_CONV_TOPIC			= 1 << 4,
 	PIDGIN_CONV_SMILEY_THEME		= 1 << 5,
 	PIDGIN_CONV_COLORIZE_TITLE		= 1 << 6,
-	PIDGIN_CONV_E2EE			= 1 << 7
 }PidginConvFields;
 
 enum {
@@ -162,7 +161,6 @@
 static GList *xa_list = NULL;
 static GList *offline_list = NULL;
 static GHashTable *protocol_lists = NULL;
-static GHashTable *e2ee_stock = NULL;
 
 static gboolean update_send_to_selection(PidginConvWindow *win);
 static void generate_send_to_items(PidginConvWindow *win);
@@ -3348,28 +3346,13 @@
 	return FALSE;
 }
 
-static GtkWidget *
-e2ee_state_to_gtkimage(PurpleE2eeState *state)
-{
-	PurpleImage *img;
-
-	img = _pidgin_e2ee_stock_icon_get(
-		purple_e2ee_state_get_stock_icon(state));
-	if (!img)
-		return NULL;
-
-	return gtk_image_new_from_pixbuf(pidgin_pixbuf_from_image(img));
-}
-
 static void
 create_sendto_item(GtkWidget *menu, GtkSizeGroup *sg, GSList **group,
-	PurpleBuddy *buddy, PurpleAccount *account, const char *name,
-	gboolean e2ee_enabled)
+	PurpleBuddy *buddy, PurpleAccount *account, const char *name)
 {
 	GtkWidget *box;
 	GtkWidget *label;
 	GtkWidget *image;
-	GtkWidget *e2ee_image = NULL;
 	GtkWidget *menuitem;
 	GdkPixbuf *pixbuf;
 	gchar *text;
@@ -3386,20 +3369,6 @@
 		g_object_unref(G_OBJECT(pixbuf));
 	}
 
-	if (e2ee_enabled) {
-		PurpleIMConversation *im;
-		PurpleE2eeState *state = NULL;
-
-		im = purple_conversations_find_im_with_account(
-			purple_buddy_get_name(buddy), purple_buddy_get_account(buddy));
-		if (im)
-			state = purple_conversation_get_e2ee_state(PURPLE_CONVERSATION(im));
-		if (state)
-			e2ee_image = e2ee_state_to_gtkimage(state);
-		else
-			e2ee_image = gtk_image_new();
-	}
-
 	gtk_size_group_add_widget(sg, image);
 
 	/* Make our menu item */
@@ -3418,8 +3387,6 @@
 	gtk_box_pack_start(GTK_BOX(box), image, FALSE, FALSE, 0);
 
 	gtk_box_pack_start(GTK_BOX(box), label, TRUE, TRUE, 4);
-	if (e2ee_image)
-		gtk_box_pack_start(GTK_BOX(box), e2ee_image, FALSE, FALSE, 0);
 
 	if (buddy != NULL &&
 	    !purple_presence_is_online(purple_buddy_get_presence(buddy)))
@@ -3442,8 +3409,6 @@
 
 	gtk_widget_show(label);
 	gtk_widget_show(image);
-	if (e2ee_image)
-		gtk_widget_show(e2ee_image);
 	gtk_widget_show(box);
 
 	/* Set our data and callbacks. */
@@ -3509,7 +3474,6 @@
 		}
 		else
 		{
-			gboolean e2ee_enabled = FALSE;
 			GList *list = NULL, *iter;
 			for (l = buds; l != NULL; l = l->next)
 			{
@@ -3527,8 +3491,6 @@
 						continue;
 
 					im = purple_conversations_find_im_with_account(purple_buddy_get_name(buddy), purple_buddy_get_account(buddy));
-					if (im && purple_conversation_get_e2ee_state(PURPLE_CONVERSATION(im)) != NULL)
-						e2ee_enabled = TRUE;
 
 					account = purple_buddy_get_account(buddy);
 					/* TODO WEBKIT: (I'm not actually sure if this is webkit-related --Mark Doliner) */
@@ -3550,7 +3512,7 @@
 					PurplePresence *pre = iter->data;
 					PurpleBuddy *buddy = purple_buddy_presence_get_buddy(PURPLE_BUDDY_PRESENCE(pre));
 					create_sendto_item(menu, sg, &group, buddy,
-							purple_buddy_get_account(buddy), purple_buddy_get_name(buddy), e2ee_enabled);
+							purple_buddy_get_account(buddy), purple_buddy_get_name(buddy));
 				}
 			}
 			g_list_free(list);
@@ -3567,88 +3529,6 @@
 	update_send_to_selection(win);
 }
 
-PurpleImage *
-_pidgin_e2ee_stock_icon_get(const gchar *stock_name)
-{
-	gchar filename[100], *path;
-	PurpleImage *image;
-
-	/* core is quitting */
-	if (e2ee_stock == NULL)
-		return NULL;
-
-	if (g_hash_table_lookup_extended(e2ee_stock, stock_name, NULL, (gpointer*)&image))
-		return image;
-
-	g_snprintf(filename, sizeof(filename), "e2ee-%s.png", stock_name);
-	path = g_build_filename(PURPLE_DATADIR, "pidgin", "icons",
-		"hicolor", "16x16", "status", filename, NULL);
-	image = purple_image_new_from_file(path, NULL);
-	g_free(path);
-
-	g_hash_table_insert(e2ee_stock, g_strdup(stock_name), image);
-	return image;
-}
-
-static void
-generate_e2ee_controls(PidginConvWindow *win)
-{
-	PidginConversation *gtkconv;
-	PurpleConversation *conv;
-	PurpleE2eeState *state;
-	PurpleE2eeProvider *provider;
-	GtkWidget *menu;
-	GList *menu_actions, *it;
-	GtkWidget *e2ee_image;
-
-	gtkconv = pidgin_conv_window_get_active_gtkconv(win);
-	g_return_if_fail(gtkconv != NULL);
-
-	conv = gtkconv->active_conv;
-	g_return_if_fail(conv != NULL);
-
-	if (win->menu->e2ee != NULL) {
-		gtk_widget_destroy(win->menu->e2ee);
-		win->menu->e2ee = NULL;
-	}
-
-	provider = purple_e2ee_provider_get_main();
-	state = purple_conversation_get_e2ee_state(conv);
-	if (state == NULL || provider == NULL)
-		return;
-	if (purple_e2ee_state_get_provider(state) != provider)
-		return;
-
-	win->menu->e2ee = gtk_image_menu_item_new_with_label(
-		purple_e2ee_provider_get_name(provider));
-
-	menu = gtk_menu_new();
-	gtk_menu_shell_insert(GTK_MENU_SHELL(win->menu->menubar),
-		win->menu->e2ee, 3);
-	gtk_menu_item_set_submenu(GTK_MENU_ITEM(win->menu->e2ee), menu);
-
-	e2ee_image = e2ee_state_to_gtkimage(state);
-	if (e2ee_image) {
-		gtk_image_menu_item_set_image(
-			GTK_IMAGE_MENU_ITEM(win->menu->e2ee), e2ee_image);
-	}
-
-	gtk_widget_set_tooltip_text(win->menu->e2ee,
-		purple_e2ee_state_get_name(state));
-
-	menu_actions = purple_e2ee_provider_get_conv_menu_actions(provider, conv);
-	for (it = menu_actions; it; it = g_list_next(it)) {
-		PurpleActionMenu *action = it->data;
-
-		gtk_widget_show_all(
-			pidgin_append_menu_action(menu, action, conv));
-	}
-	g_list_free(menu_actions);
-
-	gtk_widget_show(win->menu->e2ee);
-	gtk_widget_show(menu);
-}
-
 static const char *
 get_chat_user_status_icon(PurpleChatConversation *chat, const char *name, PurpleChatUserFlags flags)
 {
@@ -5405,9 +5285,6 @@
 		regenerate_plugins_items(win);
 	}
 
-	if (fields & PIDGIN_CONV_E2EE)
-		generate_e2ee_controls(win);
-
 	if (fields & PIDGIN_CONV_TAB_ICON)
 	{
 		update_tab_icon(conv);
@@ -5599,10 +5476,6 @@
 	{
 		flags = PIDGIN_CONV_MENU;
 	}
-	else if (type == PURPLE_CONVERSATION_UPDATE_E2EE)
-	{
-		flags = PIDGIN_CONV_E2EE | PIDGIN_CONV_MENU;
-	}
 
 	pidgin_conv_update_fields(conv, flags);
 }
@@ -6339,7 +6212,7 @@
 {
 	pidgin_conv_update_fields(conv, PIDGIN_CONV_TAB_ICON |
 		PIDGIN_CONV_SET_TITLE | PIDGIN_CONV_MENU |
-		PIDGIN_CONV_BUDDY_ICON | PIDGIN_CONV_E2EE );
+		PIDGIN_CONV_BUDDY_ICON);
 }
 
 static void
@@ -6526,18 +6399,12 @@
 	return &handle;
 }
 
-static void
-pidgin_conversations_pre_uninit(void);
-
 void
 pidgin_conversations_init(void)
 {
 	void *handle = pidgin_conversations_get_handle();
 	void *blist_handle = purple_blist_get_handle();
 
-	e2ee_stock = g_hash_table_new_full(g_str_hash, g_str_equal,
-		g_free, g_object_unref);
-
 	/* Conversations */
 	purple_prefs_add_none(PIDGIN_PREFS_ROOT "/conversations");
 	purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/use_smooth_scrolling", TRUE);
@@ -6751,9 +6618,6 @@
 	purple_signal_connect(purple_accounts_get_handle(), "account-status-changed",
 						handle, PURPLE_CALLBACK(account_status_changed_cb), NULL);
 
-	purple_signal_connect_priority(purple_get_core(), "quitting", handle,
-		PURPLE_CALLBACK(pidgin_conversations_pre_uninit), NULL, PURPLE_SIGNAL_PRIORITY_HIGHEST);
-
 	/* Callbacks to update a conversation */
 	purple_signal_connect(blist_handle, "blist-node-added", handle,
 						G_CALLBACK(buddy_update_cb), NULL);
@@ -6792,13 +6656,6 @@
 			PURPLE_CALLBACK(wrote_msg_update_unseen_cb), NULL);
 }
 
-static void
-pidgin_conversations_pre_uninit(void)
-{
-	g_hash_table_destroy(e2ee_stock);
-	e2ee_stock = NULL;
-}
-
 /* Invalidate the first tab color set */
 static gboolean tab_color_fuse = TRUE;
 
@@ -7883,7 +7740,6 @@
 	                             purple_conversation_is_logging(conv));
 
 	generate_send_to_items(win);
-	generate_e2ee_controls(win);
 	regenerate_options_items(win);
 	regenerate_plugins_items(win);
 
--- a/pidgin/gtkconvwin.h	Fri Feb 21 02:45:13 2020 +0000
+++ b/pidgin/gtkconvwin.h	Thu Feb 20 23:56:05 2020 -0600
@@ -69,7 +69,6 @@
 	GtkAction *show_formatting_toolbar;
 
 	GtkWidget *send_to;
-	GtkWidget *e2ee;
 
 	GtkWidget *tray;
 
--- a/pidgin/gtkinternal.h	Fri Feb 21 02:45:13 2020 +0000
+++ b/pidgin/gtkinternal.h	Thu Feb 20 23:56:05 2020 -0600
@@ -33,9 +33,6 @@
 static inline void
 _pidgin_widget_set_accessible_name(GtkWidget *widget, const gchar *name);
 
-PurpleImage *
-_pidgin_e2ee_stock_icon_get(const gchar *stock_name);
-
 G_END_DECLS
 
 static inline void
--- a/pidgin/gtkrequest.c	Fri Feb 21 02:45:13 2020 +0000
+++ b/pidgin/gtkrequest.c	Thu Feb 20 23:56:05 2020 -0600
@@ -1524,9 +1524,6 @@
 			image = pidgin_create_protocol_icon(account,
 				PIDGIN_PROTOCOL_ICON_SMALL);
 		}
-	} else if (purple_strequal(domain, "e2ee")) {
-		image = pidgin_pixbuf_from_image(
-			_pidgin_e2ee_stock_icon_get(id));
 	} else {
 		purple_debug_error("gtkrequest", "Unknown domain: %s", domain);
 		g_free(domain);
--- a/po/POTFILES.in	Fri Feb 21 02:45:13 2020 +0000
+++ b/po/POTFILES.in	Thu Feb 20 23:56:05 2020 -0600
@@ -44,7 +44,6 @@
 libpurple/core.c
 libpurple/countingnode.c
 libpurple/debug.c
-libpurple/e2ee.c
 libpurple/eventloop.c
 libpurple/example/nullclient.c
 libpurple/group.c

mercurial