Merged pidgin/main into default
--- a/doc/reference/libpurple/libpurple-docs.xml Wed Nov 22 14:33:46 2017 +0300
+++ b/doc/reference/libpurple/libpurple-docs.xml Tue Dec 26 10:54:14 2017 +0300
@@ -58,6 +58,7 @@
<xi:include href="xml/nat-pmp.xml" />
<xi:include href="xml/network.xml" />
<xi:include href="xml/notify.xml" />
+ <xi:include href="xml/options.xml" /> <xi:include href="xml/plugins.xml" />
<xi:include href="xml/prefs.xml" />
<xi:include href="xml/pluginpref.xml" />
--- a/finch/gntblist.c Wed Nov 22 14:33:46 2017 +0300
+++ b/finch/gntblist.c Tue Dec 26 10:54:14 2017 +0300
@@ -127,10 +127,6 @@
static void add_chat(PurpleChat *chat, FinchBlist *ggblist);
static void add_node(PurpleBlistNode *node, FinchBlist *ggblist);
static void node_update(PurpleBuddyList *list, PurpleBlistNode *node);
-static gboolean is_contact_online(PurpleContact *contact);
-static gboolean is_group_online(PurpleGroup *group);
static void draw_tooltip(FinchBlist *ggblist);
static void tooltip_for_buddy(PurpleBuddy *buddy, GString *str, gboolean full);
static gboolean remove_typing_cb(gpointer null);
@@ -385,27 +381,6 @@
fnode = purple_blist_node_get_ui_data(node);
if (fnode && fnode->signed_timer)
flag |= GNT_TEXT_FLAG_BLINK;
- } else if (PURPLE_IS_GROUP(node)) {
- /* If the node is collapsed, then check to see if any of the priority buddies of
- * any of the contacts within this group recently signed on/off, and set the blink
- * flag appropriately. */
- /* XXX: there's no way I can ask if the node is expanded or not? *sigh*
- * API addition would be necessary */
- if (!gnt_tree_get_expanded(GNT_TREE(ggblist->tree), node)) {
- for (node = purple_blist_node_get_first_child(node); node;
- node = purple_blist_node_get_sibling_next(node)) {
- PurpleBlistNode *pnode;
- pnode = purple_contact_get_priority_buddy((PurpleContact*)node);
- fnode = purple_blist_node_get_ui_data(node);
- if (fnode && fnode->signed_timer) {
- flag |= GNT_TEXT_FLAG_BLINK;
@@ -418,37 +393,6 @@
gnt_tree_set_row_color(GNT_TREE(ggblist->tree), node, get_display_color(node));
-is_contact_online(PurpleContact *contact)
- for (node = purple_blist_node_get_first_child(((PurpleBlistNode*)contact)); node;
- node = purple_blist_node_get_sibling_next(node)) {
- FinchBlistNode *fnode = purple_blist_node_get_ui_data(node);
- if (PURPLE_BUDDY_IS_ONLINE((PurpleBuddy*)node) ||
- (fnode && fnode->signed_timer))
-is_group_online(PurpleGroup *group)
- for (node = purple_blist_node_get_first_child(((PurpleBlistNode*)group)); node;
- node = purple_blist_node_get_sibling_next(node)) {
- if (PURPLE_IS_CHAT(node) &&
- purple_account_is_connected(((PurpleChat *)node)->account))
- else if (is_contact_online((PurpleContact*)node))
new_node(PurpleBlistNode *node)
@@ -999,20 +943,6 @@
blist_update_row_flags((PurpleBlistNode*)contact);
-buddy_signed_on(PurpleBuddy *buddy, FinchBlist *ggblist)
- add_node((PurpleBlistNode*)buddy, ggblist);
-buddy_signed_off(PurpleBuddy *buddy, FinchBlist *ggblist)
- node_remove(purple_blist_get_buddy_list(), (PurpleBlistNode*)buddy);
PurpleBlistUiOps *finch_blist_get_ui_ops()
@@ -3127,17 +3057,6 @@
purple_signal_connect(purple_blist_get_handle(), "buddy-signed-off", finch_blist_get_handle(),
PURPLE_CALLBACK(buddy_signed_on_off), ggblist);
- /* These I plan to use to indicate unread-messages etc. */
- purple_signal_connect(purple_conversations_get_handle(), "received-im-msg", finch_blist_get_handle(),
- PURPLE_CALLBACK(received_im_msg), list);
- purple_signal_connect(purple_conversations_get_handle(), "sent-im-msg", finch_blist_get_handle(),
- PURPLE_CALLBACK(sent_im_msg), NULL);
- purple_signal_connect(purple_conversations_get_handle(), "received-chat-msg", finch_blist_get_handle(),
- PURPLE_CALLBACK(received_chat_msg), list);
g_signal_connect(G_OBJECT(ggblist->tree), "selection_changed", G_CALLBACK(selection_changed), ggblist);
g_signal_connect(G_OBJECT(ggblist->tree), "key_pressed", G_CALLBACK(key_pressed), ggblist);
g_signal_connect(G_OBJECT(ggblist->tree), "context-menu", G_CALLBACK(context_menu), ggblist);
--- a/finch/gntplugin.c Wed Nov 22 14:33:46 2017 +0300
+++ b/finch/gntplugin.c Tue Dec 26 10:54:14 2017 +0300
@@ -446,95 +446,6 @@
-install_selected_file_cb(gpointer handle, const char *filename)
- /* Try to init the selected file.
- * If it succeeds, try to make a copy of the file in $USERDIR/plugins/.
- * If the copy succeeds, unload and destroy the plugin in the original
- * location and init+load the new one.
- * Select the plugin in the plugin list.
- g_return_if_fail(plugins.window);
- plugin = purple_plugin_probe(filename);
- purple_notify_error(handle, _("Error loading plugin"),
- _("The selected file is not a valid plugin."),
- _("Please open the debug window and try again to see the exact error message."), NULL);
- if (g_list_find(gnt_tree_get_rows(GNT_TREE(plugins.tree)), plugin)) {
- purple_plugin_load(plugin);
- gnt_tree_set_choice(GNT_TREE(plugins.tree), plugin, purple_plugin_is_loaded(plugin));
- gnt_tree_set_selected(GNT_TREE(plugins.tree), plugin);
- path = g_build_filename(purple_user_dir(), "plugins", NULL);
- if (purple_build_dir(path, S_IRUSR | S_IWUSR | S_IXUSR) == 0) {
- if (g_file_get_contents(filename, &content, &length, NULL)) {
- char *file = g_path_get_basename(filename);
- path = g_build_filename(purple_user_dir(), "plugins", file, NULL);
- if (purple_util_write_data_to_file_absolute(path, content, length)) {
- purple_plugin_destroy(plugin);
- plugin = purple_plugin_probe(path);
- purple_debug_warning("gntplugin", "This is really strange. %s can be loaded, but %s can't!\n",
- plugin = purple_plugin_probe(filename);
- purple_plugin_load(plugin);
- if (plugin->info->type == PURPLE_PLUGIN_LOADER) {
- for (cur = PURPLE_PLUGIN_LOADER_INFO(plugin)->exts; cur != NULL;
- purple_plugins_probe(cur->data);
- if (plugin->info->type != PURPLE_PLUGIN_STANDARD ||
- (plugin->info->flags & PURPLE_PLUGIN_FLAG_INVISIBLE) ||
- gnt_tree_add_choice(GNT_TREE(plugins.tree), plugin,
- gnt_tree_create_row(GNT_TREE(plugins.tree), plugin->info->name), NULL, NULL);
- gnt_tree_set_choice(GNT_TREE(plugins.tree), plugin, purple_plugin_is_loaded(plugin));
- gnt_tree_set_row_flags(GNT_TREE(plugins.tree), plugin, GNT_TEXT_FLAG_BOLD);
- gnt_tree_set_selected(GNT_TREE(plugins.tree), plugin);
-install_plugin_cb(GntWidget *w, gpointer null)
- purple_request_close_with_handle(&handle);
- purple_request_file(&handle, _("Select plugin to install"), NULL,
- FALSE, G_CALLBACK(install_selected_file_cb), NULL,
- g_signal_connect_swapped(G_OBJECT(w), "destroy", G_CALLBACK(purple_request_close_with_handle), &handle);
void finch_plugins_show_all(void)
GntWidget *window, *tree, *box, *aboot, *button;
@@ -603,13 +514,6 @@
box = gnt_hbox_new(FALSE);
gnt_box_add_widget(GNT_BOX(window), box);
- button = gnt_button_new(_("Install Plugin..."));
- gnt_box_add_widget(GNT_BOX(box), button);
- gnt_util_set_trigger_widget(GNT_WIDGET(tree), GNT_KEY_INS, button);
- g_signal_connect(G_OBJECT(button), "activate", G_CALLBACK(install_plugin_cb), NULL);
button = gnt_button_new(_("Close"));
gnt_box_add_widget(GNT_BOX(box), button);
g_signal_connect_swapped(G_OBJECT(button), "activate",
--- a/finch/libfinch.c Wed Nov 22 14:33:46 2017 +0300
+++ b/finch/libfinch.c Tue Dec 26 10:54:14 2017 +0300
@@ -29,6 +29,7 @@
@@ -146,9 +147,6 @@
G_OPTION_ARG_FILENAME, &opt_config_dir_arg,
_("use DIR for config files"), _("DIR")},
- G_OPTION_ARG_NONE, &debug_enabled,
- _("print debugging messages to stderr"), NULL},
G_OPTION_ARG_NONE, &opt_nologin,
_("don't automatically login"), NULL},
@@ -170,6 +168,9 @@
g_option_context_set_summary(context, DISPLAY_VERSION);
g_option_context_add_main_entries(context, option_entries, PACKAGE);
+ g_option_context_add_group(context, purple_get_option_group()); + g_option_context_add_group(context, gplugin_get_option_group()); /* Handle Unicode filenames on Windows. See GOptionContext docs. */
args = g_win32_get_command_line();
--- a/finch/libgnt/gntfilesel.c Wed Nov 22 14:33:46 2017 +0300
+++ b/finch/libgnt/gntfilesel.c Tue Dec 26 10:54:14 2017 +0300
@@ -38,10 +38,6 @@
@@ -281,12 +277,7 @@
if (strcmp(key, "\r") && strcmp(key, "\n"))
@@ -309,39 +300,9 @@
- /* XXX: there needs to be a way to allow other methods for globbing,
- * like the read_fn stuff. */
- glob_ret = glob(path, GLOB_MARK, NULL, &gl);
- if (!glob_ret) { /* XXX: do something with the return value */
- char *loc = g_path_get_dirname(gl.gl_pathv[0]);
- g_stat(gl.gl_pathv[0], &st);
- gnt_file_sel_set_current_location(sel, loc); /* XXX: check the return value */
- if (!S_ISDIR(st.st_mode) && !sel->dirsonly) {
- gnt_tree_remove_all(GNT_TREE(sel->files));
- for (count = 0; count < gl.gl_pathc; count++) {
- char *tmp = process_path(gl.gl_pathv[count]);
- loc = g_path_get_dirname(tmp);
- if (g_utf8_collate(sel->current, loc) == 0) {
- char *base = g_path_get_basename(tmp);
- snprintf(size, sizeof(size), "%ld", (long)st.st_size);
- gnt_tree_add_row_after(GNT_TREE(sel->files), base,
- gnt_tree_create_row(GNT_TREE(sel->files), base, size, ""), NULL, NULL);
- gnt_widget_draw(sel->files);
- } else if (sel->files) {
- gnt_tree_remove_all(GNT_TREE(sel->files));
- gnt_widget_draw(sel->files);
+ /* XXX: Add support for globbing via g_pattern_spec_* */ --- a/finch/libgnt/gntmain.c Wed Nov 22 14:33:46 2017 +0300
+++ b/finch/libgnt/gntmain.c Tue Dec 26 10:54:14 2017 +0300
@@ -340,12 +340,6 @@
- gnt_warning("a key: [%s] %#x %#x %#x %#x %#x %#x", keys,
- (guchar)keys[0], (guchar)keys[1], (guchar)keys[2],
- (guchar)keys[3], (guchar)keys[4], (guchar)keys[5]);
/* TODO: we could call detect_mouse_action here, but no
* events are triggered (yet?) for mouse on win32.
@@ -395,17 +389,6 @@
if (mouse_enabled && detect_mouse_action(k))
- /* I am not sure what's happening here. If this actually does something,
- * then this needs to go in gnt_keys_refine. */
- if (*k < 0) { /* Alt not sending ESC* */
@@ -450,12 +433,6 @@
g_io_channel_set_close_on_unref(channel, TRUE);
- g_io_channel_set_encoding(channel, NULL, NULL);
- g_io_channel_set_buffered(channel, FALSE);
- g_io_channel_set_flags(channel, G_IO_FLAG_NONBLOCK, NULL );
channel_read_callback = result = g_io_add_watch_full(channel, G_PRIORITY_HIGH,
(G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_PRI),
@@ -465,10 +442,6 @@
io_invoke_error, GINT_TO_POINTER(result), NULL);
g_io_channel_unref(channel);
- gnt_warning("setting up IO (%d)", channel_read_callback);
--- a/finch/libgnt/gntmenuitem.c Wed Nov 22 14:33:46 2017 +0300
+++ b/finch/libgnt/gntmenuitem.c Tue Dec 26 10:54:14 2017 +0300
@@ -65,13 +65,8 @@
gnt_menuitem_init(GTypeInstance *instance, gpointer klass)
GntMenuItem *item = GNT_MENU_ITEM(instance);
- GntMenuItemPriv *priv = &item->priv;
/******************************************************************************
@@ -167,13 +162,7 @@
gnt_menuitem_set_visible(GntMenuItem *item, gboolean visible)
- GntMenuItemPriv *priv = &item->priv;
- priv->visible = visible;
@@ -181,11 +170,7 @@
g_return_val_if_fail(GNT_IS_MENU_ITEM(item), FALSE);
- return item->priv.visible;
--- a/finch/libgnt/gntwidget.c Wed Nov 22 14:33:46 2017 +0300
+++ b/finch/libgnt/gntwidget.c Tue Dec 26 10:54:14 2017 +0300
@@ -322,42 +322,8 @@
if (widget->window == NULL)
- int x, y, maxx, maxy, w, h;
- gboolean shadow = TRUE;
- if (!gnt_widget_has_shadow(widget))
- w = oldw = widget->priv.width + shadow;
- h = oldh = widget->priv.height + shadow;
- getmaxyx(stdscr, maxy, maxx);
- maxy -= 1; /* room for the taskbar */
+ widget->window = newpad(widget->priv.height + 20, widget->priv.width + 20);
- if (w != oldw || h != oldh) {
- widget->priv.width = w - shadow;
- widget->priv.height = h - shadow;
- g_signal_emit(widget, signals[SIG_SIZE_CHANGED], 0, oldw, oldh);
- widget->window = newpad(widget->priv.height + 20, widget->priv.width + 20); /* XXX: */
@@ -403,11 +369,6 @@
g_signal_emit(widget, signals[SIG_HIDE], 0);
wbkgdset(widget->window, '\0' | gnt_color_pair(GNT_COLOR_NORMAL));
- /* XXX: I have no clue why, but this seemed to be necessary. */
- if (gnt_widget_has_shadow(widget))
- mvwvline(widget->window, 1, widget->priv.width, ' ', widget->priv.height);
gnt_screen_release(widget);
GNT_WIDGET_SET_FLAGS(widget, GNT_WIDGET_INVISIBLE);
GNT_WIDGET_UNSET_FLAGS(widget, GNT_WIDGET_MAPPED);
--- a/finch/libgnt/test.c Wed Nov 22 14:33:46 2017 +0300
+++ b/finch/libgnt/test.c Tue Dec 26 10:54:14 2017 +0300
@@ -16,25 +16,6 @@
gnt_box_set_title(GNT_BOX(box), "This is a test");
- gnt_widget_set_focus(w, TRUE);
- /* XXX: This is to just test stuff */
- if (strcmp(text+1, GNT_KEY_LEFT) == 0 && w->priv.x)
- else if (strcmp(text+1, GNT_KEY_RIGHT) == 0)
- else if (strcmp(text+1, GNT_KEY_UP) == 0 && w->priv.y)
- else if (strcmp(text+1, GNT_KEY_DOWN) == 0)
@@ -57,11 +38,7 @@
g_return_val_if_fail(GNT_IS_TREE(tree), FALSE);
gnt_tree_scroll(GNT_TREE(tree), 1);
- /*wscrl(tree->window, 1);*/
- /*box(tree->window, ACS_VLINE, ACS_HLINE);*/
- /*wrefresh(tree->window);*/
@@ -90,7 +67,6 @@
gnt_box_add_widget(GNT_BOX(vbox), widget2);
gnt_box_add_widget(GNT_BOX(hbox), label);
- /*gnt_box_add_widget(GNT_BOX(hbox), vbox);*/
gnt_box_add_widget(GNT_BOX(hbox), gnt_entry_new("a"));
@@ -106,18 +82,12 @@
GNT_WIDGET_UNSET_FLAGS(hbox, GNT_WIDGET_NO_BORDER | GNT_WIDGET_NO_SHADOW);
gnt_box_set_title(GNT_BOX(hbox), "111111111111111111111111111111111111111111111111111111111111111This is the title …");
- /*gnt_widget_set_take_focus(vbox, TRUE);*/
- /*gnt_widget_set_take_focus(hbox, TRUE);*/
- /*gnt_widget_set_position(hbox, 10, 10);*/
g_signal_connect(hbox, "key_pressed", G_CALLBACK(key_pressed), tree);
g_signal_connect(widget, "activate", G_CALLBACK(button1), hbox);
g_signal_connect(widget2, "activate", G_CALLBACK(button2), hbox);
- /*g_timeout_add(1000, (GSourceFunc)w_scroll, tree);*/
--- a/libpurple/conversationtypes.c Wed Nov 22 14:33:46 2017 +0300
+++ b/libpurple/conversationtypes.c Tue Dec 26 10:54:14 2017 +0300
@@ -806,14 +806,6 @@
- PurpleAccount *account = purple_conversation_get_account(conv);
- /* XXX: this should not be necessary */
- if (purple_strequal(purple_normalize(account, who), priv->nick)) {
- flags |= PURPLE_MESSAGE_SEND;
flags = purple_message_get_flags(msg);
if (flags & PURPLE_MESSAGE_RECV) {
if (purple_utf8_has_word(purple_message_get_contents(msg), priv->nick)) {
@@ -1455,36 +1447,11 @@
int chat_id = purple_chat_conversation_get_id(chat);
- * This is unfortunately necessary, because calling
- * purple_serv_chat_leave() calls this purple_conversation_destroy(),
- * which leads to two calls here.. We can't just return after
- * this, because then it'll return on the next pass. So, since
- * purple_serv_got_chat_left(), which is eventually called from the
- * protocol that purple_serv_chat_leave() calls, removes this conversation
- * from the gc's buddy_chats list, we're going to check to see
- * if this exists in the list. If so, we want to return after
- * calling this, because it'll be called again. If not, fall
- * through, because it'll have already been removed, and we'd
- * Long paragraph. <-- Short sentence.
- if (gc && g_slist_find(gc->buddy_chats, conv) != NULL) {
- purple_serv_chat_leave(gc, chat_id);
- * Instead of all of that, lets just close the window when
- * the user tells us to, and let the protocol deal with the
- * internals on it's own time. Don't do this if the protocol already
- * knows it left the chat.
+ * Close the window when the user tells us to, and let the protocol + * deal with the internals on it's own time. Don't do this if the + * protocol already knows it left the chat. if (!purple_chat_conversation_has_left(chat))
purple_serv_chat_leave(gc, chat_id);
--- a/libpurple/dbus-server.c Wed Nov 22 14:33:46 2017 +0300
+++ b/libpurple/dbus-server.c Tue Dec 26 10:54:14 2017 +0300
@@ -691,13 +691,7 @@
- if (purple_value_is_outgoing(purple_values[i]))
- ptr = my_arg(gpointer);
- g_return_val_if_fail(ptr, TRUE);
@@ -768,13 +762,8 @@
-#if 0 /* this is noisy with no dbus connection */
- g_return_if_fail(purple_dbus_connection);
if (purple_dbus_connection == NULL)
* The test below is a hack that prevents our "dbus-method-called"
--- a/libpurple/http.c Wed Nov 22 14:33:46 2017 +0300
+++ b/libpurple/http.c Tue Dec 26 10:54:14 2017 +0300
@@ -236,11 +236,6 @@
guint16 host_len1; /* host string length */
guint16 host_len2; /* host string length */
guint32 host_off; /* host string offset (always 0x00000020) */
- guint8 host[*]; /* host string (ASCII) */
- guint8 dom[*]; /* domain string (ASCII) */
static time_t purple_http_rfc1123_to_time(const gchar *str);
--- a/libpurple/log.c Wed Nov 22 14:33:46 2017 +0300
+++ b/libpurple/log.c Tue Dec 26 10:54:14 2017 +0300
@@ -364,19 +364,6 @@
PurpleLogLogger *purple_log_logger_new(const char *id, const char *name, int functions, ...)
- void(*create)(PurpleLog *),
- gsize(*write)(PurpleLog *, PurpleMessageFlags, const char *, GDateTime *, const char *),
- void(*finalize)(PurpleLog *),
- GList*(*list)(PurpleLogType type, const char*, PurpleAccount*),
- char*(*read)(PurpleLog*, PurpleLogReadFlags*),
- int(*size)(PurpleLog*),
- int(*total_size)(PurpleLogType type, const char *name, PurpleAccount *account),
- GList*(*list_syslog)(PurpleAccount *account),
- void(*get_log_sets)(PurpleLogSetCallback cb, GHashTable *sets),
- gboolean(*remove)(PurpleLog *log),
- gboolean(*is_deletable)(PurpleLog *log))
--- a/libpurple/media.c Wed Nov 22 14:33:46 2017 +0300
+++ b/libpurple/media.c Tue Dec 26 10:54:14 2017 +0300
@@ -499,15 +499,6 @@
g_hash_table_insert(media->priv->sessions, g_strdup(session->id), session);
-purple_media_remove_session(PurpleMedia *media, PurpleMediaSession *session)
- g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE);
- return g_hash_table_remove(media->priv->sessions, session->id);
static PurpleMediaStream *
purple_media_insert_stream(PurpleMediaSession *session,
const gchar *name, gboolean initiator)
--- a/libpurple/meson.build Wed Nov 22 14:33:46 2017 +0300
+++ b/libpurple/meson.build Tue Dec 26 10:54:14 2017 +0300
@@ -39,6 +39,7 @@
@@ -118,6 +119,7 @@
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/libpurple/options.c Tue Dec 26 10:54:14 2017 +0300
@@ -0,0 +1,96 @@
+ * 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 +/****************************************************************************** + *****************************************************************************/ +debug_cb(const gchar *option_name, const gchar *value, + gpointer data, GError **error) + purple_debug_set_enabled(TRUE); + if (purple_strequal(value, "colored")) { + purple_debug_set_colored(TRUE); +force_online_cb(const gchar *option_name, const gchar *value, + gpointer data, GError **error) + purple_network_force_online(); +/****************************************************************************** + *****************************************************************************/ + * purple_get_option_group: + * Returns a #GOptionGroup for the commandline arguments recognized by + * LibPurple. You should add this option group to your #GOptionContext with + * g_option_context_add_group(), if you are using g_option_context_parse() to + * parse your commandline arguments. + * Return Value: (transfer full): a #GOptionGroup for the commandline arguments + * recognized by LibPurple. +purple_get_option_group(void) { + GOptionGroup *group = NULL; + GOptionEntry entries[] = { + "debug", 'd', G_OPTION_FLAG_OPTIONAL_ARG, + G_OPTION_ARG_CALLBACK, &debug_cb, + _("print debugging messages to stdout"), + "force-online", 'f', 0, + G_OPTION_ARG_NONE, &force_online_cb, + _("force online, regardless of network status"), + group = g_option_group_new( + _("LibPurple options"), + _("Show LibPurple Options"), + g_option_group_add_entries(group, entries); --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/libpurple/options.h Tue Dec 26 10:54:14 2017 +0300
@@ -0,0 +1,42 @@
+ * 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 +#ifndef PURPLE_OPTIONS_H +#define PURPLE_OPTIONS_H + * @section_id: libpurple-options + * @short_description: <filename>options.h</filename> + * The functions defined here are to help in handling command line options. +GOptionGroup *purple_get_option_group(void); +#endif /* PURPLE_OPTIONS_H */ --- a/libpurple/plugins/filectl.c Wed Nov 22 14:33:46 2017 +0300
+++ b/libpurple/plugins/filectl.c Tue Dec 26 10:54:14 2017 +0300
@@ -86,27 +86,6 @@
-/* purple_find_conversation() is gone in 2.0.0. */
- } else if (!g_ascii_strncasecmp(command, "send", 4)) {
- PurpleConversation *conv;
- arg1 = getarg(buffer, 1, 0);
- arg2 = getarg(buffer, 2, 1);
- conv = purple_find_conversation(PURPLE_CONV_TYPE_ANY, arg1);
- purple_conversation_write(conv, arg2, WFLAG_SEND, NULL, time(NULL), -1);
- purple_serv_send_im(conv->gc, arg1, arg2, 0);
} else if (!g_ascii_strncasecmp(command, "away", 4)) {
arg1 = getarg(buffer, 1, 1);
/* serv_set_away_all(arg1); */
--- a/libpurple/plugins/log_reader.c Wed Nov 22 14:33:46 2017 +0300
+++ b/libpurple/plugins/log_reader.c Tue Dec 26 10:54:14 2017 +0300
@@ -2444,35 +2444,6 @@
/* Read talk.ini file to find the log directory. */
-#if 0 /* FIXME: Not tested yet. */
- purple_debug_info("Trillian talk.ini read", "Reading %s\n", path);
- if (!g_key_file_load_from_file(key_file, path, G_KEY_FILE_NONE, GError &error)) {
- purple_debug_error("Trillian talk.ini read",
- "Error reading talk.ini\n");
- char *logdir = g_key_file_get_string(key_file, "Logging", "Directory", &error);
- purple_debug_error("Trillian talk.ini read",
- "Error reading Directory value from Logging section\n");
- purple_prefs_add_string("/plugins/core/log_reader/trillian/log_directory", logdir);
- g_key_file_free(key_file);
if (g_file_test(path, G_FILE_TEST_IS_REGULAR)) {
@@ -2514,7 +2485,6 @@
--- a/libpurple/stun.c Wed Nov 22 14:33:46 2017 +0300
+++ b/libpurple/stun.c Tue Dec 26 10:54:14 2017 +0300
@@ -63,14 +63,6 @@
- struct stun_header hdr;
- struct stun_attrib attrib;
@@ -150,27 +142,6 @@
-static void do_test2(struct stun_conn *sc) {
- struct stun_change data;
- data.hdr.type = htons(0x0001);
- data.hdr.transid[0] = rand();
- data.hdr.transid[1] = ntohl(((int)'g' << 24) + ((int)'a' << 16) + ((int)'i' << 8) + (int)'m');
- data.hdr.transid[2] = rand();
- data.hdr.transid[3] = rand();
- data.attrib.type = htons(0x003);
- data.attrib.len = htons(4);
- sc->packet = (struct stun_header*)&data;
- sc->packetsize = sizeof(struct stun_change);
- sendto(sc->fd, sc->packet, sc->packetsize, 0, (struct sockaddr *)&(sc->addr), sizeof(struct sockaddr_in));
- sc->timeout = g_timeout_add(500, (GSourceFunc) timeoutfunc, sc);
static void reply_cb(gpointer data, gint source, PurpleInputCondition cond) {
struct stun_conn *sc = data;
--- a/libpurple/tests/test_util.c Wed Nov 22 14:33:46 2017 +0300
+++ b/libpurple/tests/test_util.c Tue Dec 26 10:54:14 2017 +0300
@@ -472,6 +472,10 @@
+ /* U+FFFE (should be stripped) */ @@ -484,20 +488,12 @@
+ /* NULL as input is a valid test, but it's the last test, so we break if(data[i].input == NULL)
- /* disabled because make check fails on an assertion */
- fail_unless(NULL == purple_utf8_strip_unprintables("abc\x80\x7f"));
- /* disabled because make check fails on an assertion */
- /* U+DB80 (Private Use High Surrogate, First) -- should be stripped */
- assert_string_equal_free("aaaa", purple_utf8_strip_unprintables("aaaa\xed\xa0\x80"));
- /* U+FFFE (should be stripped) */
- assert_string_equal_free("aaaa", purple_utf8_strip_unprintables("aaaa\xef\xbf\xbe"));
/******************************************************************************
--- a/libpurple/trie.c Wed Nov 22 14:33:46 2017 +0300
+++ b/libpurple/trie.c Tue Dec 26 10:54:14 2017 +0300
@@ -244,44 +244,6 @@
-purple_trie_print(PurpleTrieState *state, int limit)
- GString *str = g_string_new(NULL);
- return g_strdup("{ LIMIT }");
- g_string_append(str, "*");
- g_string_append(str, "{ ");
- for (i = 0; i < 256; i++) {
- if (!state->children[i])
- g_string_append(str, "(null)->");
- g_string_append_printf(str, "%c->", i);
- if (state->children[i] == state)
- g_string_append(str, "loop");
- chp = purple_trie_print(state->children[i], limit - 1);
- g_string_append(str, chp);
- g_string_append_c(str, ' ');
- g_string_append(str, "}");
- return g_string_free(str, FALSE);
purple_trie_states_build(PurpleTrie *trie)
--- a/libpurple/upnp.h Wed Nov 22 14:33:46 2017 +0300
+++ b/libpurple/upnp.h Tue Dec 26 10:54:14 2017 +0300
@@ -62,19 +62,6 @@
void purple_upnp_discover(PurpleUPnPCallback cb, gpointer cb_data);
- * purple_upnp_get_control_info:
- * Retrieve the current UPnP control info, if there is any available.
- * This will only be filled in if purple_upnp_discover() had been called,
- * and finished discovering.
- * Returns: The control URL for the IGD we'll use to use the IGD services
-const PurpleUPnPControlInfo* purple_upnp_get_control_info(void);
* purple_upnp_get_public_ip:
--- a/libpurple/util.c Wed Nov 22 14:33:46 2017 +0300
+++ b/libpurple/util.c Tue Dec 26 10:54:14 2017 +0300
@@ -2613,13 +2613,6 @@
/* Check for tags which begin CDATA and need to be closed */
-#if 0 /* FIXME.. option is end tag optional, we can't handle this right now */
- else if (g_ascii_strncasecmp(str2 + i, "<option", 7) == 0)
- /* FIXME: We should not do this if the OPTION is SELECT'd */
- cdata_close_tag = "</option>";
else if (g_ascii_strncasecmp(str2 + i, "<script", 7) == 0)
cdata_close_tag = "</script>";
@@ -5226,69 +5219,3 @@
-/* Temporarily removed - re-add this when you need ini file support. */
-#define PURPLE_KEY_FILE_DEFAULT_MAX_SIZE 102400
-#define PURPLE_KEY_FILE_HARD_LIMIT 10485760
-purple_key_file_load_from_ini(GKeyFile *key_file, const gchar *file,
- const gchar *header = "[default]\n\n";
- int header_len = strlen(header);
- gsize file_size, buff_size;
- g_return_val_if_fail(key_file != NULL, FALSE);
- g_return_val_if_fail(file != NULL, FALSE);
- g_return_val_if_fail(max_size < PURPLE_KEY_FILE_HARD_LIMIT, FALSE);
- max_size = PURPLE_KEY_FILE_DEFAULT_MAX_SIZE;
- fd = g_open(file, O_RDONLY, S_IREAD);
- purple_debug_error("util", "Failed to read ini file %s", file);
- if (_purple_fstat(fd, &st) != 0) {
- purple_debug_error("util", "Failed to fstat ini file %s", file);
- file_size = (st.st_size > max_size) ? max_size : st.st_size;
- buff_size = file_size + header_len;
- buff = g_new(gchar, buff_size);
- memcpy(buff, header, header_len);
- if (read(fd, buff + header_len, file_size) != (gssize)file_size) {
- purple_debug_error("util",
- "Failed to read whole ini file %s", file);
- g_key_file_load_from_data(key_file, buff, buff_size,
- G_KEY_FILE_NONE, &error);
- purple_debug_error("util", "Failed parsing ini file %s: %s",
--- a/libpurple/xmlnode.c Wed Nov 22 14:33:46 2017 +0300
+++ b/libpurple/xmlnode.c Tue Dec 26 10:54:14 2017 +0300
@@ -74,19 +74,6 @@
node = new_node(name, PURPLE_XMLNODE_TYPE_TAG);
purple_xmlnode_insert_child(parent, node);
- /* This would give PurpleXmlNodes more appropriate namespacing
- * when creating them. Otherwise, unless an explicit namespace
- * is set, purple_xmlnode_get_namespace() will return NULL, when
- * there may be a default namespace.
- * I'm unconvinced that it's useful, and concerned it may break things.
- * _insert_child would need the same thing, probably (assuming
- purple_xmlnode_set_namespace(node, purple_xmlnode_get_default_namespace(node))
--- a/meson.build Wed Nov 22 14:33:46 2017 +0300
+++ b/meson.build Tue Dec 26 10:54:14 2017 +0300
@@ -864,7 +864,7 @@
DYNAMIC_BONJOUR = DYNAMIC_PRPLS.contains('bonjour')
DYNAMIC_FACEBOOK = DYNAMIC_PRPLS.contains('facebook')
-DYNAMIC_GG = DYNAMIC_PRPLS.contains('gg ')
+DYNAMIC_GG = DYNAMIC_PRPLS.contains('gg') DYNAMIC_IRC = DYNAMIC_PRPLS.contains('irc')
DYNAMIC_JABBER = DYNAMIC_PRPLS.contains('jabber')
DYNAMIC_NOVELL = DYNAMIC_PRPLS.contains('novell')
--- a/pidgin/gtkstyle.h Wed Nov 22 14:33:46 2017 +0300
+++ b/pidgin/gtkstyle.h Tue Dec 26 10:54:14 2017 +0300
@@ -1,8 +1,3 @@
- * @file gtkstyle.h GTK+ Style utility functions
* Pidgin is the legal property of its developers, whose names are too numerous
@@ -23,6 +18,14 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+ * @section_id: pidgin-gtkstyle + * @short_description: <filename>gtkstyle.h</filename> @@ -30,30 +33,27 @@
- * Returns TRUE if dark mode is enabled and foreground colours should be invertred
+ * pidgin_style_is_dark: + * @style: The GtkStyle in use, or NULL to use a cached version. - * @param style The GtkStyle in use, or NULL to use a cached version.
+ * Returns whether or not dark mode is enabled. - * @return @c TRUE if dark mode, @c FALSE otherwise
+ * Returns: TRUE if dark mode is enabled and foreground colours should be invertred gboolean pidgin_style_is_dark(GtkStyle *style);
- * Lighten a color if dark mode is enabled.
+ * pidgin_style_adjust_contrast: + * @style: The GtkStyle in use. + * @color: Color to be lightened. Transformed color will be written here. - * @param style The GtkStyle in use.
- * @param color Color to be lightened. Transformed color will be written here.
+ * Lighten a color if dark mode is enabled. void pidgin_style_adjust_contrast(GtkStyle *style, GdkColor *color);
#endif /* _PIDGINSTYLE_H_ */
--- a/pidgin/libpidgin.c Wed Nov 22 14:33:46 2017 +0300
+++ b/pidgin/libpidgin.c Tue Dec 26 10:54:14 2017 +0300
@@ -33,6 +33,7 @@
@@ -375,25 +376,10 @@
purple_blist_set_visible(TRUE);
-static gboolean debug_colored = FALSE;
-static gboolean debug_enabled = FALSE;
static gboolean opt_login = FALSE;
static gchar *opt_login_arg = NULL;
-debug_opt_arg_func(const gchar *option_name, const gchar *value,
- gpointer data, GError **error)
- if (purple_strequal(value, "colored")) {
login_opt_arg_func(const gchar *option_name, const gchar *value,
gpointer data, GError **error)
@@ -408,7 +394,6 @@
int pidgin_start(int argc, char *argv[])
- gboolean opt_force_online = FALSE;
gboolean opt_nologin = FALSE;
gboolean opt_version = FALSE;
gboolean opt_si = TRUE; /* Check for single instance? */
@@ -441,13 +426,6 @@
G_OPTION_ARG_FILENAME, &opt_config_dir_arg,
_("use DIR for config files"), _("DIR")},
- {"debug", 'd', G_OPTION_FLAG_OPTIONAL_ARG,
- G_OPTION_ARG_CALLBACK, &debug_opt_arg_func,
- _("print debugging messages to stdout"),
- {"force-online", 'f', 0,
- G_OPTION_ARG_NONE, &opt_force_online,
- _("force online, regardless of network status"), NULL},
{"login", 'l', G_OPTION_FLAG_OPTIONAL_ARG,
G_OPTION_ARG_CALLBACK, &login_opt_arg_func,
_("enable specified account(s) (optional argument NAME\n"
@@ -468,11 +446,8 @@
+ purple_debug_set_enabled(TRUE); @@ -594,6 +569,8 @@
g_option_context_add_main_entries(context, option_entries, PACKAGE);
+ g_option_context_add_group(context, purple_get_option_group()); + g_option_context_add_group(context, gplugin_get_option_group()); g_option_context_add_group(context, gtk_get_option_group(TRUE));
@@ -646,11 +623,6 @@
- if (g_getenv("PIDGIN_DEBUG_COLORED") != NULL)
- purple_debug_set_enabled(debug_enabled);
- purple_debug_set_colored(debug_colored);
app = G_APPLICATION(gtk_application_new("im.pidgin.Pidgin",
G_APPLICATION_NON_UNIQUE));
@@ -741,11 +713,6 @@
g_free(opt_config_dir_arg);
opt_config_dir_arg = NULL;
- /* This needs to be before purple_blist_show() so the
- * statusbox gets the forced online status. */
- purple_network_force_online();
* We want to show the blist early in the init process so the
* user feels warm and fuzzy (not cold and prickley).
--- a/po/POTFILES.in Wed Nov 22 14:33:46 2017 +0300
+++ b/po/POTFILES.in Tue Dec 26 10:54:14 2017 +0300
@@ -54,6 +54,7 @@
libpurple/media/backend-fs2.c
libpurple/plugins/autoaccept.c
libpurple/plugins/buddynote.c