Cleanup old and abandoned plugins
Remove all plugins that weren't installed as well an a few that are being replaced by talkatu and new apis.
Testing Done:
built and ran `ninja pidgin-pot`
Reviewed at https://reviews.imfreedom.org/r/196/
--- a/libpurple/plugins/codeinline.c Wed Nov 04 02:41:46 2020 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
- * 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
- * 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 <glib/gi18n-lib.h>
-PurplePlugin *plugin_handle = NULL;
-outgoing_msg_common(const char *message)
- char **ms = g_strsplit(message, "<u>", -1);
- m = g_strjoinv("<font face=\"monospace\" color=\"#00b025\">", ms);
- ms = g_strsplit(m, "</u>", -1);
- m = g_strjoinv("</font>", ms);
-static gboolean outgoing_msg_cb1(PurpleConversation *conv, PurpleMessage *msg,
- purple_message_set_contents(msg,
- outgoing_msg_common(purple_message_get_contents(msg)));
-outgoing_msg_cb2(PurpleAccount *account, PurpleMessage *msg,
- PurpleConversation *conv, PurpleMessageFlags flags, gpointer null)
- purple_message_set_contents(msg,
- outgoing_msg_common(purple_message_get_contents(msg)));
-static PurplePluginInfo *
-plugin_query(GError **error)
- const gchar * const authors[] = {
- "Sean Egan <seanegan@gmail.com>",
- return purple_plugin_info_new(
- "category", "Formatting",
- "summary", "Formats text as code",
- "description", "Changes the formatting of any outgoing text such "
- "that anything underlined will be received green and "
- "website", PURPLE_WEBSITE,
- "abi-version", PURPLE_ABI_VERSION,
-plugin_load(PurplePlugin *plugin, GError **error)
- void *handle = purple_conversations_get_handle();
- plugin_handle = plugin;
- purple_signal_connect(handle, "writing-im-msg", plugin,
- PURPLE_CALLBACK(outgoing_msg_cb1), NULL);
- purple_signal_connect(handle, "sending-im-msg", plugin,
- PURPLE_CALLBACK(outgoing_msg_cb2), NULL);
-plugin_unload(PurplePlugin *plugin, GError **error)
-PURPLE_PLUGIN_INIT(codeinline, plugin_query, plugin_load, plugin_unload);
--- a/libpurple/plugins/debug_example.c Wed Nov 04 02:41:46 2020 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
- * Copyright (C) 2007, John Bailey <rekkanoryo@cpw.pidgin.im>
- * 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
-#include <glib/gi18n-lib.h>
-/* This file includes all the libpurple headers */
-/* It's more convenient to type PLUGIN_ID all the time than it is to type
- * "core-debugexample", so define this convenience macro. */
-#define PLUGIN_ID "core-debugexample"
-/* Common practice in third-party plugins is to define convenience macros for
- * many of the fields of the plugin info struct, so we'll do that for the
- * purposes of demonstration. */
-#define PLUGIN_AUTHORS { "John Bailey <rekkanoryo@cpw.pidgin.im>", NULL }
-static PurplePluginInfo *
-plugin_query(GError **error)
- const gchar * const authors[] = PLUGIN_AUTHORS;
- return purple_plugin_info_new(
- "name", "Debug API Example",
- "version", DISPLAY_VERSION,
- "summary", "Debug API Example",
- "description", "Debug API Example",
- "website", "https://pidgin.im",
- "abi-version", PURPLE_ABI_VERSION,
-/* As we've covered before, this function is called when the plugin is loaded.
- * Here we're using it to show off the capabilities of the debug API and just
- * blindly returning TRUE to tell libpurple it's safe to continue loading. */
-plugin_load(PurplePlugin *plugin, GError **error)
- /* Define these for convenience--we're just using them to show the
- * similarities of the debug functions to the standard printf(). */
- const gchar *s = "example string";
- /* Introductory message */
- purple_debug_info(PLUGIN_ID,
- "Called plugin_load. Beginning debug demonstration\n");
- /* Show off the debug API a bit */
- purple_debug_misc(PLUGIN_ID,
- "MISC level debug message. i = %d, f = %f, s = %s\n", i, f, s);
- purple_debug_info(PLUGIN_ID,
- "INFO level debug message. i = %d, f = %f, s = %s\n", i, f, s);
- purple_debug_warning(PLUGIN_ID,
- "WARNING level debug message. i = %d, f = %f, s = %s\n", i, f, s);
- purple_debug_error(PLUGIN_ID,
- "ERROR level debug message. i = %d, f = %f, s = %s\n", i, f, s);
- purple_debug_fatal(PLUGIN_ID,
- "FATAL level debug message. i = %d, f = %f, s = %s\n", i, f, s);
- /* Now just return TRUE to tell libpurple to finish loading. */
-plugin_unload(PurplePlugin *plugin, GError **error)
-PURPLE_PLUGIN_INIT(debugexample, plugin_query, plugin_load, plugin_unload);
--- a/libpurple/plugins/filectl.c Wed Nov 04 02:41:46 2020 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,235 +0,0 @@
- * Send commands to Purple via ~/.purple/control
- * Originally by Eric Warmenhoven <eric@warmenhoven.org>
- * Compile fixes/mini hacks Alex Bennee <alex@bennee.com>
- * and Brian Tarricone <bjt23@users.sourceforge.net>
-#define FILECTL_PLUGIN_ID "core-filectl"
-static void init_file(void);
-static gboolean check_file(void);
-/* parse char * as if were word array */
-char *getarg(char *, int, int);
-/* go through file and run any commands */
- char *command, *arg1, *arg2;
- filename = g_build_filename(purple_config_dir(), "control", NULL);
- file = g_fopen(filename, "r+");
- while (fgets(buffer, sizeof(buffer), file)) {
- /* Read the next command */
- if (buffer[strlen(buffer) - 1] == '\n')
- buffer[strlen(buffer) - 1] = 0;
- purple_debug_misc("filectl", "read: %s\n", buffer);
- command = getarg(buffer, 0, 0);
- if (!g_ascii_strncasecmp(command, "login", 6)) {
- PurpleAccount *account;
- arg1 = getarg(buffer, 1, 0);
- arg2 = getarg(buffer, 2, 1);
- account = purple_accounts_find(arg1, arg2);
- if (account != NULL) /* username found */
- purple_account_connect(account);
- } else if (!g_ascii_strncasecmp(command, "logout", 7)) {
- PurpleAccount *account;
- arg1 = getarg(buffer, 1, 1);
- arg2 = getarg(buffer, 2, 1);
- account = purple_accounts_find(arg1, arg2);
- purple_account_disconnect(account);
- purple_connections_disconnect_all();
- } else if (!g_ascii_strncasecmp(command, "away", 4)) {
- arg1 = getarg(buffer, 1, 1);
- /* serv_set_away_all(arg1); */
- } else if (!g_ascii_strncasecmp(command, "hide", 4)) {
- purple_blist_set_visible(FALSE);
- } else if (!g_ascii_strncasecmp(command, "unhide", 6)) {
- purple_blist_set_visible(TRUE);
- } else if (!g_ascii_strncasecmp(command, "back", 4)) {
- } else if (!g_ascii_strncasecmp(command, "quit", 4)) {
- if (g_stat(filename, &finfo) == 0)
- mtime = finfo.st_mtime;
- * Check to see if the size of the file is > 0. if so, run commands.
- /* most of this was taken from Bash v2.04 by the FSF */
- filename = g_build_filename(purple_config_dir(), "control", NULL);
- if ((g_stat(filename, &finfo) == 0) && (finfo.st_size > 0))
- * Check to see if we need to run commands from the file.
- /* most of this was taken from Bash v2.04 by the FSF */
- filename = g_build_filename(purple_config_dir(), "control", NULL);
- if ((g_stat(filename, &finfo) == 0) && (finfo.st_size > 0))
- if (mtime != finfo.st_mtime) {
- purple_debug_info("filectl", "control changed, checking\n");
-getarg(char *line, int which, int remain)
- for (i = 0; i < strlen(line) && count < which; i++) {
- case 0: /* in whitespace, expecting word */
- if (isalnum(line[i])) {
- case 1: /* inside word, waiting for whitespace */
- if (isspace(line[i])) {
- arr = g_strdup(&line[i - 1]);
- for (i = 0; i < strlen(arr) && isalnum(arr[i]); i++);
-static PurplePluginInfo *
-plugin_query(GError **error)
- const gchar * const authors[] = {
- "Eric Warmenhoven <eric@warmenhoven.org>",
- return purple_plugin_info_new(
- "id", FILECTL_PLUGIN_ID,
- "name", N_("File Control"),
- "version", DISPLAY_VERSION,
- "category", N_("Utility"),
- "summary", N_("Allows control by entering commands in a file."),
- "description", N_("Allows control by entering commands in a file."),
- "website", PURPLE_WEBSITE,
- "abi-version", PURPLE_ABI_VERSION,
-plugin_load(PurplePlugin *plugin, GError **error)
- check = g_timeout_add_seconds(5, (GSourceFunc)check_file, NULL);
-plugin_unload(PurplePlugin *plugin, GError **error)
- g_source_remove(check);
-PURPLE_PLUGIN_INIT(filectl, plugin_query, plugin_load, plugin_unload);
--- a/libpurple/plugins/helloworld.c Wed Nov 04 02:41:46 2020 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
- * Copyright (C) 2004, Gary Kramlich <grim@guifications.org>,
- * 2007, John Bailey <rekkanoryo@cpw.pidgin.im>
- * 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
-#include <glib/gi18n-lib.h>
-/* This file includes all the libpurple headers */
-/* This function is the callback for the plugin action we added. All we're
- * doing here is displaying a message. When the user selects the plugin
- * action, this function is called. */
-plugin_action_test_cb (PurplePluginAction * action)
- purple_notify_message (action->plugin, PURPLE_NOTIFY_MSG_INFO,
- "Plugin Actions Test", "This is a plugin actions test :)", NULL, NULL,
-/* we tell libpurple in the PurplePluginInfo struct to call this function to
- * get a list of plugin actions to use for the plugin. This function gives
- * libpurple that list of actions. */
-plugin_actions (PurplePlugin * plugin)
- /* some C89 (a.k.a. ANSI C) compilers will warn if any variable declaration
- * includes an initilization that calls a function. To avoid that, we
- * generally initialize our variables first with constant values like NULL
- * or 0 and assign to them with function calls later */
- PurplePluginAction *action = NULL;
- /* The action gets created by specifying a name to show in the UI and a
- * callback function to call. */
- action = purple_plugin_action_new ("Plugin Action Test", plugin_action_test_cb);
- /* libpurple requires a GList of plugin actions, even if there is only one
- * action in the list. We append the action to a GList here. */
- list = g_list_append (list, action);
- /* Once the list is complete, we send it to libpurple. */
-static PurplePluginInfo *
-plugin_query (GError ** error)
- const gchar * const authors[] = {
- "John Bailey <rekkanoryo@cpw.pidgin.im>", /* correct author */
- /* For specific notes on the meanings of each of these members, consult the
- C Plugin Howto on the website. */
- return purple_plugin_info_new (
- "id", "core-hello_world",
- "name", "Hello World!",
- "version", DISPLAY_VERSION, /* This constant is defined in config.h, but you shouldn't use it for your
- own plugins. We use it here because it's our plugin. And we're lazy. */
- "summary", "Hello World Plugin",
- "description", "Hello World Plugin",
- "website", "http://helloworld.tld",
- "abi-version", PURPLE_ABI_VERSION,
- "actions-cb", plugin_actions, /* this tells libpurple the address of the function to call to get the list
-plugin_load (PurplePlugin * plugin, GError ** error)
- purple_notify_message (plugin, PURPLE_NOTIFY_MSG_INFO, "Hello World!",
- "This is the Hello World! plugin :)", NULL, NULL,
-plugin_unload (PurplePlugin * plugin, GError ** error)
-PURPLE_PLUGIN_INIT (hello_world, plugin_query, plugin_load, plugin_unload);
--- a/libpurple/plugins/meson.build Wed Nov 04 02:41:46 2020 -0600
+++ b/libpurple/plugins/meson.build Wed Nov 04 03:24:02 2020 -0600
@@ -12,18 +12,6 @@
install : true, install_dir : PURPLE_PLUGINDIR)
- codeinline = library('codeinline', 'codeinline.c',
- dependencies : [libpurple_dep],
- debug_example = library('debug_example', 'debug_example.c',
- dependencies : [libpurple_dep],
- helloworld = library('helloworld', 'helloworld.c',
- dependencies : [libpurple_dep],
idle = library('idle', 'idle.c',
dependencies : [libpurple_dep],
@@ -39,46 +27,21 @@
install : true, install_dir : PURPLE_PLUGINDIR)
- notify_example = library('notify_example', 'notify_example.c',
- dependencies : [libpurple_dep],
offlinemsg = library('offlinemsg', 'offlinemsg.c',
dependencies : [libpurple_dep],
install : true, install_dir : PURPLE_PLUGINDIR)
- one_time_password = library('one_time_password', 'one_time_password.c',
- dependencies : [libpurple_dep],
- pluginpref_example = library('pluginpref_example', 'pluginpref_example.c',
- dependencies : [libpurple_dep],
psychic = library('psychic', 'psychic.c',
dependencies : [libpurple_dep],
install : true, install_dir : PURPLE_PLUGINDIR)
- signals_test = library('signals-test', 'signals-test.c',
- dependencies : [libpurple_dep],
- simple = library('simple-plugin', 'simple.c',
- dependencies : [libpurple_dep],
statenotify = library('statenotify', 'statenotify.c',
dependencies : [libpurple_dep],
install : true, install_dir : PURPLE_PLUGINDIR)
- test_request_input = library('test-request-input', 'test-request-input.c',
- dependencies : [libpurple_dep],
purple_toast = library('purple-toast', 'purple-toast.c',
dependencies : [libpurple_dep],
--- a/libpurple/plugins/notify_example.c Wed Nov 04 02:41:46 2020 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,126 +0,0 @@
- * Notify API Example Plugin
- * Copyright (C) 2007, John Bailey <rekkanoryo@cpw.pidgin.im>
- * 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
-#include <glib/gi18n-lib.h>
-/* This file includes all the libpurple headers */
-#define PLUGIN_ID "core-notifyexample"
-#define PLUGIN_AUTHORS { "John Bailey <rekkanoryo@cpw.pidgin.im>", NULL }
-/* The next four functions and the calls within them should cause dialog boxes to appear
- * when you select the plugin action from the Tools->Notify Example menu */
-notify_error_cb(PurplePluginAction *action)
- purple_notify_error(action->plugin, "Test Notification", "Test Notification",
- "This is a test error notification", NULL);
-notify_info_cb(PurplePluginAction *action)
- purple_notify_info(action->plugin, "Test Notification", "Test Notification",
- "This is a test informative notification", NULL);
-notify_warn_cb(PurplePluginAction *action)
- purple_notify_warning(action->plugin, "Test Notification", "Test Notification",
- "This is a test warning notification", NULL);
-notify_format_cb(PurplePluginAction *action)
- purple_notify_formatted(action->plugin, "Test Notification", "Test Notification",
- "<I>This is a test notification with formatted text.</I>", NULL, NULL);
-notify_uri_cb(PurplePluginAction *action)
- /* This one should open your web browser of choice. */
- purple_notify_uri(action->plugin, "https://pidgin.im/");
-plugin_actions(PurplePlugin *plugin)
- /* Here we take advantage of return values to avoid the need for a temp variable */
- actions = g_list_prepend(actions,
- purple_plugin_action_new("Show Error Notification", notify_error_cb));
- actions = g_list_prepend(actions,
- purple_plugin_action_new("Show Info Notification", notify_info_cb));
- actions = g_list_prepend(actions,
- purple_plugin_action_new("Show Warning Notification", notify_warn_cb));
- actions = g_list_prepend(actions,
- purple_plugin_action_new("Show Formatted Notification", notify_format_cb));
- actions = g_list_prepend(actions,
- purple_plugin_action_new("Show URI Notification", notify_uri_cb));
- return g_list_reverse(actions);
-static PurplePluginInfo *
-plugin_query(GError **error)
- const gchar * const authors[] = PLUGIN_AUTHORS;
- return purple_plugin_info_new(
- "name", "Notify API Example",
- "version", DISPLAY_VERSION,
- "summary", "Notify API Example",
- "description", "Notify API Example",
- "website", "https://pidgin.im",
- "abi-version", PURPLE_ABI_VERSION,
- "actions-cb", plugin_actions,
-plugin_load(PurplePlugin *plugin, GError **error)
-plugin_unload(PurplePlugin *plugin, GError **error)
-PURPLE_PLUGIN_INIT(notifyexample, plugin_query, plugin_load, plugin_unload);
--- a/libpurple/plugins/one_time_password.c Wed Nov 04 02:41:46 2020 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,137 +0,0 @@
- * One Time Password support plugin for libpurple
- * Copyright (C) 2009, Daniel Atallah <datallah@pidgin.im>
- * 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
-#include <glib/gi18n-lib.h>
-#define PLUGIN_ID "core-one_time_password"
-#define PREF_NAME PLUGIN_ID "_enabled"
-signed_on_cb(PurpleConnection *conn, void *data)
- PurpleAccount *account = purple_connection_get_account(conn);
- if (purple_account_get_bool(account, PREF_NAME, FALSE)) {
- if(purple_account_get_remember_password(account))
- purple_debug_error("One Time Password",
- "Unable to enforce one time password for account %s (%s).\n"
- "Account is set to remember the password.\n",
- purple_account_get_username(account),
- purple_account_get_protocol_name(account));
- purple_debug_info("One Time Password", "Clearing password for account %s (%s).\n",
- purple_account_get_username(account),
- purple_account_get_protocol_name(account));
- purple_account_set_password(account, NULL, NULL, NULL);
- /* TODO: Do we need to somehow clear conn->password ? */
-static PurplePluginInfo *
-plugin_query(GError **error)
- const gchar * const authors[] = {
- "Daniel Atallah <datallah@pidgin.im>",
- return purple_plugin_info_new(
- "name", N_("One Time Password Support"),
- "version", DISPLAY_VERSION,
- "category", N_("Security"),
- "summary", N_("Enforce that passwords are used only once."),
- "description", N_("Allows you to enforce on a per-account basis that "
- "passwords not being saved are only used in a "
- "single successful connection.\n"
- "Note: The account password must not be saved for "
- "website", PURPLE_WEBSITE,
- "abi-version", PURPLE_ABI_VERSION,
-plugin_load(PurplePlugin *plugin, GError **error)
- PurpleProtocol *protocol;
- PurpleAccountOption *option;
- list = purple_protocols_get_all();
- /* Register protocol preference. */
- for (l = list; l != NULL; l = l->next) {
- protocol = PURPLE_PROTOCOL(l->data);
- if (protocol != NULL && !(purple_protocol_get_options(protocol) & OPT_PROTO_NO_PASSWORD)) {
- option = purple_account_option_bool_new(_("One Time Password"),
- protocol->account_options = g_list_append(protocol->account_options, option);
- /* Register callback. */
- purple_signal_connect(purple_connections_get_handle(), "signed-on",
- plugin, PURPLE_CALLBACK(signed_on_cb), NULL);
-plugin_unload(PurplePlugin *plugin, GError **error)
- PurpleProtocol *protocol;
- PurpleAccountOption *option;
- GList *list, *l, *options;
- list = purple_protocols_get_all();
- /* Remove protocol preference. */
- for (l = list; l != NULL; l = l->next) {
- protocol = PURPLE_PROTOCOL(l->data);
- if (protocol != NULL && !(purple_protocol_get_options(protocol) & OPT_PROTO_NO_PASSWORD)) {
- options = purple_protocol_get_account_options(protocol);
- while (options != NULL) {
- option = (PurpleAccountOption *) options->data;
- if (purple_strequal(PREF_NAME, purple_account_option_get_setting(option))) {
- protocol->account_options = g_list_delete_link(protocol->account_options, options);
- purple_account_option_destroy(option);
- options = options->next;
- /* Callback will be automagically unregistered */
-PURPLE_PLUGIN_INIT(one_time_password, plugin_query, plugin_load, plugin_unload);
--- a/libpurple/plugins/pluginpref_example.c Wed Nov 04 02:41:46 2020 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,164 +0,0 @@
- * PluginPref Example Plugin
- * Copyright (C) 2004, Gary Kramlich <amc_grim@users.sf.net>
- * 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
-#include <glib/gi18n-lib.h>
-/* This file includes all the libpurple headers */
-static PurplePluginPrefFrame *
-get_plugin_pref_frame(PurplePlugin *plugin) {
- PurplePluginPrefFrame *frame;
- PurplePluginPref *ppref;
- frame = purple_plugin_pref_frame_new();
- ppref = purple_plugin_pref_new_with_label("boolean");
- purple_plugin_pref_frame_add(frame, ppref);
- ppref = purple_plugin_pref_new_with_name_and_label(
- "/plugins/core/pluginpref_example/bool",
- purple_plugin_pref_frame_add(frame, ppref);
- ppref = purple_plugin_pref_new_with_label("integer");
- purple_plugin_pref_frame_add(frame, ppref);
- ppref = purple_plugin_pref_new_with_name_and_label(
- "/plugins/core/pluginpref_example/int",
- purple_plugin_pref_set_bounds(ppref, 0, 255);
- purple_plugin_pref_frame_add(frame, ppref);
- ppref = purple_plugin_pref_new_with_name_and_label(
- "/plugins/core/pluginpref_example/int_choice",
- purple_plugin_pref_set_pref_type(ppref, PURPLE_PLUGIN_PREF_CHOICE);
- purple_plugin_pref_add_choice(ppref, "One", GINT_TO_POINTER(1));
- purple_plugin_pref_add_choice(ppref, "Two", GINT_TO_POINTER(2));
- purple_plugin_pref_add_choice(ppref, "Four", GINT_TO_POINTER(4));
- purple_plugin_pref_add_choice(ppref, "Eight", GINT_TO_POINTER(8));
- purple_plugin_pref_add_choice(ppref, "Sixteen", GINT_TO_POINTER(16));
- purple_plugin_pref_add_choice(ppref, "Thirty Two", GINT_TO_POINTER(32));
- purple_plugin_pref_add_choice(ppref, "Sixty Four", GINT_TO_POINTER(64));
- purple_plugin_pref_add_choice(ppref, "One Hundred Twenty Eight", GINT_TO_POINTER(128));
- purple_plugin_pref_frame_add(frame, ppref);
- ppref = purple_plugin_pref_new_with_label("string");
- purple_plugin_pref_frame_add(frame, ppref);
- ppref = purple_plugin_pref_new_with_name_and_label(
- "/plugins/core/pluginpref_example/string",
- purple_plugin_pref_frame_add(frame, ppref);
- ppref = purple_plugin_pref_new_with_name_and_label(
- "/plugins/core/pluginpref_example/masked_string",
- purple_plugin_pref_set_masked(ppref, TRUE);
- purple_plugin_pref_frame_add(frame, ppref);
- ppref = purple_plugin_pref_new_with_name_and_label(
- "/plugins/core/pluginpref_example/max_string",
- "string pref\n(max length of 16)");
- purple_plugin_pref_set_max_length(ppref, 16);
- purple_plugin_pref_frame_add(frame, ppref);
- ppref = purple_plugin_pref_new_with_name_and_label(
- "/plugins/core/pluginpref_example/multiline",
- "multiline string pref");
- purple_plugin_pref_set_pref_type(ppref, PURPLE_PLUGIN_PREF_STRING_FORMAT);
- purple_plugin_pref_set_format_type(ppref, PURPLE_STRING_FORMAT_TYPE_MULTILINE);
- purple_plugin_pref_frame_add(frame, ppref);
- ppref = purple_plugin_pref_new_with_name_and_label(
- "/plugins/core/pluginpref_example/html",
- purple_plugin_pref_set_pref_type(ppref, PURPLE_PLUGIN_PREF_STRING_FORMAT);
- purple_plugin_pref_set_format_type(ppref, PURPLE_STRING_FORMAT_TYPE_HTML);
- purple_plugin_pref_frame_add(frame, ppref);
- ppref = purple_plugin_pref_new_with_name_and_label(
- "/plugins/core/pluginpref_example/string_choice",
- purple_plugin_pref_set_pref_type(ppref, PURPLE_PLUGIN_PREF_CHOICE);
- purple_plugin_pref_add_choice(ppref, "red", "red");
- purple_plugin_pref_add_choice(ppref, "orange", "orange");
- purple_plugin_pref_add_choice(ppref, "yellow", "yellow");
- purple_plugin_pref_add_choice(ppref, "green", "green");
- purple_plugin_pref_add_choice(ppref, "blue", "blue");
- purple_plugin_pref_add_choice(ppref, "purple", "purple");
- purple_plugin_pref_frame_add(frame, ppref);
-static PurplePluginInfo *
-plugin_query(GError **error)
- const gchar * const authors[] = {
- "Gary Kramlich <amc_grim@users.sf.net>",
- return purple_plugin_info_new(
- "id", "core-pluginpref_example",
- "name", "Pluginpref Example",
- "version", DISPLAY_VERSION,
- "summary", "An example of how to use pluginprefs",
- "description", "An example of how to use pluginprefs",
- "website", PURPLE_WEBSITE,
- "abi-version", PURPLE_ABI_VERSION,
- "pref-frame-cb", get_plugin_pref_frame,
-plugin_load(PurplePlugin *plugin, GError **error)
- purple_prefs_add_none("/plugins/core/pluginpref_example");
- purple_prefs_add_bool("/plugins/core/pluginpref_example/bool", TRUE);
- purple_prefs_add_int("/plugins/core/pluginpref_example/int", 0);
- purple_prefs_add_int("/plugins/core/pluginpref_example/int_choice", 1);
- purple_prefs_add_string("/plugins/core/pluginpref_example/string",
- purple_prefs_add_string("/plugins/core/pluginpref_example/max_string",
- purple_prefs_add_string("/plugins/core/pluginpref_example/multiline",
- purple_prefs_add_string("/plugins/core/pluginpref_example/html",
- purple_prefs_add_string("/plugins/core/pluginpref_example/masked_string", "masked");
- purple_prefs_add_string("/plugins/core/pluginpref_example/string_choice", "red");
-plugin_unload(PurplePlugin *plugin, GError **error)
-PURPLE_PLUGIN_INIT(ppexample, plugin_query, plugin_load, plugin_unload);
--- a/libpurple/plugins/signals-test.c Wed Nov 04 02:41:46 2020 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,826 +0,0 @@
- * Copyright (C) 2003 Christian Hammond.
- * 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
-#define SIGNAL_TEST_PLUGIN_ID "core-signals-test"
-#include <glib/gi18n-lib.h>
-/**************************************************************************
- * Account subsystem signal callbacks
- **************************************************************************/
-account_connecting_cb(PurpleAccount *account, void *data)
- purple_debug_misc("signals test", "account-connecting (%s)\n",
- purple_account_get_username(account));
-account_setting_info_cb(PurpleAccount *account, const char *info, void *data)
- purple_debug_misc("signals test", "account-setting-info (%s, %s)\n",
- purple_account_get_username(account), info);
-account_set_info_cb(PurpleAccount *account, const char *info, void *data)
- purple_debug_misc("signals test", "account-set-info (%s, %s)\n",
- purple_account_get_username(account), info);
-account_status_changed(PurpleAccount *account, PurpleStatus *old, PurpleStatus *new,
- purple_debug_misc("signals test", "account-status-changed (%s, %s, %s)\n",
- purple_account_get_username(account),
- purple_status_get_name(old),
- purple_status_get_name(new));
-account_alias_changed(PurpleAccount *account, const char *old, gpointer data)
- purple_debug_misc("signals test", "account-alias-changed (%s, %s, %s)\n",
- purple_account_get_username(account),
- old, purple_account_get_private_alias(account));
-account_authorization_requested_cb(PurpleAccount *account, const char *user, const char *message, char *response, gpointer data)
- purple_debug_misc("signals test", "account-authorization-requested (%s, %s, %s)\n",
- purple_account_get_username(account), user, message);
- return PURPLE_ACCOUNT_RESPONSE_PASS;
-account_authorization_granted_cb(PurpleAccount *account, const char *user, const char *message, gpointer data)
- purple_debug_misc("signals test", "account-authorization-granted (%s, %s, %s)\n",
- purple_account_get_username(account), user, message);
-account_authorization_denied_cb(PurpleAccount *account, const char *user, const char *message, gpointer data)
- purple_debug_misc("signals test", "account-authorization-denied (%s, %s, %s)\n",
- purple_account_get_username(account), user, message);
-/**************************************************************************
- * Buddy Icons signal callbacks
- **************************************************************************/
-buddy_icon_changed_cb(PurpleBuddy *buddy)
- purple_debug_misc("signals test", "buddy icon changed (%s)\n",
- purple_buddy_get_name(buddy));
-/**************************************************************************
- * Buddy List subsystem signal callbacks
- **************************************************************************/
-buddy_status_changed_cb(PurpleBuddy *buddy, PurpleStatus *old_status,
- PurpleStatus *status, void *data)
- purple_debug_misc("signals test", "buddy-status-changed (%s %s to %s)\n",
- purple_buddy_get_name(buddy),
- purple_status_get_id(old_status),
- purple_status_get_id(status));
-buddy_idle_changed_cb(PurpleBuddy *buddy, gboolean old_idle, gboolean idle,
- purple_debug_misc("signals test", "buddy-idle-changed (%s %s)\n",
- purple_buddy_get_name(buddy),
- old_idle ? "unidled" : "idled");
-buddy_signed_on_cb(PurpleBuddy *buddy, void *data)
- purple_debug_misc("signals test", "buddy-signed-on (%s)\n",
- purple_buddy_get_name(buddy));
-buddy_signed_off_cb(PurpleBuddy *buddy, void *data)
- purple_debug_misc("signals test", "buddy-signed-off (%s)\n",
- purple_buddy_get_name(buddy));
-blist_node_added_cb(PurpleBlistNode *bnode, void *data)
- if (PURPLE_IS_GROUP(bnode))
- name = purple_group_get_name(PURPLE_GROUP(bnode));
- else if (PURPLE_IS_CONTACT(bnode))
- name = purple_contact_get_alias(PURPLE_CONTACT(bnode));
- else if (PURPLE_IS_BUDDY(bnode))
- name = purple_buddy_get_name(PURPLE_BUDDY(bnode));
- purple_debug_misc("signals test", "blist_node_added_cb (%s)\n",
- name ? name : "(null)");
-blist_node_removed_cb(PurpleBlistNode *bnode, void *data)
- if (PURPLE_IS_GROUP(bnode))
- name = purple_group_get_name(PURPLE_GROUP(bnode));
- else if (PURPLE_IS_CONTACT(bnode))
- name = purple_contact_get_alias(PURPLE_CONTACT(bnode));
- else if (PURPLE_IS_BUDDY(bnode))
- name = purple_buddy_get_name(PURPLE_BUDDY(bnode));
- purple_debug_misc("signals test", "blist_node_removed_cb (%s)\n",
- name ? name : "(null)");
-blist_node_aliased(PurpleBlistNode *node, const char *old_alias)
- PurpleContact *p = PURPLE_CONTACT(node);
- PurpleBuddy *b = PURPLE_BUDDY(node);
- PurpleChat *c = PURPLE_CHAT(node);
- PurpleGroup *g = PURPLE_GROUP(node);
- if (PURPLE_IS_CONTACT(node)) {
- purple_debug_misc("signals test",
- "blist-node-aliased (Contact: %s, %s)\n",
- purple_contact_get_alias(p), old_alias);
- } else if (PURPLE_IS_BUDDY(node)) {
- purple_debug_misc("signals test",
- "blist-node-aliased (Buddy: %s, %s)\n",
- purple_buddy_get_name(b), old_alias);
- } else if (PURPLE_IS_CHAT(node)) {
- purple_debug_misc("signals test",
- "blist-node-aliased (Chat: %s, %s)\n",
- purple_chat_get_name(c), old_alias);
- } else if (PURPLE_IS_GROUP(node)) {
- purple_debug_misc("signals test",
- "blist-node-aliased (Group: %s, %s)\n",
- purple_group_get_name(g), old_alias);
-blist_node_extended_menu_cb(PurpleBlistNode *node, void *data)
- PurpleContact *p = PURPLE_CONTACT(node);
- PurpleBuddy *b = PURPLE_BUDDY(node);
- PurpleChat *c = PURPLE_CHAT(node);
- PurpleGroup *g = PURPLE_GROUP(node);
- if (PURPLE_IS_CONTACT(node)) {
- purple_debug_misc("signals test",
- "blist-node-extended-menu (Contact: %s)\n",
- purple_contact_get_alias(p));
- } else if (PURPLE_IS_BUDDY(node)) {
- purple_debug_misc("signals test",
- "blist-node-extended-menu (Buddy: %s)\n",
- purple_buddy_get_name(b));
- } else if (PURPLE_IS_CHAT(node)) {
- purple_debug_misc("signals test",
- "blist-node-extended-menu (Chat: %s)\n",
- purple_chat_get_name(c));
- } else if (PURPLE_IS_GROUP(node)) {
- purple_debug_misc("signals test",
- "blist-node-extended-menu (Group: %s)\n",
- purple_group_get_name(g));
-/**************************************************************************
- * Connection subsystem signal callbacks
- **************************************************************************/
-signing_on_cb(PurpleConnection *gc, void *data)
- purple_debug_misc("signals test", "signing-on (%s)\n",
- purple_account_get_username(purple_connection_get_account(gc)));
-signed_on_cb(PurpleConnection *gc, void *data)
- purple_debug_misc("signals test", "signed-on (%s)\n",
- purple_account_get_username(purple_connection_get_account(gc)));
-signing_off_cb(PurpleConnection *gc, void *data)
- purple_debug_misc("signals test", "signing-off (%s)\n",
- purple_account_get_username(purple_connection_get_account(gc)));
-signed_off_cb(PurpleConnection *gc, void *data)
- purple_debug_misc("signals test", "signed-off (%s)\n",
- purple_account_get_username(purple_connection_get_account(gc)));
-connection_error_cb(PurpleConnection *gc,
- PurpleConnectionError err,
- const gchar *username =
- purple_account_get_username(purple_connection_get_account(gc));
- purple_debug_misc("signals test", "connection-error (%s, %u, %s)\n",
-/**************************************************************************
- * Conversation subsystem signal callbacks
- **************************************************************************/
-writing_im_msg_cb(PurpleConversation *conv, PurpleMessage *pmsg)
- purple_debug_misc("signals test", "writing-im-msg (%s, %s)\n",
- purple_conversation_get_name(conv),
- purple_message_get_contents(pmsg));
-wrote_im_msg_cb(PurpleConversation *conv, PurpleMessage *msg, gpointer data)
- purple_debug_misc("signals test", "wrote-im-msg (%s, %s)\n",
- purple_conversation_get_name(conv),
- purple_message_get_contents(msg));
-sending_im_msg_cb(PurpleAccount *account, PurpleMessage *msg, void *data)
- purple_debug_misc("signals test", "sending-im-msg (%s, %s, %s)\n",
- purple_account_get_username(account),
- purple_message_get_recipient(msg),
- purple_message_get_contents(msg));
-sent_im_msg_cb(PurpleAccount *account, PurpleMessage *msg, void *data)
- purple_debug_misc("signals test", "sent-im-msg (%s, %s, %s)\n",
- purple_account_get_username(account),
- purple_message_get_recipient(msg),
- purple_message_get_contents(msg));
-receiving_im_msg_cb(PurpleAccount *account, char **sender, char **buffer,
- PurpleConversation *conv, PurpleMessageFlags *flags, void *data)
- purple_debug_misc("signals test", "receiving-im-msg (%s, %s, %s, %s, %d)\n",
- purple_account_get_username(account), *sender, *buffer,
- (conv != NULL) ? purple_conversation_get_name(conv) : "(null)", *flags);
-received_im_msg_cb(PurpleAccount *account, char *sender, char *buffer,
- PurpleConversation *conv, PurpleMessageFlags flags, void *data)
- purple_debug_misc("signals test", "received-im-msg (%s, %s, %s, %s, %d)\n",
- purple_account_get_username(account), sender, buffer,
- (conv != NULL) ? purple_conversation_get_name(conv) : "(null)", flags);
-writing_chat_msg_cb(PurpleAccount *account, const char *who, char **buffer,
- PurpleConversation *conv, PurpleMessageFlags flags, void *data)
- purple_debug_misc("signals test", "writing-chat-msg (%s, %s)\n",
- purple_conversation_get_name(conv), *buffer);
-wrote_chat_msg_cb(PurpleConversation *conv, PurpleMessage *msg, gpointer data)
- purple_debug_misc("signals test", "wrote-chat-msg (%s, %s)\n",
- purple_conversation_get_name(conv),
- purple_message_get_contents(msg));
-sending_chat_msg_cb(PurpleAccount *account, PurpleMessage *msg, int id, void *data)
- purple_debug_misc("signals test", "sending-chat-msg (%s, %s, %d)\n",
- purple_account_get_username(account),
- purple_message_get_contents(msg), id);
-sent_chat_msg_cb(PurpleAccount *account, PurpleMessage *msg, int id, void *data)
- purple_debug_misc("signals test", "sent-chat-msg (%s, %s, %d)\n",
- purple_account_get_username(account),
- purple_message_get_contents(msg), id);
-receiving_chat_msg_cb(PurpleAccount *account, char **sender, char **buffer,
- PurpleConversation *chat, PurpleMessageFlags *flags, void *data)
- purple_debug_misc("signals test",
- "receiving-chat-msg (%s, %s, %s, %s, %d)\n",
- purple_account_get_username(account), *sender, *buffer,
- purple_conversation_get_name(chat), *flags);
-received_chat_msg_cb(PurpleAccount *account, char *sender, char *buffer,
- PurpleConversation *chat, PurpleMessageFlags flags, void *data)
- purple_debug_misc("signals test",
- "received-chat-msg (%s, %s, %s, %s, %d)\n",
- purple_account_get_username(account), sender, buffer,
- purple_conversation_get_name(chat), flags);
-conversation_created_cb(PurpleConversation *conv, void *data)
- purple_debug_misc("signals test", "conversation-created (%s)\n",
- purple_conversation_get_name(conv));
-deleting_conversation_cb(PurpleConversation *conv, void *data)
- purple_debug_misc("signals test", "deleting-conversation (%s)\n",
- purple_conversation_get_name(conv));
-buddy_typing_cb(PurpleAccount *account, const char *name, void *data)
- purple_debug_misc("signals test", "buddy-typing (%s, %s)\n",
- purple_account_get_username(account), name);
-buddy_typing_stopped_cb(PurpleAccount *account, const char *name, void *data)
- purple_debug_misc("signals test", "buddy-typing-stopped (%s, %s)\n",
- purple_account_get_username(account), name);
-chat_user_joining_cb(PurpleConversation *conv, const char *user,
- PurpleChatUserFlags flags, void *data)
- purple_debug_misc("signals test", "chat-user-joining (%s, %s, %d)\n",
- purple_conversation_get_name(conv), user, flags);
-chat_user_joined_cb(PurpleConversation *conv, const char *user,
- PurpleChatUserFlags flags, gboolean new_arrival, void *data)
- purple_debug_misc("signals test", "chat-user-joined (%s, %s, %d, %d)\n",
- purple_conversation_get_name(conv), user, flags, new_arrival);
-chat_user_flags_cb(PurpleChatUser *cb, PurpleChatUserFlags oldflags,
- PurpleChatUserFlags newflags, void *data)
- purple_debug_misc("signals test", "chat-user-flags (%s, %s, %d, %d)\n",
- purple_conversation_get_name(PURPLE_CONVERSATION(
- purple_chat_user_get_chat(cb))),
- purple_chat_user_get_name(cb), oldflags, newflags);
-chat_user_leaving_cb(PurpleConversation *conv, const char *user,
- const char *reason, void *data)
- purple_debug_misc("signals test", "chat-user-leaving (%s, %s, %s)\n",
- purple_conversation_get_name(conv), user, reason);
-chat_user_left_cb(PurpleConversation *conv, const char *user,
- const char *reason, void *data)
- purple_debug_misc("signals test", "chat-user-left (%s, %s, %s)\n",
- purple_conversation_get_name(conv), user, reason);
-chat_inviting_user_cb(PurpleConversation *conv, const char *name,
- char **reason, void *data)
- purple_debug_misc("signals test", "chat-inviting-user (%s, %s, %s)\n",
- purple_conversation_get_name(conv), name, *reason);
-chat_invited_user_cb(PurpleConversation *conv, const char *name,
- const char *reason, void *data)
- purple_debug_misc("signals test", "chat-invited-user (%s, %s, %s)\n",
- purple_conversation_get_name(conv), name, reason);
-chat_invited_cb(PurpleAccount *account, const char *inviter,
- const char *room_name, const char *message,
- const GHashTable *components, void *data)
- purple_debug_misc("signals test", "chat-invited (%s, %s, %s, %s)\n",
- purple_account_get_username(account), inviter,
-chat_joined_cb(PurpleConversation *conv, void *data)
- purple_debug_misc("signals test", "chat-joined (%s)\n",
- purple_conversation_get_name(conv));
-chat_left_cb(PurpleConversation *conv, void *data)
- purple_debug_misc("signals test", "chat-left (%s)\n",
- purple_conversation_get_name(conv));
-chat_topic_changed_cb(PurpleConversation *conv, const char *who,
- const char *topic, void *data)
- purple_debug_misc("signals test",
- "chat-topic-changed (%s topic changed to: \"%s\" by %s)\n",
- purple_conversation_get_name(conv), topic,
- (who) ? who : "unknown");
-/**************************************************************************
- * Core signal callbacks
- **************************************************************************/
- purple_debug_misc("signals test", "quitting ()\n");
-printhash(gpointer key, gpointer value, gpointer data)
- char *b = (char *)value;
- GString *str = (GString *)data;
- g_string_append_printf(str, " [%s] = [%s]\n", a, b ? b : "(null)");
-uri_handler(const char *proto, const char *cmd, GHashTable *params)
- GString *str = g_string_new("\n{\n");
- g_hash_table_foreach(params, printhash, str);
- g_string_append_c(str, '}');
- purple_debug_misc("signals test", "uri handler (%s, %s, %s)\n", proto, cmd, str->str);
- g_string_free(str, TRUE);
-/**************************************************************************
- * Notify signals callbacks
- **************************************************************************/
-notify_email_cb(char *subject, char *from, char *to, char *url) {
- purple_debug_misc("signals test", "notify email: subject=%s, from=%s, to=%s, url=%s\n",
- subject, from, to, url);
-notify_emails_cb(char **subjects, char **froms, char **tos, char **urls, guint count) {
- purple_debug_misc("signals test", "notify emails: count=%u\n", count);
- for(i=0; i<count && i<5; i++) {
- if(subjects[i]==NULL || froms[i]==NULL || tos[i]==NULL || urls[i]==NULL) continue;
- purple_debug_misc("signals test", "notify emails[%u]: subject=%s, from=%s, to=%s, url=%s\n",
- i, subjects[i], froms[i], tos[i], urls[i]);
-/**************************************************************************
- * Jabber signals callbacks
- **************************************************************************/
-jabber_iq_received(PurpleConnection *pc, const char *type, const char *id,
- const char *from, PurpleXmlNode *iq)
- purple_debug_misc("signals test", "jabber IQ (type=%s, id=%s, from=%s) %p\n",
- type, id, from ? from : "(null)", iq);
- /* We don't want the plugin to stop processing */
-jabber_message_received(PurpleConnection *pc, const char *type, const char *id,
- const char *from, const char *to, PurpleXmlNode *message)
- purple_debug_misc("signals test", "jabber message (type=%s, id=%s, "
- type ? type : "(null)", id ? id : "(null)",
- from ? from : "(null)", to ? to : "(null)", message);
- /* We don't want the plugin to stop processing */
-jabber_presence_received(PurpleConnection *pc, const char *type,
- const char *from, PurpleXmlNode *presence)
- purple_debug_misc("signals test", "jabber presence (type=%s, from=%s) %p\n",
- type ? type : "(null)", from ? from : "(null)", presence);
- /* We don't want the plugin to stop processing */
-jabber_watched_iq(PurpleConnection *pc, const char *type, const char *id,
- const char *from, PurpleXmlNode *child)
- purple_debug_misc("signals test", "jabber watched IQ (type=%s, id=%s, from=%s)\n"
- "child %p name=%s, namespace=%s\n",
- type, id, from, child, child->name,
- purple_xmlnode_get_namespace(child));
- if (purple_strequal(type, "get") || purple_strequal(type, "set")) {
- /* Send the requisite reply */
- PurpleXmlNode *iq = purple_xmlnode_new("iq");
- purple_xmlnode_set_attrib(iq, "to", from);
- purple_xmlnode_set_attrib(iq, "id", id);
- purple_xmlnode_set_attrib(iq, "type", "result");
- purple_signal_emit(purple_connection_get_protocol(pc),
- "jabber-sending-xmlnode", pc, &iq);
- purple_xmlnode_free(iq);
- /* Cookie monster eats IQ stanzas; the protocol shouldn't keep processing */
-/**************************************************************************
- **************************************************************************/
-static PurplePluginInfo *
-plugin_query(GError **error)
- const gchar * const authors[] = {
- "Christian Hammond <chipx86@gnupdate.org>",
- return purple_plugin_info_new(
- "id", SIGNAL_TEST_PLUGIN_ID,
- "name", N_("Signals Test"),
- "version", DISPLAY_VERSION,
- "category", N_("Testing"),
- "summary", N_("Test to see that all signals are working properly."),
- "description", N_("Test to see that all signals are working properly."),
- "website", PURPLE_WEBSITE,
- "abi-version", PURPLE_ABI_VERSION,
-plugin_load(PurplePlugin *plugin, GError **error)
- void *core_handle = purple_get_core();
- void *blist_handle = purple_blist_get_handle();
- void *conn_handle = purple_connections_get_handle();
- void *conv_handle = purple_conversations_get_handle();
- void *accounts_handle = purple_accounts_get_handle();
- void *notify_handle = purple_notify_get_handle();
- void *jabber_handle = purple_protocols_find("prpl-jabber");
- /* Accounts subsystem signals */
- purple_signal_connect(accounts_handle, "account-connecting",
- plugin, PURPLE_CALLBACK(account_connecting_cb), NULL);
- purple_signal_connect(accounts_handle, "account-setting-info",
- plugin, PURPLE_CALLBACK(account_setting_info_cb), NULL);
- purple_signal_connect(accounts_handle, "account-set-info",
- plugin, PURPLE_CALLBACK(account_set_info_cb), NULL);
- purple_signal_connect(accounts_handle, "account-status-changed",
- plugin, PURPLE_CALLBACK(account_status_changed), NULL);
- purple_signal_connect(accounts_handle, "account-alias-changed",
- plugin, PURPLE_CALLBACK(account_alias_changed), NULL);
- purple_signal_connect(accounts_handle, "account-authorization-requested",
- plugin, PURPLE_CALLBACK(account_authorization_requested_cb), NULL);
- purple_signal_connect(accounts_handle, "account-authorization-denied",
- plugin, PURPLE_CALLBACK(account_authorization_denied_cb), NULL);
- purple_signal_connect(accounts_handle, "account-authorization-granted",
- plugin, PURPLE_CALLBACK(account_authorization_granted_cb), NULL);
- /* Buddy List subsystem signals */
- purple_signal_connect(blist_handle, "buddy-status-changed",
- plugin, PURPLE_CALLBACK(buddy_status_changed_cb), NULL);
- purple_signal_connect(blist_handle, "buddy-idle-changed",
- plugin, PURPLE_CALLBACK(buddy_idle_changed_cb), NULL);
- purple_signal_connect(blist_handle, "buddy-signed-on",
- plugin, PURPLE_CALLBACK(buddy_signed_on_cb), NULL);
- purple_signal_connect(blist_handle, "buddy-signed-off",
- plugin, PURPLE_CALLBACK(buddy_signed_off_cb), NULL);
- purple_signal_connect(blist_handle, "blist-node-added",
- plugin, PURPLE_CALLBACK(blist_node_added_cb), NULL);
- purple_signal_connect(blist_handle, "blist-node-removed",
- plugin, PURPLE_CALLBACK(blist_node_removed_cb), NULL);
- purple_signal_connect(blist_handle, "buddy-icon-changed",
- plugin, PURPLE_CALLBACK(buddy_icon_changed_cb), NULL);
- purple_signal_connect(blist_handle, "blist-node-aliased",
- plugin, PURPLE_CALLBACK(blist_node_aliased), NULL);
- purple_signal_connect(blist_handle, "blist-node-extended-menu",
- plugin, PURPLE_CALLBACK(blist_node_extended_menu_cb), NULL);
- /* Connection subsystem signals */
- purple_signal_connect(conn_handle, "signing-on",
- plugin, PURPLE_CALLBACK(signing_on_cb), NULL);
- purple_signal_connect(conn_handle, "signed-on",
- plugin, PURPLE_CALLBACK(signed_on_cb), NULL);
- purple_signal_connect(conn_handle, "signing-off",
- plugin, PURPLE_CALLBACK(signing_off_cb), NULL);
- purple_signal_connect(conn_handle, "signed-off",
- plugin, PURPLE_CALLBACK(signed_off_cb), NULL);
- purple_signal_connect(conn_handle, "connection-error",
- plugin, PURPLE_CALLBACK(connection_error_cb), NULL);
- /* Conversations subsystem signals */
- purple_signal_connect(conv_handle, "writing-im-msg",
- plugin, PURPLE_CALLBACK(writing_im_msg_cb), NULL);
- purple_signal_connect(conv_handle, "wrote-im-msg",
- plugin, PURPLE_CALLBACK(wrote_im_msg_cb), NULL);
- purple_signal_connect(conv_handle, "sending-im-msg",
- plugin, PURPLE_CALLBACK(sending_im_msg_cb), NULL);
- purple_signal_connect(conv_handle, "sent-im-msg",
- plugin, PURPLE_CALLBACK(sent_im_msg_cb), NULL);
- purple_signal_connect(conv_handle, "receiving-im-msg",
- plugin, PURPLE_CALLBACK(receiving_im_msg_cb), NULL);
- purple_signal_connect(conv_handle, "received-im-msg",
- plugin, PURPLE_CALLBACK(received_im_msg_cb), NULL);
- purple_signal_connect(conv_handle, "writing-chat-msg",
- plugin, PURPLE_CALLBACK(writing_chat_msg_cb), NULL);
- purple_signal_connect(conv_handle, "wrote-chat-msg",
- plugin, PURPLE_CALLBACK(wrote_chat_msg_cb), NULL);
- purple_signal_connect(conv_handle, "sending-chat-msg",
- plugin, PURPLE_CALLBACK(sending_chat_msg_cb), NULL);
- purple_signal_connect(conv_handle, "sent-chat-msg",
- plugin, PURPLE_CALLBACK(sent_chat_msg_cb), NULL);
- purple_signal_connect(conv_handle, "receiving-chat-msg",
- plugin, PURPLE_CALLBACK(receiving_chat_msg_cb), NULL);
- purple_signal_connect(conv_handle, "received-chat-msg",
- plugin, PURPLE_CALLBACK(received_chat_msg_cb), NULL);
- purple_signal_connect(conv_handle, "conversation-created",
- plugin, PURPLE_CALLBACK(conversation_created_cb), NULL);
- purple_signal_connect(conv_handle, "deleting-conversation",
- plugin, PURPLE_CALLBACK(deleting_conversation_cb), NULL);
- purple_signal_connect(conv_handle, "buddy-typing",
- plugin, PURPLE_CALLBACK(buddy_typing_cb), NULL);
- purple_signal_connect(conv_handle, "buddy-typing-stopped",
- plugin, PURPLE_CALLBACK(buddy_typing_stopped_cb), NULL);
- purple_signal_connect(conv_handle, "chat-user-joining",
- plugin, PURPLE_CALLBACK(chat_user_joining_cb), NULL);
- purple_signal_connect(conv_handle, "chat-user-joined",
- plugin, PURPLE_CALLBACK(chat_user_joined_cb), NULL);
- purple_signal_connect(conv_handle, "chat-user-flags",
- plugin, PURPLE_CALLBACK(chat_user_flags_cb), NULL);
- purple_signal_connect(conv_handle, "chat-user-leaving",
- plugin, PURPLE_CALLBACK(chat_user_leaving_cb), NULL);
- purple_signal_connect(conv_handle, "chat-user-left",
- plugin, PURPLE_CALLBACK(chat_user_left_cb), NULL);
- purple_signal_connect(conv_handle, "chat-inviting-user",
- plugin, PURPLE_CALLBACK(chat_inviting_user_cb), NULL);
- purple_signal_connect(conv_handle, "chat-invited-user",
- plugin, PURPLE_CALLBACK(chat_invited_user_cb), NULL);
- purple_signal_connect(conv_handle, "chat-invited",
- plugin, PURPLE_CALLBACK(chat_invited_cb), NULL);
- purple_signal_connect(conv_handle, "chat-joined",
- plugin, PURPLE_CALLBACK(chat_joined_cb), NULL);
- purple_signal_connect(conv_handle, "chat-left",
- plugin, PURPLE_CALLBACK(chat_left_cb), NULL);
- purple_signal_connect(conv_handle, "chat-topic-changed",
- plugin, PURPLE_CALLBACK(chat_topic_changed_cb), NULL);
- purple_signal_connect(core_handle, "quitting",
- plugin, PURPLE_CALLBACK(quitting_cb), NULL);
- purple_signal_connect(core_handle, "uri-handler",
- plugin, PURPLE_CALLBACK(uri_handler), NULL);
- purple_signal_connect(notify_handle, "displaying-email-notification",
- plugin, PURPLE_CALLBACK(notify_email_cb), NULL);
- purple_signal_connect(notify_handle, "displaying-emails-notification",
- plugin, PURPLE_CALLBACK(notify_emails_cb), NULL);
- purple_signal_connect(jabber_handle, "jabber-receiving-iq", plugin,
- PURPLE_CALLBACK(jabber_iq_received), NULL);
- purple_signal_connect(jabber_handle, "jabber-receiving-message", plugin,
- PURPLE_CALLBACK(jabber_message_received), NULL);
- purple_signal_connect(jabber_handle, "jabber-receiving-presence", plugin,
- PURPLE_CALLBACK(jabber_presence_received), NULL);
- /* IQ namespace signals */
- purple_signal_emit(jabber_handle, "jabber-register-namespace-watcher",
- "bogus_node", "super-duper-namespace");
- /* The above is equivalent to doing:
- int result = GPOINTER_TO_INT(purple_plugin_ipc_call(jabber_handle, "register_namespace_watcher", &ok, "bogus_node", "super-duper-namespace"));
- purple_signal_connect(jabber_handle, "jabber-watched-iq", plugin,
- PURPLE_CALLBACK(jabber_watched_iq), NULL);
-plugin_unload(PurplePlugin *plugin, GError **error)
- void *jabber_handle = purple_protocols_find("prpl-jabber");
- purple_signals_disconnect_by_handle(plugin);
- /* Unregister watched namespaces */
- purple_signal_emit(jabber_handle, "jabber-unregister-namespace-watcher",
- "bogus_node", "super-duper-namespace");
- /* The above is equivalent to doing:
- int result = GPOINTER_TO_INT(purple_plugin_ipc_call(jabber_handle, "unregister_namespace_watcher", &ok, "bogus_node", "super-duper-namespace"));
-PURPLE_PLUGIN_INIT(signalstest, plugin_query, plugin_load, plugin_unload);
--- a/libpurple/plugins/simple.c Wed Nov 04 02:41:46 2020 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
- * 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
-#include <glib/gi18n-lib.h>
-/** Plugin id : type-author-name (to guarantee uniqueness) */
-#define SIMPLE_PLUGIN_ID "core-ewarmenhoven-simple"
-static PurplePluginInfo *
-plugin_query(GError **error)
- const gchar * const authors[] = {
- "Eric Warmenhoven <eric@warmenhoven.org>",
- return purple_plugin_info_new(
- "id", SIMPLE_PLUGIN_ID,
- "name", N_("Simple Plugin"),
- "version", DISPLAY_VERSION,
- "category", N_("Testing"),
- "summary", N_("Tests to see that most things are working."),
- "description", N_("Tests to see that most things are working."),
- "website", PURPLE_WEBSITE,
- "abi-version", PURPLE_ABI_VERSION,
-plugin_load(PurplePlugin *plugin, GError **error)
- purple_debug(PURPLE_DEBUG_INFO, "simple", "simple plugin loaded.\n");
-plugin_unload(PurplePlugin *plugin, GError **error)
- purple_debug(PURPLE_DEBUG_INFO, "simple", "simple plugin unloaded.\n");
-PURPLE_PLUGIN_INIT(simple, plugin_query, plugin_load, plugin_unload);
--- a/libpurple/plugins/test-request-input.c Wed Nov 04 02:41:46 2020 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,155 +0,0 @@
- * Pidgin is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * 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 <glib/gi18n-lib.h>
-#define PREF_ROOT "/plugins"
-#define PREF_TEST "/plugins/tests"
-#define PREF_PREFIX "/plugins/tests/request-input"
-#define PREF_SINGLE PREF_PREFIX "/single"
-#define PREF_MULTIPLE PREF_PREFIX "/multiple"
-#define PREF_HTML PREF_PREFIX "/html"
-plugin_input_callback(const gchar *pref, const gchar *text) {
- purple_prefs_set_string(pref, text);
-plugin_input_single(PurplePluginAction *action) {
- _("Test request input single"),
- _("Test request input single"),
- purple_prefs_get_string(PREF_SINGLE),
- PURPLE_CALLBACK(plugin_input_callback),
- purple_request_cpar_new(),
-plugin_input_multiple(PurplePluginAction *action) {
- _("Test request input multiple"),
- _("Test request input multiple"),
- purple_prefs_get_string(PREF_MULTIPLE),
- PURPLE_CALLBACK(plugin_input_callback),
- purple_request_cpar_new(),
-plugin_input_html(PurplePluginAction *action) {
- _("Test request input HTML"),
- _("Test request input HTML"),
- purple_prefs_get_string(PREF_HTML),
- PURPLE_CALLBACK(plugin_input_callback),
- purple_request_cpar_new(),
-plugin_actions(PurplePlugin *plugin) {
- PurplePluginAction *action = NULL;
- action = purple_plugin_action_new(_("Input single"), plugin_input_single);
- l = g_list_append(l, action);
- action = purple_plugin_action_new(_("Input multiple"), plugin_input_multiple);
- l = g_list_append(l, action);
- action = purple_plugin_action_new(_("Input html"), plugin_input_html);
- l = g_list_append(l, action);
-static PurplePluginInfo *
-plugin_query(GError **error) {
- const gchar * const authors[] = {
- "Gary Kramlich <grim@reaperworld.com>",
- return purple_plugin_info_new(
- "id", "core-test_request_input",
- "name", N_("Test: request input"),
- "version", DISPLAY_VERSION,
- "category", N_("Testing"),
- "summary", N_("Test Request Input"),
- "description", N_("This plugin adds actions to test purple_request_input"),
- "website", "https://pidgin.im",
- "abi-version", PURPLE_ABI_VERSION,
- "actions-cb", plugin_actions,
-plugin_load(PurplePlugin *plugin, GError **error) {
- purple_prefs_add_none(PREF_ROOT);
- purple_prefs_add_none(PREF_TEST);
- purple_prefs_add_none(PREF_PREFIX);
- purple_prefs_add_string(PREF_SINGLE, "");
- purple_prefs_add_string(PREF_MULTIPLE, "");
- purple_prefs_add_string(PREF_HTML, "");
-plugin_unload(PurplePlugin *plugin, GError **error) {
-PURPLE_PLUGIN_INIT(test_request_input, plugin_query, plugin_load, plugin_unload);
--- a/pidgin/plugins/contact_priority.c Wed Nov 04 02:41:46 2020 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,208 +0,0 @@
- * Contact priority settings plugin.
- * Copyright (C) 2003 Etan Reisner, <deryni9@users.sourceforge.net>.
- * 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 <glib/gi18n-lib.h>
-#define CONTACT_PRIORITY_PLUGIN_ID "gtk-contact-priority"
-select_account(GtkWidget *widget, gpointer data)
- PidginAccountChooser *chooser = PIDGIN_ACCOUNT_CHOOSER(widget);
- PurpleAccount *account = pidgin_account_chooser_get_selected(chooser);
- gtk_spin_button_set_value(GTK_SPIN_BUTTON(data),
- (gdouble)purple_account_get_int(account, "score", 0));
-account_update(GtkWidget *widget, gpointer data)
- PurpleAccount *account = NULL;
- PidginAccountChooser *chooser = PIDGIN_ACCOUNT_CHOOSER(data);
- account = pidgin_account_chooser_get_selected(chooser);
- purple_account_set_int(account, "score", gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget)));
-pref_update(GtkWidget *widget, char *pref)
- if (purple_prefs_get_pref_type(pref) == PURPLE_PREF_INT)
- purple_prefs_set_int(pref, gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget)));
- if (purple_prefs_get_pref_type(pref) == PURPLE_PREF_BOOLEAN)
- purple_prefs_set_bool(pref, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)));
-static struct PurpleContactPriorityStatuses
- const char *description;
- { "idle", N_("Buddy is idle") },
- { "away", N_("Buddy is away") },
- { "extended_away", N_("Buddy is \"extended\" away") },
- { "mobile", N_("Buddy is mobile") },
- { "offline", N_("Buddy is offline") },
-get_config_frame(PurplePlugin *plugin)
- GtkWidget *ret = NULL, *hbox = NULL, *frame = NULL, *vbox = NULL;
- GtkWidget *label = NULL, *spin = NULL, *check = NULL;
- GtkWidget *chooser = NULL;
- GtkAdjustment *adj = NULL;
- GtkSizeGroup *sg = NULL;
- GtkListStore *store = NULL;
- PurpleAccount *account = NULL;
- gboolean last_match = purple_prefs_get_bool("/purple/contact/last_match");
- sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
- ret = gtk_box_new(GTK_ORIENTATION_VERTICAL, 18);
- gtk_container_set_border_width(GTK_CONTAINER(ret), 12);
- frame = pidgin_make_frame(ret, _("Point values to use when..."));
- vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
- gtk_container_add(GTK_CONTAINER(frame), vbox);
- for (i = 0 ; statuses[i].id != NULL && statuses[i].description != NULL ; i++)
- char *pref = g_strconcat("/purple/status/scores/", statuses[i].id, NULL);
- hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 5);
- gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
- label = gtk_label_new_with_mnemonic(_(statuses[i].description));
- gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
- gtk_size_group_add_widget(sg, label);
- gtk_label_set_xalign(GTK_LABEL(label), 0);
- gtk_label_set_yalign(GTK_LABEL(label), 0);
- adj = GTK_ADJUSTMENT(gtk_adjustment_new(purple_prefs_get_int(pref),
- spin = gtk_spin_button_new(adj, 1, 0);
- g_signal_connect(G_OBJECT(spin), "value-changed", G_CALLBACK(pref_update), pref);
- gtk_box_pack_start(GTK_BOX(hbox), spin, FALSE, FALSE, 0);
- label = gtk_label_new(NULL);
- gtk_label_set_markup(GTK_LABEL(label), _("The buddy with the <i>largest score</i> is the buddy who will have priority in the contact.\n"));
- gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
- hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 5);
- gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
- check = gtk_check_button_new_with_label(_("Use last buddy when scores are equal"));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), last_match);
- g_signal_connect(G_OBJECT(check), "toggled", G_CALLBACK(pref_update), "/purple/contact/last_match");
- gtk_box_pack_start(GTK_BOX(hbox), check, FALSE, FALSE, 0);
- frame = pidgin_make_frame(ret, _("Point values to use for account..."));
- vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
- gtk_container_add(GTK_CONTAINER(frame), vbox);
- hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 5);
- gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
- /* make this here so I can use it in the option menu callback, we'll
- * actually set it up later */
- adj = GTK_ADJUSTMENT(gtk_adjustment_new(0, -500, 500, 1, 1, 1));
- spin = gtk_spin_button_new(adj, 1, 0);
- store = pidgin_account_store_new();
- chooser = pidgin_account_chooser_new();
- gtk_combo_box_set_model(GTK_COMBO_BOX(chooser), GTK_TREE_MODEL(store));
- g_object_unref(G_OBJECT(store));
- gtk_box_pack_start(GTK_BOX(hbox), chooser, FALSE, FALSE, 0);
- g_signal_connect(chooser, "changed", G_CALLBACK(select_account), spin);
- /* this is where we set up the spin button we made above */
- account = pidgin_account_chooser_get_selected(PIDGIN_ACCOUNT_CHOOSER(chooser));
- gtk_spin_button_set_value(GTK_SPIN_BUTTON(spin),
- (gdouble)purple_account_get_int(account, "score", 0));
- gtk_spin_button_set_adjustment(GTK_SPIN_BUTTON(spin), GTK_ADJUSTMENT(adj));
- g_signal_connect(G_OBJECT(spin), "value-changed",
- G_CALLBACK(account_update), chooser);
- gtk_box_pack_start(GTK_BOX(hbox), spin, FALSE, FALSE, 0);
- gtk_widget_show_all(ret);
-static PidginPluginInfo *
-plugin_query(GError **error)
- const gchar * const authors[] = {
- "Etan Reisner <deryni@eden.rutgers.edu>",
- return pidgin_plugin_info_new(
- "id", CONTACT_PRIORITY_PLUGIN_ID,
- "name", N_("Contact Priority"),
- "version", DISPLAY_VERSION,
- "category", N_("Utility"),
- "summary", N_("Allows for controlling the values associated with different buddy states."),
- "description", N_("Allows for changing the point values of idle/away/offline states for buddies in contact priority computations."),
- "website", PURPLE_WEBSITE,
- "abi-version", PURPLE_ABI_VERSION,
- "gtk-config-frame-cb", get_config_frame,
-plugin_load(PurplePlugin *plugin, GError **error)
-plugin_unload(PurplePlugin *plugin, GError **error)
-PURPLE_PLUGIN_INIT(contactpriority, plugin_query, plugin_load, plugin_unload);
--- a/pidgin/plugins/gtk-signals-test.c Wed Nov 04 02:41:46 2020 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,167 +0,0 @@
- * Copyright (C) 2003 Christian Hammond.
- * 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
-#define GTK_SIGNAL_TEST_PLUGIN_ID "gtk-signals-test"
-/**************************************************************************
- * Account subsystem signal callbacks
- **************************************************************************/
-account_modified_cb(PurpleAccount *account, void *data) {
- purple_debug_info("gtk-signal-test", "account modified cb\n");
-/**************************************************************************
- * Buddy List subsystem signal callbacks
- **************************************************************************/
-blist_created_cb(PurpleBuddyList *blist, void *data) {
- purple_debug_info("gtk-signal-test", "buddy list created\n");
-blist_drawing_tooltip_cb(PurpleBlistNode *node, GString *str, gboolean full, void *data) {
- purple_debug_info("gtk-signal-test", "drawing tooltip cb\n");
-/**************************************************************************
- * Conversation subsystem signal callbacks
- **************************************************************************/
-conversation_dragging_cb(PidginConvWindow *source, PidginConvWindow *destination) {
- purple_debug_info("gtk-signal-test", "conversation dragging cb\n");
-displaying_im_msg_cb(PurpleConversation *conv, PurpleMessage *pmsg, gpointer data)
- purple_debug_misc("gtk-signals test", "displaying-im-msg (%s, %s)\n",
- purple_conversation_get_name(conv),
- purple_message_get_contents(pmsg));
-displayed_im_msg_cb(PurpleConversation *conv, PurpleMessage *msg, gpointer data)
- purple_debug_misc("gtk-signals test", "displayed-im-msg (%s, %s)\n",
- purple_conversation_get_name(conv),
- purple_message_get_contents(msg));
-displaying_chat_msg_cb(PurpleConversation *conv, PurpleMessage *pmsg, gpointer data)
- purple_debug_misc("gtk-signals test", "displaying-chat-msg (%s, %s)\n",
- purple_conversation_get_name(conv),
- purple_message_get_contents(pmsg));
-displayed_chat_msg_cb(PurpleConversation *conv, PurpleMessage *msg, gpointer data)
- purple_debug_misc("gtk-signals test", "displayed-chat-msg (%s, %s)\n",
- purple_conversation_get_name(conv),
- purple_message_get_contents(msg));
-conversation_switched_cb(PurpleConversation *conv, void *data)
- purple_debug_misc("gtk-signals test", "conversation-switched (%s)\n",
- purple_conversation_get_name(conv));
-/**************************************************************************
- **************************************************************************/
-static PidginPluginInfo *
-plugin_query(GError **error)
- const gchar * const authors[] = {
- "Gary Kramlich <amc_grim@users.sf.net>",
- return pidgin_plugin_info_new(
- "id", GTK_SIGNAL_TEST_PLUGIN_ID,
- "name", N_("GTK Signals Test"),
- "version", DISPLAY_VERSION,
- "category", N_("Testing"),
- "summary", N_("Test to see that all ui signals are working properly."),
- "description", N_("Test to see that all ui signals are working properly."),
- "website", PURPLE_WEBSITE,
- "abi-version", PURPLE_ABI_VERSION,
-plugin_load(PurplePlugin *plugin, GError **error)
- void *accounts_handle = pidgin_accounts_get_handle();
- void *blist_handle = pidgin_blist_get_handle();
- void *conv_handle = pidgin_conversations_get_handle();
- /* Accounts subsystem signals */
- purple_signal_connect(accounts_handle, "account-modified",
- plugin, PURPLE_CALLBACK(account_modified_cb), NULL);
- /* Buddy List subsystem signals */
- purple_signal_connect(blist_handle, "gtkblist-created",
- plugin, PURPLE_CALLBACK(blist_created_cb), NULL);
- purple_signal_connect(blist_handle, "drawing-tooltip",
- plugin, PURPLE_CALLBACK(blist_drawing_tooltip_cb), NULL);
- /* Conversations subsystem signals */
- purple_signal_connect(conv_handle, "conversation-dragging",
- plugin, PURPLE_CALLBACK(conversation_dragging_cb), NULL);
- purple_signal_connect(conv_handle, "displaying-im-msg",
- plugin, PURPLE_CALLBACK(displaying_im_msg_cb), NULL);
- purple_signal_connect(conv_handle, "displayed-im-msg",
- plugin, PURPLE_CALLBACK(displayed_im_msg_cb), NULL);
- purple_signal_connect(conv_handle, "displaying-chat-msg",
- plugin, PURPLE_CALLBACK(displaying_chat_msg_cb), NULL);
- purple_signal_connect(conv_handle, "displayed-chat-msg",
- plugin, PURPLE_CALLBACK(displayed_chat_msg_cb), NULL);
- purple_signal_connect(conv_handle, "conversation-switched",
- plugin, PURPLE_CALLBACK(conversation_switched_cb), NULL);
-plugin_unload(PurplePlugin *plugin, GError **error) {
-PURPLE_PLUGIN_INIT(gtksignalstest, plugin_query, plugin_load, plugin_unload);
--- a/pidgin/plugins/history.c Wed Nov 04 02:41:46 2020 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,235 +0,0 @@
-/* Puts last 4k of log in new conversations a la Everybuddy (and then
- * stolen by Trillian "Pro") */
-#define HISTORY_PLUGIN_ID "gtk-history"
-#define HISTORY_SIZE (4 * 1024)
-static gboolean _scroll_webview_to_end(gpointer data)
- PidginWebView *webview = data;
- pidgin_webview_scroll_to_end(PIDGIN_WEBVIEW(webview), FALSE);
- g_object_unref(G_OBJECT(webview));
-static void historize(PurpleConversation *c)
- PurpleAccount *account = purple_conversation_get_account(c);
- const char *name = purple_conversation_get_name(c);
- const char *alias = name;
- PidginConversation *gtkconv;
- /* FIXME: WebView has no options */
- GtkIMHtmlOptions options = GTK_IMHTML_NO_COLOURS;
- /* FIXME: WebView has no protocol setting */
- gtkconv = PIDGIN_CONVERSATION(c);
- g_return_if_fail(gtkconv != NULL);
- /* An IM which is the first active conversation. */
- g_return_if_fail(gtkconv->convs != NULL);
- if (PURPLE_IS_IM_CONVERSATION(c) && !gtkconv->convs->next)
- /* If we're not logging, don't show anything.
- * Otherwise, we might show a very old log. */
- if (!purple_prefs_get_bool("/purple/logging/log_ims"))
- /* Find buddies for this conversation. */
- buddies = purple_blist_find_buddies(account, name);
- /* If we found at least one buddy, save the first buddy's alias. */
- alias = purple_buddy_get_contact_alias(PURPLE_BUDDY(buddies->data));
- for (cur = buddies; cur != NULL; cur = cur->next)
- PurpleBlistNode *node = cur->data;
- PurpleBlistNode *prev = purple_blist_node_get_sibling_prev(node);
- PurpleBlistNode *next = purple_blist_node_get_sibling_next(node);
- if ((node != NULL) && ((prev != NULL) || (next != NULL)))
- PurpleBlistNode *node2;
- PurpleBlistNode *parent = purple_blist_node_get_parent(node);
- PurpleBlistNode *child = purple_blist_node_get_first_child(parent);
- alias = purple_buddy_get_contact_alias(PURPLE_BUDDY(node));
- /* We've found a buddy that matches this conversation. It's part of a
- * PurpleContact with more than one PurpleBuddy. Loop through the PurpleBuddies
- * in the contact and get all the logs. */
- for (node2 = child ; node2 != NULL ; node2 = purple_blist_node_get_sibling_next(node2))
- logs = g_list_concat(purple_log_get_logs(PURPLE_LOG_IM,
- purple_buddy_get_name(PURPLE_BUDDY(node2)),
- purple_buddy_get_account(PURPLE_BUDDY(node2))),
- logs = purple_log_get_logs(PURPLE_LOG_IM, name, account);
- logs = g_list_sort(logs, purple_log_compare);
- else if (PURPLE_IS_CHAT_CONVERSATION(c))
- /* If we're not logging, don't show anything.
- * Otherwise, we might show a very old log. */
- if (!purple_prefs_get_bool("/purple/logging/log_chats"))
- logs = purple_log_get_logs(PURPLE_LOG_CHAT, name, account);
- history = purple_log_read((PurpleLog*)logs->data, &flags);
- gtkconv = PIDGIN_CONVERSATION(c);
- /* FIXME: WebView has no options */
- if (flags & PURPLE_LOG_READ_NO_NEWLINE)
- options |= GTK_IMHTML_NO_NEWLINE;
- /* FIXME: WebView has no protocol setting */
- protocol = g_strdup(gtk_imhtml_get_protocol_name(GTK_IMHTML(gtkconv->imhtml)));
- gtk_imhtml_set_protocol_name(GTK_IMHTML(gtkconv->imhtml),
- purple_account_get_protocol_name(((PurpleLog*)logs->data)->account));
- /* TODO WebKit: Do this properly... */
- if (!pidgin_webview_is_empty(PIDGIN_WEBVIEW(gtkconv->webview)))
- pidgin_webview_append_html(PIDGIN_WEBVIEW(gtkconv->webview), "<BR>");
- escaped_alias = g_markup_escape_text(alias, -1);
- dt = g_date_time_to_local(((PurpleLog *)logs->data)->time);
- header_date = g_date_time_format(dt, "%c");
- header = g_strdup_printf(_("<b>Conversation with %s on %s:</b><br>"), escaped_alias, header_date);
- pidgin_webview_append_html(PIDGIN_WEBVIEW(gtkconv->webview), header);
- pidgin_webview_append_html(PIDGIN_WEBVIEW(gtkconv->webview), history);
- pidgin_webview_append_html(PIDGIN_WEBVIEW(gtkconv->webview), "<hr>");
- /* FIXME: WebView has no protocol setting */
- gtk_imhtml_set_protocol_name(GTK_IMHTML(gtkconv->imhtml), protocol);
- g_object_ref(G_OBJECT(gtkconv->webview));
- g_idle_add(_scroll_webview_to_end, gtkconv->webview);
- g_list_free_full(logs, (GDestroyNotify)purple_log_free);
-history_prefs_check(PurplePlugin *plugin)
- if (!purple_prefs_get_bool("/purple/logging/log_ims") &&
- !purple_prefs_get_bool("/purple/logging/log_chats"))
- /* Translators: Please maintain the use of ⇦ or ⇨ to represent the menu hierarchy */
- purple_notify_warning(plugin, NULL, _("History Plugin Requires Logging"),
- _("Logging can be enabled from Tools ⇨ Preferences ⇨ Logging.\n\n"
- "Enabling logs for instant messages and/or chats will activate "
- "history for the same conversation type(s)."), NULL);
-static void history_prefs_cb(const char *name, PurplePrefType type,
- gconstpointer val, gpointer data)
- history_prefs_check((PurplePlugin *)data);
-static PidginPluginInfo *
-plugin_query(GError **error)
- const gchar * const authors[] = {
- "Sean Egan <seanegan@gmail.com>",
- return pidgin_plugin_info_new(
- "id", HISTORY_PLUGIN_ID,
- "version", DISPLAY_VERSION,
- "category", N_("User interface"),
- "summary", N_("Shows recently logged conversations in new "
- "description", N_("When a new conversation is opened this plugin will "
- "insert the last conversation into the current "
- "website", PURPLE_WEBSITE,
- "abi-version", PURPLE_ABI_VERSION,
-plugin_load(PurplePlugin *plugin, GError **error)
- purple_signal_connect(purple_conversations_get_handle(),
- "conversation-created",
- plugin, PURPLE_CALLBACK(historize), NULL);
- /* XXX: Do we want to listen to pidgin's "conversation-displayed" signal? */
- purple_prefs_connect_callback(plugin, "/purple/logging/log_ims",
- history_prefs_cb, plugin);
- purple_prefs_connect_callback(plugin, "/purple/logging/log_chats",
- history_prefs_cb, plugin);
- history_prefs_check(plugin);
-plugin_unload(PurplePlugin *plugin, GError **error)
-PURPLE_PLUGIN_INIT(history, plugin_query, plugin_load, plugin_unload);
--- a/pidgin/plugins/imgupload.c Wed Nov 04 02:41:46 2020 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,468 +0,0 @@
- * Image Uploader - an inline images implementation for protocols without
- * support for such feature.
- * Copyright (C) 2014, Tomasz Wasilczyk <twasilczyk@pidgin.im>
- * 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 "gtkwebviewtoolbar.h"
-#include <json-glib/json-glib.h>
-#include <libsoup/soup.h>
-#define IMGUP_IMGUR_CLIENT_ID "b6d33c6bb80e1b6"
-#define IMGUP_PREF_PREFIX "/plugins/gtk/imgupload/"
-static PurplePlugin *plugin_handle = NULL;
-static SoupSession *session = NULL;
-imgup_upload_done(PidginWebView *webview, const gchar *url, const gchar *title);
-imgup_upload_failed(PidginWebView *webview);
-/******************************************************************************
- ******************************************************************************/
-imgup_conn_is_hooked(PurpleConnection *gc)
- return GPOINTER_TO_INT(g_object_get_data(G_OBJECT(gc), "imgupload-set"));
-/******************************************************************************
- ******************************************************************************/
-imgup_imgur_uploaded(G_GNUC_UNUSED SoupSession *session, SoupMessage *msg,
- PidginWebView *webview = PIDGIN_WEBVIEW(_webview);
- const gchar *url, *title;
- if (!SOUP_STATUS_IS_SUCCESSFUL(msg->status_code)) {
- imgup_upload_failed(webview);
- parser = json_parser_new();
- if (!json_parser_load_from_data(parser, msg->response_body->data,
- msg->response_body->length, NULL)) {
- purple_debug_warning("imgupload", "Invalid json got from imgur");
- imgup_upload_failed(webview);
- result = json_node_get_object(json_parser_get_root(parser));
- if (!json_object_get_boolean_member(result, "success")) {
- g_object_unref(parser);
- purple_debug_warning("imgupload", "imgur - not a success");
- imgup_upload_failed(webview);
- result = json_object_get_object_member(result, "data");
- url = json_object_get_string_member(result, "link");
- title = g_object_get_data(G_OBJECT(msg), "imgupload-imgur-name");
- imgup_upload_done(webview, url, title);
- g_object_unref(parser);
- g_object_set_data(G_OBJECT(msg), "imgupload-imgur-name", NULL);
-static PurpleHttpConnection *
-imgup_imgur_upload(PidginWebView *webview, PurpleImage *image)
- gchar *req_data, *img_data, *img_data_e;
- msg = soup_message_new("POST", "https://api.imgur.com/3/image");
- soup_message_headers_replace(msg, "Authorization",
- "Client-ID " IMGUP_IMGUR_CLIENT_ID);
- /* TODO: make it a plain, multipart/form-data request */
- img_data = g_base64_encode(purple_image_get_data(image),
- purple_image_get_data_size(image));
- img_data_e = g_uri_escape_string(img_data, NULL, FALSE);
- req_data = g_strdup_printf("type=base64&image=%s", img_data_e);
- soup_message_set_request(msg, "application/x-www-form-urlencoded",
- SOUP_MESSAGE_TAKE, req_data, strlen(req_data));
- g_object_set_data_full(G_OBJECT(msg), "imgupload-imgur-name",
- g_strdup(purple_image_get_friendly_filename(image)),
- soup_session_queue_message(session, msg, imgup_imgur_uploaded, webview);
-/******************************************************************************
- * Image/link upload and insertion
- ******************************************************************************/
-imgup_upload_finish(PidginWebView *webview)
- g_object_steal_data(G_OBJECT(webview), "imgupload-msg");
- plswait = g_object_get_data(G_OBJECT(webview), "imgupload-plswait");
- g_object_set_data(G_OBJECT(webview), "imgupload-plswait", NULL);
- purple_request_close(PURPLE_REQUEST_WAIT, plswait);
-imgup_upload_done(PidginWebView *webview, const gchar *url, const gchar *title)
- imgup_upload_finish(webview);
- if (!purple_prefs_get_bool(IMGUP_PREF_PREFIX "use_url_desc"))
- PidginWebViewButtons format;
- format = pidgin_webview_get_format_functions(webview);
- url_desc = format & PIDGIN_WEBVIEW_LINKDESC;
- pidgin_webview_insert_link(webview, url, url_desc ? title : NULL);
-imgup_upload_failed(PidginWebView *webview)
- imgup_upload_finish(webview);
- is_cancelled = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(webview),
- "imgupload-cancelled"));
- g_object_set_data(G_OBJECT(webview), "imgupload-cancelled", NULL);
- purple_debug_error("imgupload", "Failed uploading image");
-imgup_upload_cancel_message(SoupMessage *msg)
- soup_session_cancel_message(session, msg, SOUP_STATUS_CANCELLED);
-imgup_upload_cancel(gpointer _webview)
- PidginWebView *webview = PIDGIN_WEBVIEW(_webview);
- g_object_set_data(G_OBJECT(webview), "imgupload-plswait", NULL);
- g_object_set_data(G_OBJECT(webview), "imgupload-cancelled",
- GINT_TO_POINTER(TRUE));
- msg = g_object_steal_data(G_OBJECT(webview), "imgupload-msg");
- soup_session_cancel_message(session, msg, SOUP_STATUS_CANCELLED);
-imgup_upload_start(PidginWebView *webview, PurpleImage *image, gpointer _gtkconv)
- PidginConversation *gtkconv = _gtkconv;
- PurpleConversation *conv = gtkconv->active_conv;
- if (!imgup_conn_is_hooked(purple_conversation_get_connection(conv)))
- msg = imgup_imgur_upload(webview, image);
- g_object_set_data_full(G_OBJECT(webview), "imgupload-msg", msg,
- (GDestroyNotify)imgup_upload_cancel_message);
- plswait = purple_request_wait(plugin_handle, _("Uploading image"),
- _("Please wait for image URL being retrieved..."),
- NULL, FALSE, imgup_upload_cancel,
- purple_request_cpar_from_conversation(conv), webview);
- g_object_set_data(G_OBJECT(webview), "imgupload-plswait", plswait);
-/******************************************************************************
- ******************************************************************************/
-imgup_pidconv_init(PidginConversation *gtkconv)
- PidginWebView *webview;
- webview = PIDGIN_WEBVIEW(gtkconv->entry);
- g_signal_connect(G_OBJECT(webview), "insert-image",
- G_CALLBACK(imgup_upload_start), gtkconv);
-imgup_pidconv_uninit(PidginConversation *gtkconv)
- PidginWebView *webview;
- webview = PIDGIN_WEBVIEW(gtkconv->entry);
- g_signal_handlers_disconnect_by_func(G_OBJECT(webview),
- G_CALLBACK(imgup_upload_start), gtkconv);
-imgup_conv_init(PurpleConversation *conv)
- gc = purple_conversation_get_connection(conv);
- if (!imgup_conn_is_hooked(gc))
- purple_conversation_set_features(conv,
- purple_conversation_get_features(conv) &
- ~PURPLE_CONNECTION_FLAG_NO_IMAGES);
- g_object_set_data(G_OBJECT(conv), "imgupload-set", GINT_TO_POINTER(TRUE));
-imgup_conv_uninit(PurpleConversation *conv)
- gc = purple_conversation_get_connection(conv);
- if (!imgup_conn_is_hooked(gc))
- if (!g_object_get_data(G_OBJECT(conv), "imgupload-set"))
- purple_conversation_set_features(conv,
- purple_conversation_get_features(conv) |
- PURPLE_CONNECTION_FLAG_NO_IMAGES);
- g_object_set_data(G_OBJECT(conv), "imgupload-set", NULL);
-imgup_conn_init(PurpleConnection *gc)
- PurpleConnectionFlags flags;
- flags = purple_connection_get_flags(gc);
- if (!(flags & PURPLE_CONNECTION_FLAG_NO_IMAGES))
- flags &= ~PURPLE_CONNECTION_FLAG_NO_IMAGES;
- purple_connection_set_flags(gc, flags);
- g_object_set_data(G_OBJECT(gc), "imgupload-set", GINT_TO_POINTER(TRUE));
-imgup_conn_uninit(PurpleConnection *gc)
- if (!imgup_conn_is_hooked(gc))
- purple_connection_set_flags(gc, purple_connection_get_flags(gc) |
- PURPLE_CONNECTION_FLAG_NO_IMAGES);
- g_object_set_data(G_OBJECT(gc), "imgupload-set", NULL);
-/******************************************************************************
- ******************************************************************************/
-imgup_prefs_ok(gpointer _unused, PurpleRequestFields *fields)
- use_url_desc = purple_request_fields_get_bool(fields, "use_url_desc");
- purple_prefs_set_bool(IMGUP_PREF_PREFIX "use_url_desc", use_url_desc);
-imgup_prefs_get(PurplePlugin *plugin)
- PurpleRequestCommonParameters *cpar;
- PurpleRequestFields *fields;
- PurpleRequestFieldGroup *group;
- PurpleRequestField *field;
- fields = purple_request_fields_new();
- group = purple_request_field_group_new(NULL);
- purple_request_fields_add_group(fields, group);
- field = purple_request_field_bool_new("use_url_desc",
- _("Use image filename as link description"),
- purple_prefs_get_bool(IMGUP_PREF_PREFIX "use_url_desc"));
- purple_request_field_group_add_field(group, field);
- cpar = purple_request_cpar_new();
- purple_request_cpar_set_icon(cpar, PURPLE_REQUEST_ICON_DIALOG);
- handle = purple_request_fields(plugin,
- _("Image Uploader"), NULL, NULL, fields,
- _("OK"), (GCallback)imgup_prefs_ok,
-/******************************************************************************
- ******************************************************************************/
-static PidginPluginInfo *
-plugin_query(GError **error)
- const gchar * const authors[] = {
- "Tomasz Wasilczyk <twasilczyk@pidgin.im>",
- return pidgin_plugin_info_new(
- "name", N_("Image Uploader"),
- "version", DISPLAY_VERSION,
- "category", N_("Utility"),
- "summary", N_("Inline images implementation for protocols "
- "without such feature."),
- "description", N_("Adds inline images support for protocols "
- "lacking this feature by uploading them to the "
- "website", PURPLE_WEBSITE,
- "abi-version", PURPLE_ABI_VERSION,
- "pref-request-cb", imgup_prefs_get,
-plugin_load(PurplePlugin *plugin, GError **error)
- purple_prefs_add_none("/plugins");
- purple_prefs_add_none("/plugins/gtk");
- purple_prefs_add_none("/plugins/gtk/imgupload");
- purple_prefs_add_bool(IMGUP_PREF_PREFIX "use_url_desc", TRUE);
- plugin_handle = plugin;
- session = soup_session_new();
- it = purple_connections_get_all();
- for (; it; it = g_list_next(it)) {
- PurpleConnection *gc = it->data;
- it = purple_conversations_get_all();
- for (; it; it = g_list_next(it)) {
- PurpleConversation *conv = it->data;
- if (PIDGIN_IS_PIDGIN_CONVERSATION(conv))
- imgup_pidconv_init(PIDGIN_CONVERSATION(conv));
- purple_signal_connect(purple_connections_get_handle(),
- PURPLE_CALLBACK(imgup_conn_init), NULL);
- purple_signal_connect(purple_connections_get_handle(),
- PURPLE_CALLBACK(imgup_conn_uninit), NULL);
- purple_signal_connect(pidgin_conversations_get_handle(),
- "conversation-displayed", plugin,
- PURPLE_CALLBACK(imgup_pidconv_init), NULL);
-plugin_unload(PurplePlugin *plugin, GError **error)
- soup_session_abort(session);
- it = purple_conversations_get_all();
- for (; it; it = g_list_next(it)) {
- PurpleConversation *conv = it->data;
- imgup_conv_uninit(conv);
- if (PIDGIN_IS_PIDGIN_CONVERSATION(conv))
- imgup_pidconv_uninit(PIDGIN_CONVERSATION(conv));
- it = purple_connections_get_all();
- for (; it; it = g_list_next(it)) {
- PurpleConnection *gc = it->data;
- g_clear_object(&session);
-PURPLE_PLUGIN_INIT(imgupload, plugin_query, plugin_load, plugin_unload);
--- a/pidgin/plugins/mailchk.c Wed Nov 04 02:41:46 2020 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,169 +0,0 @@
-#define MAILCHK_PLUGIN_ID "gtk-mailchk"
-#define MAILCHK_PLUGIN_DOMAIN (g_quark_from_static_string(MAILCHK_PLUGIN_ID))
-#define UNREAD_MAIL 0x02
-static GtkWidget *mail = NULL;
- static off_t oldsize = 0;
- filename = g_strdup(g_getenv("MAIL"));
- filename = g_strconcat("/var/spool/mail/", g_get_user_name(), NULL);
- if (g_stat(filename, &st) < 0) {
- if (newsize) ret |= ANY_MAIL;
- if (st.st_mtime > st.st_atime && newsize) ret |= UNREAD_MAIL;
- if (newsize != oldsize && (ret & UNREAD_MAIL)) ret |= NEW_MAIL;
-check_timeout(gpointer data)
- gint count = check_mail();
- PurpleBuddyList *list = purple_blist_get_default();
- if (!list || !(PIDGIN_BLIST(list)->vbox))
- /* guess we better build it then :P */
- GtkWidget *vbox = PIDGIN_BLIST(list)->vbox;
- mail = gtk_label_new("No mail messages.");
- gtk_box_pack_start(GTK_BOX(vbox), mail, FALSE, FALSE, 0);
- gtk_box_reorder_child(GTK_BOX(vbox), mail, 1);
- g_signal_connect(G_OBJECT(mail), "destroy", G_CALLBACK(destroy_cb), NULL);
- if (count & UNREAD_MAIL)
- gtk_label_set_text(GTK_LABEL(mail), "You have new mail!");
- else if (count & ANY_MAIL)
- gtk_label_set_text(GTK_LABEL(mail), "You have mail.");
- gtk_label_set_text(GTK_LABEL(mail), "No mail messages.");
-signon_cb(PurpleConnection *gc)
- PurpleBuddyList *list = purple_blist_get_default();
- check_timeout(NULL); /* we want the box to be drawn immediately */
- timer = g_timeout_add_seconds(2, check_timeout, NULL);
-signoff_cb(PurpleConnection *gc)
- PurpleBuddyList *list = purple_blist_get_default();
- if ((!list || !PIDGIN_BLIST(list)->vbox) && timer) {
- g_source_remove(timer);
-static PidginPluginInfo *
-plugin_query(GError **error)
- const gchar * const authors[] = {
- "Eric Warmenhoven <eric@warmenhoven.org>",
- return pidgin_plugin_info_new(
- "id", MAILCHK_PLUGIN_ID,
- "name", N_("Mail Checker"),
- "version", DISPLAY_VERSION,
- "category", N_("Utility"),
- "summary", N_("Checks for new local mail."),
- "description", N_("Adds a small box to the buddy list that shows if "
- "website", PURPLE_WEBSITE,
- "abi-version", PURPLE_ABI_VERSION,
-plugin_load(PurplePlugin *plugin, GError **error)
- PurpleBuddyList *list = purple_blist_get_default();
- void *conn_handle = purple_connections_get_handle();
- if (!check_timeout(NULL)) {
- g_set_error(error, MAILCHK_PLUGIN_DOMAIN, 0, _("Could not read $MAIL "
- "or /var/spool/mail/$USER\n"));
- if (list && PIDGIN_BLIST(list)->vbox)
- timer = g_timeout_add_seconds(2, check_timeout, NULL);
- purple_signal_connect(conn_handle, "signed-on",
- plugin, PURPLE_CALLBACK(signon_cb), NULL);
- purple_signal_connect(conn_handle, "signed-off",
- plugin, PURPLE_CALLBACK(signoff_cb), NULL);
-plugin_unload(PurplePlugin *plugin, GError **error)
- g_source_remove(timer);
- gtk_widget_destroy(mail);
-PURPLE_PLUGIN_INIT(mailchk, plugin_query, plugin_load, plugin_unload);
--- a/pidgin/plugins/meson.build Wed Nov 04 02:41:46 2020 -0600
+++ b/pidgin/plugins/meson.build Wed Nov 04 03:24:02 2020 -0600
@@ -1,42 +1,18 @@
- subdir('musicmessaging')
- contact_priority = library('contact_priority', 'contact_priority.c',
- dependencies : [libpurple_dep, libpidgin_dep, glib],
gtkbuddynote = library('gtkbuddynote', 'gtkbuddynote.c',
dependencies : [libpurple_dep, libpidgin_dep, glib],
install : true, install_dir : PIDGIN_PLUGINDIR)
- gtk_signals_test = library('gtk_signals_test', 'gtk-signals-test.c',
- dependencies : [libpurple_dep, libpidgin_dep, glib],
- history = library('history', 'history.c',
- build_by_default: false,
- dependencies : [libpurple_dep, libpidgin_dep, glib],
- install : false, install_dir : PIDGIN_PLUGINDIR)
iconaway = library('iconaway', 'iconaway.c',
dependencies : [libpurple_dep, libpidgin_dep, glib],
install : true, install_dir : PIDGIN_PLUGINDIR)
- imgupload = library('imgupload', 'imgupload.c',
- dependencies : [json, libpurple_dep, libpidgin_dep, libsoup, glib],
- build_by_default: false,
- install : false, install_dir : PIDGIN_PLUGINDIR)
notify = library('notify', 'notify.c',
dependencies : [libpurple_dep, libpidgin_dep, glib],
@@ -48,17 +24,18 @@
install : true, install_dir : PIDGIN_PLUGINDIR)
- screencap = library('screencap', 'screencap.c',
+ spellchk = library('spellchk', 'spellchk.c', dependencies : [libpurple_dep, libpidgin_dep, glib],
install : false, install_dir : PIDGIN_PLUGINDIR)
- spellchk = library('spellchk', 'spellchk.c',
- dependencies : [libpurple_dep, libpidgin_dep, glib],
- build_by_default: false,
- install : false, install_dir : PIDGIN_PLUGINDIR)
+ transparency = library('transparency', 'transparency.c', + dependencies : [libpurple_dep, libpidgin_dep, glib], + install : true, install_dir : PIDGIN_PLUGINDIR) unity = library('unity', 'unity.c',
--- a/pidgin/plugins/musicmessaging/meson.build Wed Nov 04 02:41:46 2020 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-if PLUGINS and enable_dbus
- install_data('music.png',
- install_dir : get_option('datadir') / 'pixmaps/pidgin/buttons')
- music_messaging_bindings = custom_target('music_messaging_bindings.c',
- command : [python, dbus_analyze_functions, '--export-only', '-o', '@OUTPUT@', '@INPUT@'],
- input : 'musicmessaging.c',
- output : 'music-messaging-bindings.ch')
- musicmessaging = library('musicmessaging', 'musicmessaging.c', music_messaging_bindings,
- dependencies : [dbus, libpurple_dep, libpidgin_dep, glib],
- install : true, install_dir : PIDGIN_PLUGINDIR)
Binary file pidgin/plugins/musicmessaging/music.png has changed
--- a/pidgin/plugins/musicmessaging/musicmessaging.c Wed Nov 04 02:41:46 2020 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,712 +0,0 @@
- * Music messaging plugin for Purple
- * Copyright (C) 2005 Christian Muise.
- * 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
-/* NOTICE: This plugin is currently broken as the libpurple DBus bindings
-#define DBUS_API_SUBJECT_TO_CHANGE
-#include "dbus-bindings.h"
-#include "dbus-server.h"
-#include "dbus-purple.h"
-#define MUSICMESSAGING_PLUGIN_ID "gtk-hazure-musicmessaging"
-#define MUSICMESSAGING_PREFIX "##MM##"
-#define MUSICMESSAGING_START_MSG _("A music messaging session has been requested. Please click the MM icon to accept.")
-#define MUSICMESSAGING_CONFIRM_MSG _("Music messaging session confirmed.")
- PurpleConversation *conv; /* pointer to the conversation */
- GtkWidget *seperator; /* seperator in the conversation */
- GtkWidget *button; /* button in the conversation */
- GPid pid; /* the pid of the score editor */
- gboolean started; /* session has started and editor run */
- gboolean originator; /* started the mm session */
- gboolean requested; /* received a request to start a session */
-static gboolean start_session(MMConversation *mmconv);
-static void run_editor(MMConversation *mmconv);
-static void kill_editor(MMConversation *mmconv);
-static void add_button (MMConversation *mmconv);
-static void remove_widget (GtkWidget *button);
-static void init_conversation (PurpleConversation *conv);
-static void conv_destroyed(PurpleConversation *conv);
-static gboolean intercept_sent(PurpleAccount *account, PurpleMessage *msg, void* pData);
-static gboolean intercept_received(PurpleAccount *account, char **sender, char **message, PurpleConversation *conv, int *flags);
-static gboolean send_change_request (const int session, const char *id, const char *command, const char *parameters);
-static gboolean send_change_confirmed (const int session, const char *command, const char *parameters);
-static void session_end (MMConversation *mmconv);
-static GList *conversations;
-/* Pointer to this plugin */
-static PurplePlugin *plugin_pointer;
-/* Define types needed for DBus */
-DBusGConnection *connection;
-#define DBUS_SERVICE_GSCORE "org.gscore.GScoreService"
-#define DBUS_PATH_GSCORE "/org/gscore/GScoreObject"
-#define DBUS_INTERFACE_GSCORE "org.gscore.GScoreInterface"
-/* Define the functions to export for use with DBus */
-music_messaging_change_request(const int session, const char *command,
- const char *parameters);
-music_messaging_change_confirmed(const int session, const char *command,
- const char *parameters);
-music_messaging_change_failed(const int session, const char *id,
- const char *command, const char *parameters);
-music_messaging_done_session(const int session);
-/* This file has been generated by the #dbus-analize-functions.py
- script. It contains dbus wrappers for the four functions declared
-#include "music-messaging-bindings.ch"
-/* Exported functions */
-music_messaging_change_request(const int session, const char *command,
- const char *parameters)
- MMConversation *mmconv = (MMConversation *)g_list_nth_data(conversations, session);
- if (mmconv->originator)
- const char *name = purple_conversation_get_name(mmconv->conv);
- send_change_request (session, name, command, parameters);
- GString *to_send = g_string_new("");
- g_string_append_printf(to_send, "##MM## request %s %s##MM##", command, parameters);
- purple_conversation_send(mmconv->conv, to_send->str);
- purple_debug_misc("musicmessaging", "Sent request: %s\n", to_send->str);
-music_messaging_change_confirmed(const int session, const char *command,
- const char *parameters)
- MMConversation *mmconv = (MMConversation *)g_list_nth_data(conversations, session);
- if (mmconv->originator)
- GString *to_send = g_string_new("");
- g_string_append_printf(to_send, "##MM## confirm %s %s##MM##", command, parameters);
- purple_conversation_send(mmconv->conv, to_send->str);
- /* Do nothing. If they aren't the originator, then they can't confirm. */
-music_messaging_change_failed(const int session, const char *id,
- const char *command, const char *parameters)
- MMConversation *mmconv = (MMConversation *)g_list_nth_data(conversations, session);
- purple_notify_message(plugin_pointer, PURPLE_NOTIFY_MSG_INFO, command,
- parameters, NULL, NULL, NULL, NULL);
- if (mmconv->originator)
- GString *to_send = g_string_new("");
- g_string_append_printf(to_send, "##MM## failed %s %s %s##MM##", id, command, parameters);
- purple_conversation_send(mmconv->conv, to_send->str);
- /* Do nothing. If they aren't the originator, then they can't confirm. */
-music_messaging_done_session(const int session)
- MMConversation *mmconv = (MMConversation *)g_list_nth_data(conversations, session);
- purple_notify_message(plugin_pointer, PURPLE_NOTIFY_MSG_INFO, "Session",
- "Session Complete", NULL, NULL, NULL, NULL);
-/* DBus commands that can be sent to the editor */
-DBusConnection *purple_dbus_get_connection(void);
-static gboolean send_change_request (const int session, const char *id, const char *command, const char *parameters)
- /* Create the signal we need */
- message = dbus_message_new_signal (PURPLE_DBUS_PATH, PURPLE_DBUS_INTERFACE, "GscoreChangeRequest");
- /* Append the string "Ping!" to the signal */
- dbus_message_append_args (message,
- DBUS_TYPE_INT32, &session,
- DBUS_TYPE_STRING, &command,
- DBUS_TYPE_STRING, ¶meters,
- dbus_connection_send (purple_dbus_get_connection(), message, NULL);
- /* Free the signal now we have finished with it */
- dbus_message_unref (message);
- /* Tell the user we sent a signal */
- g_printerr("Sent change request signal: %d %s %s %s\n", session, id, command, parameters);
-static gboolean send_change_confirmed (const int session, const char *command, const char *parameters)
- /* Create the signal we need */
- message = dbus_message_new_signal (PURPLE_DBUS_PATH, PURPLE_DBUS_INTERFACE, "GscoreChangeConfirmed");
- /* Append the string "Ping!" to the signal */
- dbus_message_append_args (message,
- DBUS_TYPE_INT32, &session,
- DBUS_TYPE_STRING, &command,
- DBUS_TYPE_STRING, ¶meters,
- dbus_connection_send (purple_dbus_get_connection(), message, NULL);
- /* Free the signal now we have finished with it */
- dbus_message_unref (message);
- /* Tell the user we sent a signal */
- g_printerr("Sent change confirmed signal.\n");
-mmconv_from_conv_loc(PurpleConversation *conv)
- MMConversation *mmconv_current = NULL;
- for (l = conversations; l != NULL; l = l->next)
- mmconv_current = l->data;
- if (conv == mmconv_current->conv)
-mmconv_from_conv(PurpleConversation *conv)
- return (MMConversation *)g_list_nth_data(conversations, mmconv_from_conv_loc(conv));
-intercept_sent(PurpleAccount *account, PurpleMessage *msg, void* pData)
- const gchar *cont = purple_message_get_contents(msg);
- if (purple_message_is_empty(msg))
- if (0 == strncmp(cont, MUSICMESSAGING_PREFIX, strlen(MUSICMESSAGING_PREFIX)))
- purple_debug_misc("purple-musicmessaging", "Sent MM Message: %s\n", cont);
- else if (0 == strncmp(cont, MUSICMESSAGING_START_MSG, strlen(MUSICMESSAGING_START_MSG)))
- purple_debug_misc("purple-musicmessaging", "Sent MM request.\n");
- else if (0 == strncmp(cont, MUSICMESSAGING_CONFIRM_MSG, strlen(MUSICMESSAGING_CONFIRM_MSG)))
- purple_debug_misc("purple-musicmessaging", "Sent MM confirm.\n");
- else if (0 == strncmp(cont, "test1", strlen("test1")))
- purple_debug_misc("purple-musicmessaging", "\n\nTEST 1\n\n");
- send_change_request(0, "test-id", "test-command", "test-parameters");
- else if (0 == strncmp(cont, "test2", strlen("test2")))
- purple_debug_misc("purple-musicmessaging", "\n\nTEST 2\n\n");
- send_change_confirmed(1, "test-command", "test-parameters");
- /* Do nothing...procceed as normal */
-intercept_received(PurpleAccount *account, char **sender, char **message, PurpleConversation *conv, int *flags)
- MMConversation *mmconv;
- /* XXX: This is just to avoid a crash (#2726).
- * We may want to create the conversation instead of returning from here
- mmconv = mmconv_from_conv(conv);
- purple_debug_misc("purple-musicmessaging", "Intercepted: %s\n", *message);
- if (strstr(*message, MUSICMESSAGING_PREFIX))
- char *parsed_message = strtok(strstr(*message, MUSICMESSAGING_PREFIX), "<");
- purple_debug_misc("purple-musicmessaging", "Received an MM Message: %s\n", parsed_message);
- if (strstr(parsed_message, "request"))
- if (mmconv->originator)
- int session = mmconv_from_conv_loc(conv);
- const char *id = purple_conversation_get_name(mmconv->conv);
- purple_debug_misc("purple-musicmessaging", "Sending request to gscore.\n");
- /* Get past the first two terms - '##MM##' and 'request' */
- strtok(parsed_message, " "); /* '##MM##' */
- strtok(NULL, " "); /* 'request' */
- command = strtok(NULL, " ");
- parameters = strtok(NULL, "#");
- send_change_request (session, id, command, parameters);
- } else if (strstr(parsed_message, "confirm"))
- if (!mmconv->originator)
- int session = mmconv_from_conv_loc(conv);
- purple_debug_misc("purple-musicmessaging", "Sending confirmation to gscore.\n");
- /* Get past the first two terms - '##MM##' and 'confirm' */
- strtok(parsed_message, " "); /* '##MM##' */
- strtok(NULL, " "); /* 'confirm' */
- command = strtok(NULL, " ");
- parameters = strtok(NULL, "#");
- send_change_confirmed (session, command, parameters);
- } else if (strstr(parsed_message, "failed"))
- /* Get past the first two terms - '##MM##' and 'confirm' */
- strtok(parsed_message, " "); /* '##MM##' */
- strtok(NULL, " "); /* 'failed' */
- id = strtok(NULL, " ");
- command = strtok(NULL, " ");
- /* char *parameters = strtok(NULL, "#"); DONT NEED PARAMETERS */
- // TODO: Shouldn't this be strcmp() ?
- if (purple_conversation_get_name(mmconv->conv) == id)
- purple_notify_message(plugin_pointer, PURPLE_NOTIFY_MSG_ERROR,
- _("There was a conflict in running the command:"), command, NULL, NULL, NULL);
- else if (strstr(*message, MUSICMESSAGING_START_MSG))
- purple_debug_misc("purple-musicmessaging", "Received MM request.\n");
- if (!(mmconv->originator))
- mmconv->requested = TRUE;
- else if (strstr(*message, MUSICMESSAGING_CONFIRM_MSG))
- purple_debug_misc("purple-musicmessagin", "Received MM confirm.\n");
- if (mmconv->originator)
-static void send_request(MMConversation *mmconv)
- PurpleConnection *connection = purple_conversation_get_connection(mmconv->conv);
- const char *convName = purple_conversation_get_name(mmconv->conv);
- purple_serv_send_im(connection, purple_message_new_outgoing(
- convName, MUSICMESSAGING_START_MSG, 0));
-static void send_request_confirmed(MMConversation *mmconv)
- PurpleConnection *connection = purple_conversation_get_connection(mmconv->conv);
- const char *convName = purple_conversation_get_name(mmconv->conv);
- purple_serv_send_im(connection, purple_message_new_outgoing(
- convName, MUSICMESSAGING_CONFIRM_MSG, 0));
-start_session(MMConversation *mmconv)
-static void session_end (MMConversation *mmconv)
- mmconv->started = FALSE;
- mmconv->originator = FALSE;
- mmconv->requested = FALSE;
-static void music_button_toggled (GtkWidget *widget, gpointer data)
- MMConversation *mmconv = mmconv_from_conv(((MMConversation *) data)->conv);
- if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
- if (((MMConversation *) data)->requested)
- send_request_confirmed(mmconv);
- ((MMConversation *) data)->originator = TRUE;
- send_request((MMConversation *) data);
- session_end((MMConversation *)data);
-static void set_editor_path (GtkWidget *button, GtkWidget *text_field)
- const char * path = gtk_entry_get_text((GtkEntry*)text_field);
- purple_prefs_set_string("/plugins/gtk/musicmessaging/editor_path", path);
-static void run_editor (MMConversation *mmconv)
- GError *spawn_error = NULL;
- args[0] = (gchar *)purple_prefs_get_string("/plugins/gtk/musicmessaging/editor_path");
- args[1] = "-session_id";
- session_id = g_string_new("");
- g_string_append_printf(session_id, "%d", mmconv_from_conv_loc(mmconv->conv));
- args[2] = session_id->str;
- if (!(g_spawn_async (".", args, NULL, 4, NULL, NULL, &(mmconv->pid), &spawn_error)))
- purple_notify_error(plugin_pointer, _("Error Running Editor"),
- _("The following error has occurred:"), spawn_error->message, NULL);
- mmconv->started = FALSE;
- mmconv->started = TRUE;
-static void kill_editor (MMConversation *mmconv)
- kill(mmconv->pid, SIGINT);
-static void init_conversation (PurpleConversation *conv)
- MMConversation *mmconv;
- mmconv = g_new0(MMConversation, 1);
- mmconv->started = FALSE;
- mmconv->originator = FALSE;
- mmconv->requested = FALSE;
- conversations = g_list_append(conversations, mmconv);
-static void conv_destroyed (PurpleConversation *conv)
- MMConversation *mmconv = mmconv_from_conv(conv);
- remove_widget(mmconv->button);
- remove_widget(mmconv->seperator);
- conversations = g_list_remove(conversations, mmconv);
-static void add_button (MMConversation *mmconv)
- PurpleConversation *conv = mmconv->conv;
- GtkWidget *button, *image, *sep;
- button = gtk_toggle_button_new();
- gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
- g_signal_connect(G_OBJECT(button), "toggled", G_CALLBACK(music_button_toggled), mmconv);
- file_path = g_build_filename(PURPLE_DATADIR,
- "pixmaps", "purple", "buttons", "music.png", NULL);
- image = gtk_image_new_from_file(file_path);
- gtk_container_add((GtkContainer *)button, image);
- sep = gtk_separator_new(GTK_ORIENTATION_VERTICAL);
- mmconv->seperator = sep;
- mmconv->button = button;
- gtk_widget_show(image);
- gtk_widget_show(button);
- gtk_box_pack_start(GTK_BOX(PIDGIN_CONVERSATION(conv)->toolbar), sep, FALSE, FALSE, 0);
- gtk_box_pack_start(GTK_BOX(PIDGIN_CONVERSATION(conv)->toolbar), button, FALSE, FALSE, 0);
-static void remove_widget (GtkWidget *button)
- gtk_widget_hide(button);
- gtk_widget_destroy(button);
-get_config_frame(PurplePlugin *plugin)
- GtkWidget *editor_path;
- GtkWidget *editor_path_label;
- GtkWidget *editor_path_button;
- /* Outside container */
- ret = gtk_box_new(GTK_ORIENTATION_VERTICAL, 18);
- gtk_container_set_border_width(GTK_CONTAINER(ret), 10);
- /* Configuration frame */
- vbox = pidgin_make_frame(ret, _("Music Messaging Configuration"));
- /* Path to the score editor */
- editor_path = gtk_entry_new();
- editor_path_label = gtk_label_new(_("Score Editor Path"));
- editor_path_button = gtk_button_new_with_mnemonic(_("_Apply"));
- gtk_entry_set_text((GtkEntry*)editor_path, "/usr/local/bin/gscore");
- g_signal_connect(G_OBJECT(editor_path_button), "clicked",
- G_CALLBACK(set_editor_path), editor_path);
- gtk_box_pack_start(GTK_BOX(vbox), editor_path_label, FALSE, FALSE, 0);
- gtk_box_pack_start(GTK_BOX(vbox), editor_path, FALSE, FALSE, 0);
- gtk_box_pack_start(GTK_BOX(vbox), editor_path_button, FALSE, FALSE, 0);
- gtk_widget_show_all(ret);
-static PidginPluginInfo *
-plugin_query(GError **error) {
- const gchar * const authors[] = {
- "Christian Muise <christian.muise@gmail.com>",
- return pidgin_plugin_info_new(
- "id", MUSICMESSAGING_PLUGIN_ID,
- "name", N_("Music Messaging"),
- "version", DISPLAY_VERSION,
- "category", N_("Music"),
- "summary", N_("Music Messaging Plugin for "
- "collaborative composition."),
- "description", N_("The Music Messaging Plugin allows a "
- "number of users to simultaneously work "
- "on a piece of music by editing a common "
- "score in real-time."),
- "website", PURPLE_WEBSITE,
- "abi-version", PURPLE_ABI_VERSION,
- "gtk-config-frame-cb", get_config_frame,
-plugin_load(PurplePlugin *plugin, GError **error) {
- void *conv_list_handle;
- PURPLE_DBUS_RETURN_FALSE_IF_DISABLED(plugin);
- purple_prefs_add_none("/plugins/gtk/musicmessaging");
- purple_prefs_add_string("/plugins/gtk/musicmessaging/editor_path", "/usr/bin/gscore");
- /* First, we have to register our four exported functions with the
- main purple dbus loop. Without this statement, the purple dbus
- code wouldn't know about our functions. */
- PURPLE_DBUS_REGISTER_BINDINGS(plugin);
- /* Keep the plugin for reference (needed for notify's) */
- plugin_pointer = plugin;
- /* Add the button to all the current conversations */
- for (l = purple_conversations_get_all(); l != NULL; l = l->next)
- init_conversation((PurpleConversation *)l->data);
- /* Listen for any new conversations */
- conv_list_handle = purple_conversations_get_handle();
- purple_signal_connect(conv_list_handle, "conversation-created",
- plugin, PURPLE_CALLBACK(init_conversation), NULL);
- /* Listen for conversations that are ending */
- purple_signal_connect(conv_list_handle, "deleting-conversation",
- plugin, PURPLE_CALLBACK(conv_destroyed), NULL);
- /* Listen for sending/receiving messages to replace tags */
- purple_signal_connect(conv_list_handle, "sending-im-msg",
- plugin, PURPLE_CALLBACK(intercept_sent), NULL);
- purple_signal_connect(conv_list_handle, "receiving-im-msg",
- plugin, PURPLE_CALLBACK(intercept_received), NULL);
-plugin_unload(PurplePlugin *plugin, GError **error) {
- MMConversation *mmconv = NULL;
- while (conversations != NULL)
- mmconv = conversations->data;
- conv_destroyed(mmconv->conv);
-PURPLE_PLUGIN_INIT(musicmessaging, plugin_query, plugin_load, plugin_unload);
--- a/pidgin/plugins/pidgininc.c Wed Nov 04 02:41:46 2020 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-/* When writing a third-party plugin, do not include libpurple's internal.h
- * included below. This file is for internal libpurple use only. We're including
- * it here for our own convenience. */
-/* include UI for pidgin_dialogs_about() */
-#define PURPLEINC_PLUGIN_ID "core-purpleinc"
-echo_hi(PurpleConnection *gc)
- /* this doesn't do much, just lets you know who we are :) */
- pidgin_dialogs_about();
-reverse(PurpleAccount *account, char **who, char **message,
- PurpleConversation *conv, int *flags)
- /* this will drive you insane. whenever you receive a message,
- * the text of the message (HTML and all) will be reversed. */
- /* this check is necessary in case bad plugins do bad things */
- if (message == NULL || *message == NULL)
- if (purple_strequal(*who, purple_account_get_username(account)))
- for (i = 0; i < l/2; i++) {
- (*message)[i] = (*message)[l - i - 1];
- (*message)[l - i - 1] = tmp;
- PurpleAccount *acct = purple_buddy_get_account(who);
- PurpleIMConversation *im = purple_im_conversation_new(acct,
- purple_buddy_get_name(who));
- purple_conversation_send(PURPLE_CONVERSATION(im), "Hello!");
-static PidginPluginInfo *
-plugin_query(GError **error)
- const gchar * const authors[] = {
- "Eric Warmenhoven <eric@warmenhoven.org>",
- return pidgin_plugin_info_new(
- "id", PURPLEINC_PLUGIN_ID,
- "name", N_("Pidgin Demonstration Plugin"),
- "version", DISPLAY_VERSION,
- "category", N_("Example"),
- "summary", N_("An example plugin that does stuff - see the description."),
- "description", N_("This is a really cool plugin that does a lot of stuff:\n"
- "- It tells you who wrote the program when you log in\n"
- "- It reverses all incoming text\n"
- "- It sends a message to people on your list immediately"
- "website", PURPLE_WEBSITE,
- "abi-version", PURPLE_ABI_VERSION,
-plugin_load(PurplePlugin *plugin, GError **error)
- /* this is for doing something fun when we sign on */
- purple_signal_connect(purple_connections_get_handle(), "signed-on",
- plugin, PURPLE_CALLBACK(echo_hi), NULL);
- /* this is for doing something fun when we get a message */
- purple_signal_connect(purple_conversations_get_handle(), "receiving-im-msg",
- plugin, PURPLE_CALLBACK(reverse), NULL);
- /* this is for doing something fun when a buddy comes online */
- purple_signal_connect(purple_blist_get_handle(), "buddy-signed-on",
- plugin, PURPLE_CALLBACK(bud), NULL);
-plugin_unload(PurplePlugin *plugin, GError **error)
-PURPLE_PLUGIN_INIT(purpleinc, plugin_query, plugin_load, plugin_unload);
--- a/pidgin/plugins/screencap.c Wed Nov 04 02:41:46 2020 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,977 +0,0 @@
- * Screen Capture - a plugin that allows taking screenshots and sending them
- * to your buddies as inline images.
- * Copyright (C) 2014, Tomasz Wasilczyk <twasilczyk@pidgin.im>
- * 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 <gdk/gdkkeysyms.h>
-#include "gtkwebviewtoolbar.h"
-#define SCRNCAP_SHOOTING_TIMEOUT 500
-#define SCRNCAP_DEFAULT_COLOR "#FFFF00000000"
-static gboolean is_shooting = FALSE;
-static guint shooting_timeout = 0;
-static GtkWidget *current_window = NULL;
-static gint crop_origin_x, crop_origin_y;
-static gboolean crop_active;
-static gint crop_x, crop_y, crop_w, crop_h;
-static gint draw_origin_x, draw_origin_y;
-static gboolean draw_active;
-static GdkRGBA brush_color = {1, 0, 0, 1};
-static gint line_width = 2;
-/******************************************************************************
- * libpidgin helper functions
- ******************************************************************************/
-scrncap_conv_set_data(PidginConversation *gtkconv, const gchar *key,
- g_return_if_fail(gtkconv != NULL);
- g_object_set_data(G_OBJECT(gtkconv->tab_cont), key, value);
-scrncap_conv_get_data(PidginConversation *gtkconv, const gchar *key)
- g_return_val_if_fail(gtkconv != NULL, NULL);
- return g_object_get_data(G_OBJECT(gtkconv->tab_cont), key);
-/******************************************************************************
- * GdkPixbuf helper functions
- ******************************************************************************/
-scrncap_perform_screenshot(void)
- root = gdk_get_default_root_window();
- gdk_window_get_origin(root, &orig_x, &orig_y);
- return gdk_pixbuf_get_from_window(root, 0, 0,
- gdk_window_get_width(root), gdk_window_get_height(root));
-scrncap_pixbuf_darken(GdkPixbuf *pixbuf)
- int i, y, width, height, row_width, n_channels, rowstride, pad;
- pixels = gdk_pixbuf_get_pixels(pixbuf);
- width = gdk_pixbuf_get_width(pixbuf);
- height = gdk_pixbuf_get_height(pixbuf);
- n_channels = gdk_pixbuf_get_n_channels(pixbuf);
- rowstride = gdk_pixbuf_get_rowstride(pixbuf);
- row_width = width * n_channels;
- pad = rowstride - row_width;
- g_return_if_fail(pad >= 0);
- for (y = 0; y < height; y++) {
- for (i = 0; i < row_width; i++, pixels++)
-scrncap_pixbuf_to_image(GdkPixbuf *pixbuf)
- PurpleImage *image = NULL;
- if (!gdk_pixbuf_save_to_buffer(pixbuf, &buffer, &count, "png",
- purple_debug_error("screencap", "Failed saving an image: %s",
- image = purple_image_new_take_data((guint8 *)buffer, count);
- if (purple_image_get_extension(image) == NULL) {
- purple_debug_error("screencap", "Invalid image format");
-/******************************************************************************
- ******************************************************************************/
-scrncap_drawing_area_btnpress(GtkWidget *draw_area, GdkEventButton *event,
- draw_origin_x = event->x;
- draw_origin_y = event->y;
-scrncap_drawing_area_btnrelease(GtkWidget *draw_area, GdkEvent *event,
-scrncap_drawing_area_motion(GtkWidget *draw_area, GdkEventButton *event,
- int redraw_x, redraw_y, redraw_w, redraw_h;
- cairo_move_to(cr, draw_origin_x, draw_origin_y);
- cairo_line_to(cr, x, y);
- cairo_set_line_width(cr, line_width);
- redraw_x = MIN(draw_origin_x, x) - line_width - 1;
- redraw_y = MIN(draw_origin_y, y) - line_width - 1;
- redraw_w = MAX(draw_origin_x, x) - redraw_x + line_width + 1;
- redraw_h = MAX(draw_origin_y, y) - redraw_y + line_width + 1;
- gtk_widget_queue_draw_area(draw_area,
- redraw_x, redraw_y, redraw_w, redraw_h);
-scrncap_drawing_area_enter(GtkWidget *widget, GdkEvent *event,
- GdkCursor *draw_cursor)
- gdkwindow = gtk_widget_get_window(GTK_WIDGET(widget));
- gdk_window_set_cursor(gdkwindow, draw_cursor);
-scrncap_drawing_area_leave(GtkWidget *widget, GdkEvent *event,
- GdkCursor *draw_cursor)
- gdkwindow = gtk_widget_get_window(GTK_WIDGET(widget));
- gdk_window_set_cursor(gdkwindow, NULL);
-scrncap_draw_window_close(GtkWidget *window, gpointer _unused)
- if (current_window != window)
-scrncap_draw_window_paint(GtkWidget *widget, cairo_t *cr, gpointer _surface)
- cairo_surface_t *surface = _surface;
- cairo_set_source_surface(cr, surface, 0, 0);
-scrncap_draw_window_response(GtkDialog *draw_window, gint response_id,
- PidginWebView *webview = PIDGIN_WEBVIEW(_webview);
- GdkPixbuf *result = NULL;
- const gchar *fname_prefix;
- static guint fname_no = 0;
- if (response_id == SCRNCAP_RESPONSE_COLOR)
- if (response_id == GTK_RESPONSE_OK) {
- cairo_surface_t *surface = g_object_get_data(
- G_OBJECT(draw_window), "surface");
- result = gdk_pixbuf_get_from_surface(surface, 0, 0,
- cairo_image_surface_get_width(surface),
- cairo_image_surface_get_height(surface));
- gtk_widget_destroy(GTK_WIDGET(draw_window));
- image = scrncap_pixbuf_to_image(result);
- /* translators: this is the file name prefix,
- * keep it lowercase and pure ASCII.
- * Please avoid "_" character, use "-" instead. */
- fname_prefix = _("screenshot-");
- fname = g_strdup_printf("%s%u", fname_prefix, ++fname_no);
- purple_image_set_friendly_filename(image, fname);
- pidgin_webview_insert_image(webview, image);
-scrncap_draw_color_selected(GtkColorButton *button, cairo_t *cr)
- gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(button), &brush_color);
- gdk_cairo_set_source_rgba(cr, &brush_color);
- color_str = gdk_rgba_to_string(&brush_color);
- purple_prefs_set_string("/plugins/gtk/screencap/brush_color", color_str);
-scrncap_draw_window(PidginWebView *webview, GdkPixbuf *screen)
- GtkDialog *draw_window;
- GtkWidget *drawing_area, *box;
- GtkWidget *scroll_area;
- GtkWidget *color_button;
- cairo_surface_t *surface;
- GdkCursor *draw_cursor;
- current_window = pidgin_create_dialog(
- _("Insert screenshot"), 0, "insert-screenshot", TRUE);
- draw_window = GTK_DIALOG(current_window);
- gtk_widget_set_size_request(GTK_WIDGET(draw_window), 400, 300);
- gtk_window_set_position(GTK_WINDOW(draw_window), GTK_WIN_POS_CENTER);
- g_signal_connect(G_OBJECT(draw_window), "destroy",
- G_CALLBACK(scrncap_draw_window_close), NULL);
- display = gtk_widget_get_display(current_window);
- draw_cursor = gdk_cursor_new_for_display(display, GDK_PENCIL);
- g_object_set_data_full(G_OBJECT(draw_window), "draw-cursor",
- draw_cursor, g_object_unref);
- width = gdk_pixbuf_get_width(screen);
- height = gdk_pixbuf_get_height(screen);
- surface = cairo_image_surface_create(CAIRO_FORMAT_RGB24, width, height);
- cr = cairo_create(surface);
- g_signal_connect_swapped(G_OBJECT(draw_window), "destroy",
- G_CALLBACK(cairo_destroy), cr);
- g_object_set_data_full(G_OBJECT(draw_window), "surface",
- surface, (GDestroyNotify)cairo_surface_destroy);
- gdk_cairo_set_source_pixbuf(cr, screen, 0, 0);
- cairo_rectangle(cr, 0, 0, width, height);
- g_object_unref(screen);
- drawing_area = gtk_drawing_area_new();
- gtk_widget_set_size_request(drawing_area, width, height);
- g_signal_connect(G_OBJECT(drawing_area), "draw",
- G_CALLBACK(scrncap_draw_window_paint), surface);
- gtk_widget_add_events(drawing_area, GDK_BUTTON_PRESS_MASK |
- GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_MOTION_MASK |
- GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK);
- g_signal_connect(G_OBJECT(drawing_area), "button-press-event",
- G_CALLBACK(scrncap_drawing_area_btnpress), NULL);
- g_signal_connect(G_OBJECT(drawing_area), "button-release-event",
- G_CALLBACK(scrncap_drawing_area_btnrelease), NULL);
- g_signal_connect(G_OBJECT(drawing_area), "motion-notify-event",
- G_CALLBACK(scrncap_drawing_area_motion), cr);
- g_signal_connect(G_OBJECT(drawing_area), "enter-notify-event",
- G_CALLBACK(scrncap_drawing_area_enter), draw_cursor);
- g_signal_connect(G_OBJECT(drawing_area), "leave-notify-event",
- G_CALLBACK(scrncap_drawing_area_leave), draw_cursor);
- g_object_set(drawing_area,
- "halign", GTK_ALIGN_CENTER,
- "valign", GTK_ALIGN_CENTER,
- scroll_area = pidgin_make_scrollable(box,
- GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC,
- GTK_SHADOW_NONE, -1, -1);
- g_object_set(G_OBJECT(scroll_area), "expand", TRUE, NULL);
- gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(
- GTK_DIALOG(draw_window))), scroll_area);
- color_button = gtk_color_button_new();
- gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(color_button),
- g_signal_connect(G_OBJECT(color_button), "color-set",
- G_CALLBACK(scrncap_draw_color_selected), cr);
- scrncap_draw_color_selected(GTK_COLOR_BUTTON(color_button), cr);
- gtk_dialog_add_action_widget(draw_window, color_button,
- SCRNCAP_RESPONSE_COLOR);
- gtk_dialog_add_button(draw_window, _("_Add"), GTK_RESPONSE_OK);
- gtk_dialog_add_button(draw_window, _("_Cancel"),
- gtk_dialog_set_default_response(draw_window, GTK_RESPONSE_OK);
- g_signal_connect(G_OBJECT(draw_window), "response",
- G_CALLBACK(scrncap_draw_window_response), webview);
- gtk_widget_show_all(GTK_WIDGET(draw_window));
-/******************************************************************************
- ******************************************************************************/
-scrncap_crop_window_close(GtkWidget *window, gpointer _unused)
- if (current_window != window)
-scrncap_crop_window_keypress(GtkWidget *crop_window, GdkEventKey *event,
- PidginWebView *webview = PIDGIN_WEBVIEW(_webview);
- guint key = event->keyval;
- if (key == GDK_KEY_Escape) {
- gtk_widget_destroy(crop_window);
- if (key == GDK_KEY_Return) {
- GdkPixbuf *screenshot, *subscreen, *result;
- screenshot = g_object_get_data(G_OBJECT(crop_window),
- subscreen = gdk_pixbuf_new_subpixbuf(screenshot,
- crop_x, crop_y, crop_w, crop_h);
- result = gdk_pixbuf_copy(subscreen);
- g_object_unref(subscreen);
- gtk_widget_destroy(crop_window);
- scrncap_draw_window(webview, result);
-scrncap_crop_window_focusout(GtkWidget *window, GdkEventFocus *event,
- gtk_widget_destroy(window);
-scrncap_crop_window_btnpress(GtkWidget *window, GdkEventButton *event,
- g_return_val_if_fail(!crop_active, TRUE);
- hint_box = g_object_get_data(G_OBJECT(window), "hint-box");
- gtk_widget_destroy(hint_box);
- g_object_set_data(G_OBJECT(window), "hint-box", NULL);
- selection = g_object_get_data(G_OBJECT(window), "selection");
- cont = g_object_get_data(G_OBJECT(window), "cont");
- gtk_fixed_move(cont, GTK_WIDGET(selection), -10, -10);
- gtk_image_set_from_pixbuf(selection, NULL);
- gtk_widget_show(GTK_WIDGET(selection));
- crop_origin_x = event->x_root;
- crop_origin_y = event->y_root;
-scrncap_crop_window_btnrelease(GtkWidget *window, GdkEvent *event,
-scrncap_crop_window_motion(GtkWidget *window, GdkEventButton *event,
- GdkPixbuf *crop, *screenshot;
- g_return_val_if_fail(crop_active, FALSE);
- selection = g_object_get_data(G_OBJECT(window), "selection");
- cont = g_object_get_data(G_OBJECT(window), "cont");
- crop_x = MIN(crop_origin_x, event->x_root);
- crop_y = MIN(crop_origin_y, event->y_root);
- crop_w = abs(crop_origin_x - event->x_root);
- crop_h = abs(crop_origin_y - event->y_root);
- crop_w = MAX(crop_w, 1);
- crop_h = MAX(crop_h, 1);
- gtk_fixed_move(cont, GTK_WIDGET(selection), crop_x, crop_y);
- screenshot = g_object_get_data(G_OBJECT(window), "screenshot");
- crop = gdk_pixbuf_new_subpixbuf(screenshot,
- crop_x, crop_y, crop_w, crop_h);
- gtk_image_set_from_pixbuf(GTK_IMAGE(selection), crop);
-scrncap_crop_window_realize(GtkWidget *crop_window, gpointer _unused)
- gdkwindow = gtk_widget_get_window(GTK_WIDGET(crop_window));
- display = gdk_window_get_display(gdkwindow);
- gdk_window_set_events(gdkwindow, gdk_window_get_events(gdkwindow) |
- GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
- GDK_BUTTON_MOTION_MASK);
- cursor = gdk_cursor_new_for_display(display, GDK_CROSSHAIR);
- gdk_window_set_cursor(gdkwindow, cursor);
- g_object_unref(cursor);
-scrncap_do_screenshot_cb(gpointer _webview)
- PidginWebView *webview = PIDGIN_WEBVIEW(_webview);
- GtkWindow *crop_window;
- GdkPixbuf *screenshot, *screenshot_d;
- GtkImage *image, *selection;
- GtkRequisition hint_size;
- screenshot = scrncap_perform_screenshot();
- g_return_val_if_fail(screenshot != NULL, G_SOURCE_REMOVE);
- width = gdk_pixbuf_get_width(screenshot);
- height = gdk_pixbuf_get_height(screenshot);
- current_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
- crop_window = GTK_WINDOW(current_window);
- gtk_window_set_decorated(crop_window, FALSE);
- gtk_window_set_resizable(crop_window, FALSE);
- gtk_widget_set_size_request(GTK_WIDGET(crop_window), width, height);
- gtk_window_fullscreen(crop_window);
- gtk_window_set_keep_above(crop_window, TRUE);
- g_signal_connect(G_OBJECT(crop_window), "realize",
- G_CALLBACK(scrncap_crop_window_realize), NULL);
- g_signal_connect(G_OBJECT(crop_window), "destroy",
- G_CALLBACK(scrncap_crop_window_close), NULL);
- g_signal_connect(G_OBJECT(crop_window), "key-press-event",
- G_CALLBACK(scrncap_crop_window_keypress), webview);
- g_signal_connect(G_OBJECT(crop_window), "focus-out-event",
- G_CALLBACK(scrncap_crop_window_focusout), NULL);
- g_signal_connect(G_OBJECT(crop_window), "button-press-event",
- G_CALLBACK(scrncap_crop_window_btnpress), NULL);
- g_signal_connect(G_OBJECT(crop_window), "button-release-event",
- G_CALLBACK(scrncap_crop_window_btnrelease), NULL);
- g_signal_connect(G_OBJECT(crop_window), "motion-notify-event",
- G_CALLBACK(scrncap_crop_window_motion), NULL);
- g_object_set_data_full(G_OBJECT(crop_window), "screenshot",
- screenshot, g_object_unref);
- cont = GTK_FIXED(gtk_fixed_new());
- g_object_set_data(G_OBJECT(crop_window), "cont", cont);
- gtk_container_add(GTK_CONTAINER(crop_window), GTK_WIDGET(cont));
- screenshot_d = gdk_pixbuf_copy(screenshot);
- scrncap_pixbuf_darken(screenshot_d);
- image = GTK_IMAGE(gtk_image_new_from_pixbuf(screenshot_d));
- g_object_unref(screenshot_d);
- gtk_fixed_put(cont, GTK_WIDGET(image), 0, 0);
- selection = GTK_IMAGE(gtk_image_new_from_pixbuf(NULL));
- gtk_fixed_put(cont, GTK_WIDGET(selection), -10, -10);
- g_object_set_data(G_OBJECT(crop_window), "selection", selection);
- hint = gtk_label_new(NULL);
- hint_msg = g_strdup_printf("<span size='x-large'>%s</span>",
- _("Select the region to send and press Enter button to confirm "
- "or press Escape button to cancel"));
- gtk_label_set_markup(GTK_LABEL(hint), hint_msg);
- gtk_widget_set_margin_start(hint, 10);
- gtk_widget_set_margin_end(hint, 10);
- gtk_widget_set_margin_top(hint, 7);
- gtk_widget_set_margin_bottom(hint, 7);
- hint_box = gtk_event_box_new();
- gtk_container_add(GTK_CONTAINER(hint_box), hint);
- gtk_widget_get_preferred_size(hint, NULL, &hint_size);
- gtk_fixed_put(cont, hint_box,
- width / 2 - hint_size.width / 2 - 10,
- height / 2 - hint_size.height / 2 - 7);
- g_object_set_data(G_OBJECT(crop_window), "hint-box", hint_box);
- gtk_widget_show_all(GTK_WIDGET(crop_window));
- gtk_widget_hide(GTK_WIDGET(selection));
- return G_SOURCE_REMOVE;
-scrncap_do_screenshot(GtkAction *action, PidginWebView *webview)
- gtk_window_present(GTK_WINDOW(current_window));
- shooting_timeout = g_timeout_add(SCRNCAP_SHOOTING_TIMEOUT,
- scrncap_do_screenshot_cb, webview);
-/******************************************************************************
- * PidginConversation setup
- ******************************************************************************/
-scrncap_convwin_switch(GtkNotebook *notebook, GtkWidget *page, gint page_num,
- PidginConvWindow *win = _win;
- PidginConversation *gtkconv;
- PidginWebView *webview;
- gboolean images_supported;
- gtkconv = pidgin_conv_window_get_active_gtkconv(win);
- webview = PIDGIN_WEBVIEW(gtkconv->entry);
- action = g_object_get_data(G_OBJECT(win->menu->menubar),
- "insert-screenshot-action");
- g_return_if_fail(action != NULL);
- images_supported = pidgin_webview_get_format_functions(webview) &
- gtk_action_set_sensitive(action, images_supported);
-scrncap_convwin_menu_cb(GtkAction *action, PidginConvWindow *win)
- PidginConversation *gtkconv;
- PidginWebView *webview;
- gtkconv = pidgin_conv_window_get_active_gtkconv(win);
- webview = PIDGIN_WEBVIEW(gtkconv->entry);
- scrncap_do_screenshot(action, webview);
-scrncap_convwin_init(PidginConvWindow *win)
- PidginConvWindowMenu *menu = win->menu;
- GtkWidget *conv_submenu, *conv_insert_image;
- GtkWidget *scrncap_btn_menu;
- action = g_object_get_data(G_OBJECT(menu->menubar),
- "insert-screenshot-action");
- action = gtk_action_new("InsertScreenshot", _("Insert Screens_hot..."),
- NULL, PIDGIN_ICON_CAMERA_PHOTO);
- gtk_action_set_is_important(action, TRUE);
- g_object_set_data_full(G_OBJECT(menu->menubar),
- "insert-screenshot-action", action, g_object_unref);
- g_signal_connect(G_OBJECT(action), "activate",
- G_CALLBACK(scrncap_convwin_menu_cb), win);
- conv_insert_image = gtk_ui_manager_get_widget(menu->ui,
- "/Conversation/ConversationMenu/InsertImage");
- g_return_if_fail(conv_insert_image != NULL);
- conv_submenu = gtk_widget_get_parent(conv_insert_image);
- children = gtk_container_get_children(GTK_CONTAINER(conv_submenu));
- pos = g_list_index(children, conv_insert_image);
- g_warn_if_fail(pos >= 0);
- scrncap_btn_menu = gtk_action_create_menu_item(action);
- g_object_set_data(G_OBJECT(menu->menubar), "insert-screenshot-btn",
- gtk_menu_shell_insert(GTK_MENU_SHELL(conv_submenu),
- GTK_WIDGET(scrncap_btn_menu), pos);
- gtk_widget_show(GTK_WIDGET(scrncap_btn_menu));
- g_signal_connect_after(G_OBJECT(win->notebook), "switch-page",
- G_CALLBACK(scrncap_convwin_switch), win);
- scrncap_convwin_switch(GTK_NOTEBOOK(win->notebook), NULL, 0, win);
-scrncap_convwin_uninit(PidginConvWindow *win)
- PidginConvWindowMenu *menu = win->menu;
- btn = g_object_get_data(G_OBJECT(menu->menubar),
- "insert-screenshot-btn");
- gtk_widget_destroy(btn);
- g_object_set_data(G_OBJECT(menu->menubar),
- "insert-screenshot-btn", NULL);
- g_object_set_data(G_OBJECT(menu->menubar),
- "insert-screenshot-action", NULL);
- g_signal_handlers_disconnect_matched(win->notebook, G_SIGNAL_MATCH_FUNC,
- 0, 0, NULL, scrncap_convwin_switch, NULL);
-scrncap_conversation_update(PidginWebView *webview,
- PidginWebViewButtons buttons, gpointer _action)
- GtkAction *action = GTK_ACTION(_action);
- gtk_action_set_sensitive(action, buttons & PIDGIN_WEBVIEW_IMAGE);
-scrncap_conversation_init(PidginConversation *gtkconv)
- PidginWebView *webview;
- PidginWebViewToolbar *toolbar;
- GtkToolItem *scrncap_btn_wide;
- GtkWidget *scrncap_btn_lean;
- GtkToolbar *wide_view, *lean_view;
- GtkMenu *wide_menu = NULL;
- GList *wide_children, *it;
- if (scrncap_conv_get_data(gtkconv, "scrncap-btn-wide") != NULL)
- webview = PIDGIN_WEBVIEW(gtkconv->entry);
- toolbar = PIDGIN_WEBVIEWTOOLBAR(pidgin_webview_get_toolbar(webview));
- g_return_if_fail(toolbar != NULL);
- wide_view = GTK_TOOLBAR(pidgin_webviewtoolbar_get_wide_view(toolbar));
- g_return_if_fail(wide_view != NULL);
- lean_view = GTK_TOOLBAR(pidgin_webviewtoolbar_get_lean_view(toolbar));
- g_return_if_fail(lean_view != NULL);
- action = gtk_action_new("InsertScreenshot", _("_Screenshot"),
- _("Insert screenshot"), PIDGIN_ICON_CAMERA_PHOTO);
- gtk_action_set_is_important(action, TRUE);
- g_signal_connect(G_OBJECT(action), "activate",
- G_CALLBACK(scrncap_do_screenshot), webview);
- scrncap_btn_wide = GTK_TOOL_ITEM(gtk_action_create_tool_item(action));
- scrncap_conv_set_data(gtkconv, "scrncap-btn-wide", scrncap_btn_wide);
- for (i = 0; i < gtk_toolbar_get_n_items(wide_view); i++) {
- GtkToolItem *ref_item = gtk_toolbar_get_nth_item(wide_view, i);
- action = g_object_get_data(G_OBJECT(ref_item), "action");
- if (g_strcmp0(gtk_action_get_name(action), "InsertImage") == 0) {
- gtk_toolbar_insert(wide_view, scrncap_btn_wide, pos);
- gtk_widget_show(GTK_WIDGET(scrncap_btn_wide));
- for (i = 0; i < gtk_toolbar_get_n_items(lean_view); i++) {
- GtkToolItem *ref_item = gtk_toolbar_get_nth_item(lean_view, i);
- const gchar *menu_name;
- menu_name = g_object_get_data(G_OBJECT(ref_item), "menu-name");
- if (g_strcmp0(menu_name, "insert") == 0) {
- wide_menu = g_object_get_data(G_OBJECT(ref_item), "menu");
- g_return_if_fail(wide_menu);
- wide_children = gtk_container_get_children(GTK_CONTAINER(wide_menu));
- for (it = wide_children, i = 0; it; it = g_list_next(it), i++) {
- GtkWidget *child = it->data;
- action = g_object_get_data(G_OBJECT(child), "action");
- if (g_strcmp0(gtk_action_get_name(action), "InsertImage") == 0) {
- g_list_free(wide_children);
- g_warn_if_fail(pos >= 0);
- g_signal_connect_object(G_OBJECT(webview), "allowed-formats-updated",
- G_CALLBACK(scrncap_conversation_update), action, 0);
- scrncap_conversation_update(webview,
- pidgin_webview_get_format_functions(webview), action);
- scrncap_btn_lean = gtk_action_create_menu_item(action);
- scrncap_conv_set_data(gtkconv, "scrncap-btn-lean", scrncap_btn_lean);
- gtk_menu_shell_insert(GTK_MENU_SHELL(wide_menu),
- GTK_WIDGET(scrncap_btn_lean), pos);
- gtk_widget_show(GTK_WIDGET(scrncap_btn_lean));
-scrncap_conversation_uninit(PidginConversation *gtkconv)
- GtkWidget *scrncap_btn_wide, *scrncap_btn_lean;
- scrncap_btn_wide = scrncap_conv_get_data(gtkconv, "scrncap-btn-wide");
- if (scrncap_btn_wide == NULL)
- scrncap_btn_lean = scrncap_conv_get_data(gtkconv, "scrncap-btn-lean");
- gtk_widget_destroy(scrncap_btn_wide);
- gtk_widget_destroy(scrncap_btn_lean);
- scrncap_conv_set_data(gtkconv, "scrncap-btn-wide", NULL);
- scrncap_conv_set_data(gtkconv, "scrncap-btn-lean", NULL);
-/******************************************************************************
- ******************************************************************************/
-static PidginPluginInfo *
-plugin_query(GError **error)
- const gchar * const authors[] = {
- "Tomasz Wasilczyk <twasilczyk@pidgin.im>",
- return pidgin_plugin_info_new(
- "name", N_("Screen Capture"),
- "version", DISPLAY_VERSION,
- "category", N_("Utility"),
- "summary", N_("Send screenshots to your buddies."),
- "description", N_("Adds an option to send a screenshot as an inline "
- "image. It works only with protocols that supports "
- "website", PURPLE_WEBSITE,
- "abi-version", PURPLE_ABI_VERSION,
-plugin_load(PurplePlugin *plugin, GError **error)
- const gchar *color_str;
- purple_prefs_add_none("/plugins");
- purple_prefs_add_none("/plugins/gtk");
- purple_prefs_add_none("/plugins/gtk/screencap");
- purple_prefs_add_string("/plugins/gtk/screencap/brush_color",
- SCRNCAP_DEFAULT_COLOR);
- color_str = purple_prefs_get_string("/plugins/gtk/screencap/brush_color");
- if (color_str && color_str[0])
- gdk_rgba_parse(&brush_color, color_str);
- purple_signal_connect(pidgin_conversations_get_handle(),
- "conversation-displayed", plugin,
- PURPLE_CALLBACK(scrncap_conversation_init), NULL);
- purple_signal_connect(pidgin_conversations_get_handle(),
- "conversation-window-created", plugin,
- PURPLE_CALLBACK(scrncap_convwin_init), NULL);
- it = purple_conversations_get_all();
- for (; it; it = g_list_next(it)) {
- PurpleConversation *conv = it->data;
- if (!PIDGIN_IS_PIDGIN_CONVERSATION(conv))
- scrncap_conversation_init(PIDGIN_CONVERSATION(conv));
- it = pidgin_conv_windows_get_list();
- for (; it; it = g_list_next(it)) {
- PidginConvWindow *win = it->data;
- scrncap_convwin_init(win);
-plugin_unload(PurplePlugin *plugin, GError **error)
- if (shooting_timeout > 0)
- g_source_remove(shooting_timeout);
- if (current_window != NULL)
- gtk_widget_destroy(GTK_WIDGET(current_window));
- it = purple_conversations_get_all();
- for (; it; it = g_list_next(it)) {
- PurpleConversation *conv = it->data;
- if (!PIDGIN_IS_PIDGIN_CONVERSATION(conv))
- scrncap_conversation_uninit(PIDGIN_CONVERSATION(conv));
- it = pidgin_conv_windows_get_list();
- for (; it; it = g_list_next(it)) {
- PidginConvWindow *win = it->data;
- scrncap_convwin_uninit(win);
-PURPLE_PLUGIN_INIT(screencap, plugin_query, plugin_load, plugin_unload);
--- a/po/POTFILES.in Wed Nov 04 02:41:46 2020 -0600
+++ b/po/POTFILES.in Wed Nov 04 03:24:02 2020 -0600
@@ -67,10 +67,6 @@
libpurple/plugins/autoaccept.c
libpurple/plugins/buddynote.c
-libpurple/plugins/codeinline.c
-libpurple/plugins/debug_example.c
-libpurple/plugins/filectl.c
-libpurple/plugins/helloworld.c
libpurple/plugins/joinpart.c
libpurple/plugins/keyrings/internalkeyring.c
@@ -78,15 +74,9 @@
libpurple/plugins/keyrings/secretservice.c
libpurple/plugins/keyrings/wincred.c
libpurple/plugins/log_reader.c
-libpurple/plugins/notify_example.c
libpurple/plugins/offlinemsg.c
-libpurple/plugins/one_time_password.c
-libpurple/plugins/pluginpref_example.c
libpurple/plugins/psychic.c
-libpurple/plugins/signals-test.c
-libpurple/plugins/simple.c
libpurple/plugins/statenotify.c
-libpurple/plugins/test-request-input.c
@@ -364,7 +354,6 @@
-pidgin/plugins/contact_priority.c
pidgin/plugins/disco/gtkdisco.c
pidgin/plugins/disco/xmppdisco.c
pidgin/plugins/disco/resources/disco.ui
@@ -372,16 +361,9 @@
pidgin/plugins/gestures/stroke.c
pidgin/plugins/gestures/stroke-draw.c
pidgin/plugins/gtkbuddynote.c
-pidgin/plugins/gtk-signals-test.c
-pidgin/plugins/history.c
pidgin/plugins/iconaway.c
-pidgin/plugins/imgupload.c
-pidgin/plugins/mailchk.c
-pidgin/plugins/musicmessaging/musicmessaging.c
-pidgin/plugins/pidgininc.c
-pidgin/plugins/screencap.c
pidgin/plugins/spellchk.c
pidgin/plugins/transparency.c