# HG changeset patch # User Paul Aurich # Date 1239424487 0 # Node ID d6a863df7884703fe27e6fd8960b9f81ea33a1de # Parent d7bd1431b989750864a8d103a3c203f675dcdb85# Parent d6a31b0ad10903e2ee4dff38e874d09713a458d0 propagate from branch 'im.pidgin.pidgin' (head 079a5ca1aa110ee9f6661eba31e5ea3f0b5a07e7) to branch 'im.pidgin.cpw.darkrain42.xmpp.avatars' (head 120c877c682a4ab854a6b27743504a054b3cef23) diff -r d6a31b0ad109 -r d6a863df7884 COPYRIGHT --- a/COPYRIGHT Sun Apr 05 21:54:03 2009 +0000 +++ b/COPYRIGHT Sat Apr 11 04:34:47 2009 +0000 @@ -333,10 +333,9 @@ Joao Luís Marques Pinto Aleksander Piotrowski Julien Pivotto +Robey Pointer Eric Polino Ari Pollak -Robey Pointer -Eric Polino Stephen Pope Nathan Poznick Jory A. Pratt diff -r d6a31b0ad109 -r d6a863df7884 ChangeLog --- a/ChangeLog Sun Apr 05 21:54:03 2009 +0000 +++ b/ChangeLog Sat Apr 11 04:34:47 2009 +0000 @@ -9,12 +9,15 @@ * Removed the unmaintained and unneeded toc protocol plugin. * Fixed NTLM authentication on big-endian systems. + libpurple: + * Various memory cleanups when unloading libpurple. (Nick Hebner) + XMPP: * Add voice & video support with Jingle (XEP-0166, 0167, 0176, & 0177), and voice support with GTalk and GMail. (Mike "Maiku" Ruprecht) * Add support for in-band bytestreams for file transfers (XEP-0047). - * Add support for sending attentions (equivalent to "buzz" and "nudge") - using the command /buzz (XEP-0224). + * Add support for sending and receiving attentions (equivalent to "buzz" + and "nudge") using the command /buzz (XEP-0224). * A buddy's local time is displayed in the Get Info dialog if the remote client supports it. @@ -40,6 +43,7 @@ Finch: * The hardware cursor is updated correctly. This will be useful especially for users of braille terminals, screen readers etc. + * Added a TinyURL plugin, which aids copying longer URLs. version 2.5.5 (03/01/2009): libpurple: diff -r d6a31b0ad109 -r d6a863df7884 ChangeLog.API --- a/ChangeLog.API Sun Apr 05 21:54:03 2009 +0000 +++ b/ChangeLog.API Sat Apr 11 04:34:47 2009 +0000 @@ -9,6 +9,7 @@ * PURPLE_CONTACT * PURPLE_BUDDY * PURPLE_CHAT + * purple_buddy_destroy * purple_buddy_get_protocol_data * purple_buddy_set_protocol_data * purple_buddy_get_local_buddy_alias @@ -17,9 +18,12 @@ * purple_blist_set_ui_data * purple_blist_node_get_ui_data * purple_blist_node_set_ui_data + * purple_chat_destroy * purple_connection_get_protocol_data * purple_connection_set_protocol_data + * purple_contact_destroy * purple_global_proxy_set_info + * purple_group_destroy * purple_log_get_activity_score * purple_network_force_online * purple_network_set_stun_server diff -r d6a31b0ad109 -r d6a863df7884 Doxyfile.in diff -r d6a31b0ad109 -r d6a863df7884 configure.ac --- a/configure.ac Sun Apr 05 21:54:03 2009 +0000 +++ b/configure.ac Sat Apr 11 04:34:47 2009 +0000 @@ -706,9 +706,13 @@ PKG_CHECK_MODULES(LIBXML, [libxml-2.0 >= 2.6.0], , [ AC_MSG_RESULT(no) AC_MSG_ERROR([ - You must have libxml2 >= 2.6.0 development headers installed to build. ])]) +PKG_CHECK_EXISTS([libxml-2.0 >= 2.6.18], , [ + AC_MSG_WARN([ +Versions of libxml2 < 2.6.18 may contain bugs that could cause XMPP messages to be discarded. +])]) + AC_SUBST(LIBXML_CFLAGS) AC_SUBST(LIBXML_LIBS) @@ -748,13 +752,33 @@ fi dnl ####################################################################### +dnl # Check for GStreamer Interfaces +dnl ####################################################################### +if test "x$enable_gst" != "xno"; then + AC_ARG_ENABLE(gstreamer-interfaces, + [AC_HELP_STRING([--disable-gstreamer-interfaces], [compile without GStreamer interface support])], + enable_gstinterfaces="$enableval", enable_gstinterfaces="yes") + if test "x$enable_gstinterfaces" != "xno"; then + PKG_CHECK_MODULES(GSTINTERFACES, [gstreamer-interfaces-0.10], [ + AC_DEFINE(USE_GSTINTERFACES, 1, [Use GStreamer interfaces for X overlay support]) + AC_SUBST(GSTINTERFACES_CFLAGS) + AC_SUBST(GSTINTERFACES_LIBS) + ], [ + enable_gstinterfaces="no" + ]) + fi +else + enable_gstinterfaces="no" +fi + +dnl ####################################################################### dnl # Check for Farsight dnl ####################################################################### AC_ARG_ENABLE(farsight, [AC_HELP_STRING([--disable-farsight], [compile without farsight support])], enable_farsight="$enableval", enable_farsight="yes") if test "x$enable_farsight" != "xno"; then - PKG_CHECK_MODULES(FARSIGHT, [farsight2-0.10 >= 0.0.8 gstreamer-0.10 gstreamer-plugins-base-0.10 libxml-2.0], [ + PKG_CHECK_MODULES(FARSIGHT, [farsight2-0.10 >= 0.0.9], [ AC_DEFINE(USE_FARSIGHT, 1, [Use Farsight for voice and video]) AC_SUBST(FARSIGHT_CFLAGS) AC_SUBST(FARSIGHT_LIBS) @@ -764,41 +788,21 @@ fi dnl ####################################################################### -dnl # Check for GStreamer-properties -dnl ####################################################################### -AC_ARG_ENABLE(gstprops, - [AC_HELP_STRING([--disable-gstprops], [compile without gstreamer props])], - enable_gstprops="$enableval", enable_gstprops="yes") -if test "x$enable_gstprops" != "xno"; -then - dnl gstreamer-libs-$GST_MAJORMINOR - dnl gstreamer-gconf-$GST_MAJORMINOR - PKG_CHECK_MODULES(GSTPROPS, [gstreamer-0.10 gstreamer-plugins-base-0.10 libxml-2.0], [ - GSTPROPS_LIBS="$GSTPROPS_LIBS -lgstinterfaces-0.10" - AC_DEFINE(USE_GSTPROPS, 1, [Use GStreamer property probe for finding devices]) - AC_SUBST(GSTPROPS_LIBS) - AC_SUBST(GSTPROPS_CFLAGS) - ], [ - enable_gstprops="no" - ]) -fi - -dnl ####################################################################### dnl # Check for Voice and Video support dnl ####################################################################### AC_ARG_ENABLE(vv, [AC_HELP_STRING([--disable-vv], [compile without voice and video support])], - [enable_vv="$enableval" force_vv=$enableval], [enable_vv="yes" enable_vv=no]) + [enable_vv="$enableval" force_vv=$enableval], [enable_vv="yes" force_vv=no]) if test "x$enable_vv" != "xno"; then - if test "x$enable_farsight" != "xno" -a "x$enable_gstprops" != "xno"; then + if test "x$enable_gstreamer" != "xno" -a "x$enable_gstinterfaces" != "xno" -a "x$enable_farsight" != "xno"; then AC_DEFINE(USE_VV, 1, [Use voice and video]) else enable_vv="no" if test "x$force_vv" = "xyes"; then AC_MSG_ERROR([ - -Dependencies for voice/video were not met. Install the necessary gstreamer and farsight packages first. - +Dependencies for voice/video were not met. +Install the necessary gstreamer and farsight packages first. +Or use --disable-vv if you do not need voice/video support. ]) fi fi @@ -982,7 +986,7 @@ gadu_includes="yes" gadu_libs="yes" ], [ - AC_MSG_RESULT(no) + gadu_includes="no" ]) else if test "$ac_gadu_includes" != "no"; then diff -r d6a31b0ad109 -r d6a863df7884 finch/gntaccount.c --- a/finch/gntaccount.c Sun Apr 05 21:54:03 2009 +0000 +++ b/finch/gntaccount.c Sat Apr 11 04:34:47 2009 +0000 @@ -669,8 +669,13 @@ account_toggled(GntWidget *widget, void *key, gpointer null) { PurpleAccount *account = key; + gboolean enabled = gnt_tree_get_choice(GNT_TREE(widget), key); - purple_account_set_enabled(account, FINCH_UI, gnt_tree_get_choice(GNT_TREE(widget), key)); + if (enabled) + purple_savedstatus_activate_for_account(purple_savedstatus_get_current(), + account); + + purple_account_set_enabled(account, FINCH_UI, enabled); } static gboolean diff -r d6a31b0ad109 -r d6a863df7884 finch/gntdebug.c diff -r d6a31b0ad109 -r d6a863df7884 finch/gntft.c diff -r d6a31b0ad109 -r d6a863df7884 finch/gntmedia.c --- a/finch/gntmedia.c Sun Apr 05 21:54:03 2009 +0000 +++ b/finch/gntmedia.c Sat Apr 11 04:34:47 2009 +0000 @@ -254,16 +254,15 @@ } else if (state == PURPLE_MEDIA_STATE_NEW && sid != NULL && name != NULL && purple_media_is_initiator(media, sid, name) == FALSE) { - PurpleConnection *pc; + PurpleAccount *account; PurpleBuddy *buddy; const gchar *alias; PurpleMediaSessionType type = purple_media_get_session_type(media, sid); gchar *message = NULL; - pc = purple_media_get_connection(gntmedia->priv->media); - buddy = purple_find_buddy( - purple_connection_get_account(pc), name); + account = purple_media_get_account(gntmedia->priv->media); + buddy = purple_find_buddy(account, name); alias = buddy ? purple_buddy_get_contact_alias(buddy) : name; if (type & PURPLE_MEDIA_AUDIO) { @@ -386,13 +385,12 @@ static gboolean finch_new_media(PurpleMediaManager *manager, PurpleMedia *media, - PurpleConnection *gc, gchar *name, gpointer null) + PurpleAccount *account, gchar *name, gpointer null) { GntWidget *gntmedia; PurpleConversation *conv; - conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, - purple_connection_get_account(gc), name); + conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, name); gntmedia = finch_media_new(media); g_signal_connect(G_OBJECT(gntmedia), "message", G_CALLBACK(gntmedia_message_cb), conv); diff -r d6a31b0ad109 -r d6a863df7884 finch/gntnotify.c diff -r d6a31b0ad109 -r d6a863df7884 finch/gntplugin.c diff -r d6a31b0ad109 -r d6a863df7884 finch/gntpounce.c diff -r d6a31b0ad109 -r d6a863df7884 finch/gntrequest.c diff -r d6a31b0ad109 -r d6a863df7884 finch/gntstatus.c diff -r d6a31b0ad109 -r d6a863df7884 finch/libgnt/Makefile.am diff -r d6a31b0ad109 -r d6a863df7884 finch/libgnt/gnttextview.c --- a/finch/libgnt/gnttextview.c Sun Apr 05 21:54:03 2009 +0000 +++ b/finch/libgnt/gnttextview.c Sat Apr 11 04:34:47 2009 +0000 @@ -799,6 +799,7 @@ break; } } + gnt_widget_draw(GNT_WIDGET(view)); return count; } diff -r d6a31b0ad109 -r d6a863df7884 finch/libgnt/gnttree.c --- a/finch/libgnt/gnttree.c Sun Apr 05 21:54:03 2009 +0000 +++ b/finch/libgnt/gnttree.c Sat Apr 11 04:34:47 2009 +0000 @@ -432,7 +432,7 @@ if (tree->top == NULL) tree->top = tree->root; - if (tree->current == NULL) { + if (tree->current == NULL && tree->root != NULL) { tree->current = tree->root; tree_selection_changed(tree, NULL, tree->current); } @@ -491,6 +491,13 @@ tree->top = get_next(tree->top); row = tree->top; scrcol = widget->priv.width - 1 - 2 * pos; /* exclude the borders and the scrollbar */ + + if (tree->current && !row_matches_search(tree->current)) { + GntTreeRow *old = tree->current; + tree->current = tree->top; + tree_selection_changed(tree, old, tree->current); + } + for (i = start + pos; row && i < widget->priv.height - pos; i++, row = get_next(row)) { diff -r d6a31b0ad109 -r d6a863df7884 finch/libgnt/wms/Makefile.am diff -r d6a31b0ad109 -r d6a863df7884 finch/libgnt/wms/s.c diff -r d6a31b0ad109 -r d6a863df7884 finch/plugins/Makefile.am --- a/finch/plugins/Makefile.am Sun Apr 05 21:54:03 2009 +0000 +++ b/finch/plugins/Makefile.am Sat Apr 11 04:34:47 2009 +0000 @@ -2,6 +2,7 @@ gntgf_la_LDFLAGS = -module -avoid-version gnthistory_la_LDFLAGS = -module -avoid-version gntlastlog_la_LDFLAGS = -module -avoid-version +gnttinyurl_la_LDFLAGS = -module -avoid-version grouping_la_LDFLAGS = -module -avoid-version if PLUGINS @@ -11,6 +12,7 @@ gntgf.la \ gnthistory.la \ gntlastlog.la \ + gnttinyurl.la \ grouping.la plugindir = $(libdir)/finch @@ -19,6 +21,7 @@ gntgf_la_SOURCES = gntgf.c gnthistory_la_SOURCES = gnthistory.c gntlastlog_la_SOURCES = lastlog.c +gnttinyurl_la_SOURCES = gnttinyurl.c grouping_la_SOURCES = grouping.c gntclipboard_la_CFLAGS = $(X11_CFLAGS) @@ -28,6 +31,7 @@ gntgf_la_LIBADD = $(GLIB_LIBS) $(X11_LIBS) $(top_builddir)/finch/libgnt/libgnt.la gnthistory_la_LIBADD = $(GLIB_LIBS) gntlastlog_la_LIBADD = $(GLIB_LIBS) +gnttinyurl_la_LIBADD = $(GLIB_LIBS) grouping_la_LIBADD = $(GLIB_LIBS) $(top_builddir)/finch/libgnt/libgnt.la endif # PLUGINS diff -r d6a31b0ad109 -r d6a863df7884 finch/plugins/gnttinyurl.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/finch/plugins/gnttinyurl.c Sat Apr 11 04:34:47 2009 +0000 @@ -0,0 +1,415 @@ +/** + * @file gnttinyurl.c + * + * Copyright (C) 2009 Richard Nelson + * + * 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 "internal.h" +#include + +#define PLUGIN_STATIC_NAME TinyURL +#define PREFS_BASE "/plugins/gnt/tinyurl" +#define PREF_LENGTH PREFS_BASE "/length" +#define PREF_URL PREFS_BASE "/url" + + +#include +#include + +#include + +#include +#include +#include +#include + +#include + +#include +#include + +static int tag_num = 0; + +typedef struct +{ + PurpleConversation *conv; + gchar *tag; + int num; +} CbInfo; + +/* 3 functions from util.c */ +static gboolean +badchar(char c) +{ + switch (c) { + case ' ': + case ',': + case '\0': + case '\n': + case '\r': + case '<': + case '>': + case '"': + case '\'': + return TRUE; + default: + return FALSE; + } +} + +static gboolean +badentity(const char *c) +{ + if (!g_ascii_strncasecmp(c, "<", 4) || + !g_ascii_strncasecmp(c, ">", 4) || + !g_ascii_strncasecmp(c, """, 6)) { + return TRUE; + } + return FALSE; +} + +static GList *extract_urls(char *text) { + const char *t, *c, *q = NULL; + char *url_buf; + GList *ret = NULL; + gboolean inside_html = FALSE; + int inside_paren = 0; + c = text; + while (*c) { + if (*c == '(' && !inside_html) { + inside_paren++; + c++; + } + if (inside_html) { + if (*c == '>') { + inside_html = FALSE; + } else if (!q && (*c == '\"' || *c == '\'')) { + q = c; + } else if(q) { + if(*c == *q) + q = NULL; + } + } else if (*c == '<') { + inside_html = TRUE; + if (!g_ascii_strncasecmp(c, "') { + inside_html = FALSE; + break; + } + c++; + if (!(*c)) + break; + } + } + } else if ((*c=='h') && (!g_ascii_strncasecmp(c, "http://", 7) || + (!g_ascii_strncasecmp(c, "https://", 8)))) { + t = c; + while (1) { + if (badchar(*t) || badentity(t)) { + + if ((!g_ascii_strncasecmp(c, "http://", 7) && (t - c == 7)) || + (!g_ascii_strncasecmp(c, "https://", 8) && (t - c == 8))) { + break; + } + + if (*(t) == ',' && (*(t + 1) != ' ')) { + t++; + continue; + } + + if (*(t - 1) == '.') + t--; + if ((*(t - 1) == ')' && (inside_paren > 0))) { + t--; + } + + url_buf = g_strndup(c, t - c); + if (!g_list_find_custom(ret, url_buf, (GCompareFunc)strcmp)) { + purple_debug_info("TinyURL", "Added URL %s\n", url_buf); + ret = g_list_append(ret, g_strdup(url_buf)); + } + c = t; + break; + } + t++; + + } + } else if (!g_ascii_strncasecmp(c, "www.", 4) && (c == text || badchar(c[-1]) || badentity(c-1))) { + if (c[4] != '.') { + t = c; + while (1) { + if (badchar(*t) || badentity(t)) { + if (t - c == 4) { + break; + } + + if (*(t) == ',' && (*(t + 1) != ' ')) { + t++; + continue; + } + + if (*(t - 1) == '.') + t--; + if ((*(t - 1) == ')' && (inside_paren > 0))) { + t--; + } + url_buf = g_strndup(c, t - c); + if (!g_list_find_custom(ret, url_buf, (GCompareFunc)strcmp)) { + purple_debug_info("TinyURL", "Added URL %s\n", url_buf); + ret = g_list_append(ret, url_buf); + } + c = t; + break; + } + t++; + } + } + } + if (*c == ')' && !inside_html) { + inside_paren--; + c++; + } + if (*c == 0) + break; + c++; + } + return ret; +} + +static void url_fetched(PurpleUtilFetchUrlData *url_data, gpointer cb_data, + const gchar *url_text, gsize len, const gchar *error_message) +{ + CbInfo *data = (CbInfo *)cb_data; + PurpleConversation *conv = data->conv; + GList *convs = purple_get_conversations(); + /* ensure the conversation still exists */ + for (; convs; convs = convs->next) { + if ((PurpleConversation *)(convs->data) == conv) { + FinchConv *fconv = FINCH_CONV(conv); + gchar *str = g_strdup_printf("[%d] %s", data->num, url_text); + GntTextView *tv = GNT_TEXT_VIEW(fconv->tv); + gnt_text_view_tag_change(tv, data->tag, str, FALSE); + g_free(str); + g_free(data->tag); + return; + } + } + g_free(data->tag); + purple_debug_info("TinyURL", "Conversation no longer exists... :(\n"); +} + +static void free_urls(gpointer data, gpointer null) +{ + g_free(data); +} + +static gboolean receiving_msg(PurpleAccount *account, char **sender, char **message, + PurpleConversation *conv, PurpleMessageFlags *flags) { + GString *t; + GList *iter, *urls; + int c = 0; + + if (!(*flags & PURPLE_MESSAGE_RECV) || *flags & PURPLE_MESSAGE_INVISIBLE) + return FALSE; + + t = g_string_new(*message); + urls = purple_conversation_get_data(conv, "TinyURLs"); + if (urls != NULL) /* message was cancelled somewhere? Reset. */ + g_list_foreach(urls, free_urls, NULL); + g_list_free(urls); + urls = extract_urls(t->str); + g_free(*message); + for (iter = urls; iter; iter = iter->next) { + if (g_utf8_strlen((char *)iter->data, -1) >= purple_prefs_get_int(PREF_LENGTH)) { + int pos, x = 0; + gchar *j, *s, *str, *orig; + glong len = g_utf8_strlen(iter->data, -1); + s = g_strdup(t->str); + orig = s; + str = g_strdup_printf("[%d]", ++c); + while ((j = strstr(s, iter->data))) { /* replace all occurrences */ + pos = j - orig + (x++ * 3); + s = j + len; + t = g_string_insert(t, pos + len, str); + if (*s == '\0') break; + } + g_free(orig); + g_free(str); + continue; + } else { + if (iter->prev) { + iter = iter->prev; + g_free(iter->next->data); + urls = g_list_delete_link(urls, iter->next); + } else { + g_free(iter->data); + g_list_free(urls); + urls = NULL; + } + } + } + *message = t->str; + g_string_free(t, FALSE); + if (conv == NULL) + conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, *sender); + purple_conversation_set_data(conv, "TinyURLs", urls); + return FALSE; +} + +static void received_msg(PurpleAccount *account, char *sender, char *message, + PurpleConversation *conv, PurpleMessageFlags flags) { + int c; + GList *urls, *iter; + FinchConv *fconv = FINCH_CONV(conv); + GntTextView *tv = GNT_TEXT_VIEW(fconv->tv); + + urls = purple_conversation_get_data(conv, "TinyURLs"); + if (!(flags & PURPLE_MESSAGE_RECV) || urls == NULL) + return; + + for (iter = urls, c = 0; iter; iter = iter->next) { + int i; + CbInfo *cbdata; + gchar *url, *str, *tmp; + cbdata = g_new(CbInfo, 1); + cbdata->num = ++c; + cbdata->tag = g_strdup_printf("%s%d", "tiny_", tag_num++); + cbdata->conv = conv; + tmp = purple_unescape_html((char *)iter->data); + if (g_ascii_strncasecmp(tmp, "http://", 7) && g_ascii_strncasecmp(tmp, "https://", 8)) { + url = g_strdup_printf("%shttp%%3A%%2F%%2F%s", purple_prefs_get_string(PREF_URL), purple_url_encode(tmp)); + } else { + url = g_strdup_printf("%s%s", purple_prefs_get_string(PREF_URL), purple_url_encode(tmp)); + } + g_free(tmp); + purple_util_fetch_url(url, TRUE, "finch", FALSE, url_fetched, cbdata); + i = gnt_text_view_get_lines_below(tv); + str = g_strdup_printf(_("\nFetching TinyURL...")); + gnt_text_view_append_text_with_tag((tv), str, GNT_TEXT_FLAG_DIM, cbdata->tag); + g_free(str); + if (i == 0) + gnt_text_view_scroll(tv, 0); + g_free(iter->data); + g_free(url); + } + g_list_free(urls); + purple_conversation_set_data(conv, "TinyURLs", NULL); +} + +static void +free_conv_urls(PurpleConversation *conv) +{ + GList *urls = purple_conversation_get_data(conv, "TinyURLs"); + if (urls) + g_list_foreach(urls, free_urls, NULL); + g_list_free(urls); +} + +static gboolean +plugin_load(PurplePlugin *plugin) { + purple_signal_connect(purple_conversations_get_handle(), + "wrote-im-msg", + plugin, PURPLE_CALLBACK(received_msg), NULL); + purple_signal_connect(purple_conversations_get_handle(), + "wrote-chat-msg", + plugin, PURPLE_CALLBACK(received_msg), NULL); + purple_signal_connect(purple_conversations_get_handle(), + "receiving-im-msg", + plugin, PURPLE_CALLBACK(receiving_msg), NULL); + purple_signal_connect(purple_conversations_get_handle(), + "receiving-chat-msg", + plugin, PURPLE_CALLBACK(receiving_msg), NULL); + purple_signal_connect(purple_conversations_get_handle(), + "deleting-conversation", + plugin, PURPLE_CALLBACK(free_conv_urls), NULL); + + return TRUE; +} + +static PurplePluginPrefFrame * +get_plugin_pref_frame(PurplePlugin *plugin) { + + PurplePluginPrefFrame *frame; + PurplePluginPref *pref; + + frame = purple_plugin_pref_frame_new(); + + pref = purple_plugin_pref_new_with_name(PREF_LENGTH); + purple_plugin_pref_set_label(pref, _("Only create TinyURL for urls" + " of this length or greater")); + purple_plugin_pref_frame_add(frame, pref); + pref = purple_plugin_pref_new_with_name(PREF_URL); + purple_plugin_pref_set_label(pref, _("TinyURL (or other) address prefix")); + purple_plugin_pref_frame_add(frame, pref); + + return frame; +} + +static PurplePluginUiInfo prefs_info = { + get_plugin_pref_frame, + 0, /* page_num (Reserved) */ + NULL, /* frame (Reserved) */ + + /* padding */ + NULL, + NULL, + NULL, + NULL +}; + +static PurplePluginInfo info = +{ + PURPLE_PLUGIN_MAGIC, + PURPLE_MAJOR_VERSION, + PURPLE_MINOR_VERSION, + PURPLE_PLUGIN_STANDARD, + FINCH_PLUGIN_TYPE, + 0, + NULL, + PURPLE_PRIORITY_DEFAULT, + "TinyURL", + N_("TinyURL"), + DISPLAY_VERSION, + N_("TinyURL plugin"), + N_("When receiving a message with URL(s), TinyURL for easier copying"), + "Richard Nelson ", + PURPLE_WEBSITE, + plugin_load, + NULL, + NULL, + NULL, + NULL, + &prefs_info, /**< prefs_info */ + NULL, + + /* padding */ + NULL, + NULL, + NULL, + NULL +}; + +static void +init_plugin(PurplePlugin *plugin) { + purple_prefs_add_none(PREFS_BASE); + purple_prefs_add_int(PREF_LENGTH, 30); + purple_prefs_add_string(PREF_URL, "http://tinyurl.com/api-create.php?url="); +} + +PURPLE_INIT_PLUGIN(PLUGIN_STATIC_NAME, init_plugin, info) diff -r d6a31b0ad109 -r d6a863df7884 libpurple/Makefile.am --- a/libpurple/Makefile.am Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/Makefile.am Sat Apr 11 04:34:47 2009 +0000 @@ -113,7 +113,6 @@ idle.h \ imgstore.h \ log.h \ - marshallers.h \ media.h \ media-gst.h \ mediamanager.h \ @@ -153,7 +152,7 @@ xmlnode.h \ whiteboard.h -purple_builtheaders = purple.h version.h +purple_builtheaders = purple.h version.h marshallers.h marshallers.h: marshallers.list @echo "Generating marshallers.h" @@ -280,8 +279,8 @@ $(NETWORKMANAGER_LIBS) \ $(INTLLIBS) \ $(FARSIGHT_LIBS) \ - $(GSTPROPS_LIBS) \ $(GSTREAMER_LIBS) \ + $(GSTINTERFACES_LIBS) \ -lm AM_CPPFLAGS = \ @@ -295,8 +294,8 @@ $(DBUS_CFLAGS) \ $(LIBXML_CFLAGS) \ $(FARSIGHT_CFLAGS) \ - $(GSTPROPS_CFLAGS) \ $(GSTREAMER_CFLAGS) \ + $(GSTINTERFACES_CFLAGS) \ $(NETWORKMANAGER_CFLAGS) # INSTALL_SSL_CERTIFICATES is true when SSL_CERTIFICATES_DIR is empty. diff -r d6a31b0ad109 -r d6a863df7884 libpurple/account.c --- a/libpurple/account.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/account.c Sat Apr 11 04:34:47 2009 +0000 @@ -2787,6 +2787,7 @@ void purple_accounts_uninit(void) { + GList* account; gpointer handle = purple_accounts_get_handle(); if (save_timer != 0) { @@ -2797,4 +2798,10 @@ purple_signals_disconnect_by_handle(handle); purple_signals_unregister_by_instance(handle); + + account = purple_accounts_get_all(); + while (account) { + purple_account_destroy(account->data); + account = g_list_delete_link(account, account); + } } diff -r d6a31b0ad109 -r d6a863df7884 libpurple/blist.c --- a/libpurple/blist.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/blist.c Sat Apr 11 04:34:47 2009 +0000 @@ -1202,6 +1202,16 @@ return chat; } +void +purple_chat_destroy(PurpleChat *chat) +{ + g_hash_table_destroy(chat->components); + g_hash_table_destroy(chat->node.settings); + g_free(chat->alias); + PURPLE_DBUS_UNREGISTER_POINTER(chat); + g_free(chat); +} + PurpleBuddy *purple_buddy_new(PurpleAccount *account, const char *name, const char *alias) { PurpleBlistUiOps *ops = purple_blist_get_ui_ops(); @@ -1229,6 +1239,42 @@ } void +purple_buddy_destroy(PurpleBuddy *buddy) +{ + PurplePlugin *prpl; + PurplePluginProtocolInfo *prpl_info; + + /* + * Tell the owner PRPL that we're about to free the buddy so it + * can free proto_data + */ + prpl = purple_find_prpl(purple_account_get_protocol_id(buddy->account)); + if (prpl) { + prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); + if (prpl_info && prpl_info->buddy_free) + prpl_info->buddy_free(buddy); + } + + /* Delete the node */ + purple_buddy_icon_unref(buddy->icon); + g_hash_table_destroy(buddy->node.settings); + purple_presence_destroy(buddy->presence); + g_free(buddy->name); + g_free(buddy->alias); + g_free(buddy->server_alias); + + PURPLE_DBUS_UNREGISTER_POINTER(buddy); + g_free(buddy); + + /* FIXME: Once PurpleBuddy is a GObject, timeout callbacks can + * g_object_ref() it when connecting the callback and + * g_object_unref() it in the handler. That way, it won't + * get freed while the timeout is pending and this line can + * be removed. */ + while (g_source_remove_by_user_data((gpointer *)buddy)); +} + +void purple_buddy_set_icon(PurpleBuddy *buddy, PurpleBuddyIcon *icon) { g_return_if_fail(buddy != NULL); @@ -1519,6 +1565,14 @@ return contact; } +void +purple_contact_destroy(PurpleContact *contact) +{ + g_hash_table_destroy(contact->node.settings); + PURPLE_DBUS_UNREGISTER_POINTER(contact); + g_free(contact); +} + void purple_contact_set_alias(PurpleContact *contact, const char *alias) { purple_blist_alias_contact(contact,alias); @@ -1588,6 +1642,15 @@ return group; } +void +purple_group_destroy(PurpleGroup *group) +{ + g_hash_table_destroy(group->node.settings); + g_free(group->name); + PURPLE_DBUS_UNREGISTER_POINTER(group); + g_free(group); +} + void purple_blist_add_contact(PurpleContact *contact, PurpleGroup *group, PurpleBlistNode *node) { PurpleBlistUiOps *ops = purple_blist_get_ui_ops(); @@ -1848,9 +1911,7 @@ ops->remove(purplebuddylist, node); /* Delete the node */ - g_hash_table_destroy(contact->node.settings); - PURPLE_DBUS_UNREGISTER_POINTER(contact); - g_free(contact); + purple_contact_destroy(contact); } } @@ -1861,8 +1922,6 @@ PurpleContact *contact; PurpleGroup *group; struct _purple_hbuddy hb; - PurplePlugin *prpl; - PurplePluginProtocolInfo *prpl_info = NULL; g_return_if_fail(buddy != NULL); @@ -1918,33 +1977,7 @@ /* Signal that the buddy has been removed before freeing the memory for it */ purple_signal_emit(purple_blist_get_handle(), "buddy-removed", buddy); - /* - * Tell the owner PRPL that we're about to free the buddy so it - * can free proto_data - */ - prpl = purple_find_prpl(purple_account_get_protocol_id(buddy->account)); - if (prpl) - prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); - if (prpl_info && prpl_info->buddy_free) - prpl_info->buddy_free(buddy); - - /* Delete the node */ - purple_buddy_icon_unref(buddy->icon); - g_hash_table_destroy(buddy->node.settings); - purple_presence_destroy(buddy->presence); - g_free(buddy->name); - g_free(buddy->alias); - g_free(buddy->server_alias); - - PURPLE_DBUS_UNREGISTER_POINTER(buddy); - g_free(buddy); - - /* FIXME: Once PurpleBuddy is a GObject, timeout callbacks can - * g_object_ref() it when connecting the callback and - * g_object_unref() it in the handler. That way, it won't - * get freed while the timeout is pending and this line can - * be removed. */ - while (g_source_remove_by_user_data((gpointer *)buddy)); + purple_buddy_destroy(buddy); /* If the contact is empty then remove it */ if ((contact != NULL) && !cnode->child) @@ -1988,11 +2021,7 @@ ops->remove(purplebuddylist, node); /* Delete the node */ - g_hash_table_destroy(chat->components); - g_hash_table_destroy(chat->node.settings); - g_free(chat->alias); - PURPLE_DBUS_UNREGISTER_POINTER(chat); - g_free(chat); + purple_chat_destroy(chat); } void purple_blist_remove_group(PurpleGroup *group) @@ -2033,10 +2062,7 @@ } /* Delete the node */ - g_hash_table_destroy(group->node.settings); - g_free(group->name); - PURPLE_DBUS_UNREGISTER_POINTER(group); - g_free(group); + purple_group_destroy(group); } PurpleBuddy *purple_contact_get_priority_buddy(PurpleContact *contact) @@ -2587,6 +2613,28 @@ } static void +purple_blist_node_destroy(PurpleBlistNode *node) +{ + PurpleBlistNode *child, *next_child; + + child = node->child; + while (child) { + next_child = child->next; + purple_blist_node_destroy(child); + child = next_child; + } + + if (PURPLE_BLIST_NODE_IS_BUDDY(node)) + purple_buddy_destroy((PurpleBuddy*)node); + else if (PURPLE_BLIST_NODE_IS_CHAT(node)) + purple_chat_destroy((PurpleChat*)node); + else if (PURPLE_BLIST_NODE_IS_CONTACT(node)) + purple_contact_destroy((PurpleContact*)node); + else if (PURPLE_BLIST_NODE_IS_GROUP(node)) + purple_group_destroy((PurpleGroup*)node); +} + +static void purple_blist_node_setting_free(gpointer data) { PurpleValue *value; @@ -2874,12 +2922,20 @@ void purple_blist_uninit(void) { - if (save_timer != 0) - { + PurpleBlistNode *node, *next_node; + + if (save_timer != 0) { purple_timeout_remove(save_timer); save_timer = 0; purple_blist_sync(); } + node = purple_blist_get_root(); + while (node) { + next_node = node->next; + purple_blist_node_destroy(node); + node = next_node; + } + purple_signals_unregister_by_instance(purple_blist_get_handle()); } diff -r d6a31b0ad109 -r d6a863df7884 libpurple/blist.h --- a/libpurple/blist.h Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/blist.h Sat Apr 11 04:34:47 2009 +0000 @@ -478,6 +478,13 @@ PurpleChat *purple_chat_new(PurpleAccount *account, const char *alias, GHashTable *components); /** + * Destroys a chat + * + * @param chat The chat to destroy + */ +void purple_chat_destroy(PurpleChat *chat); + +/** * Adds a new chat to the buddy list. * * The chat will be inserted right after node or appended to the end @@ -501,6 +508,13 @@ PurpleBuddy *purple_buddy_new(PurpleAccount *account, const char *name, const char *alias); /** + * Destroys a buddy + * + * @param buddy The buddy to destroy + */ +void purple_buddy_destroy(PurpleBuddy *buddy); + +/** * Sets a buddy's icon. * * This should only be called from within Purple. You probably want to @@ -611,6 +625,13 @@ PurpleGroup *purple_group_new(const char *name); /** + * Destroys a group + * + * @param group The group to destroy +*/ +void purple_group_destroy(PurpleGroup *group); + +/** * Adds a new group to the buddy list. * * The new group will be inserted after insert or prepended to the list if @@ -629,6 +650,13 @@ PurpleContact *purple_contact_new(void); /** + * Destroys a contact + * + * @param contact The contact to destroy + */ +void purple_contact_destroy(PurpleContact *contact); + +/** * Adds a new contact to the buddy list. * * The new contact will be inserted after insert or prepended to the list if diff -r d6a31b0ad109 -r d6a863df7884 libpurple/buddyicon.c --- a/libpurple/buddyicon.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/buddyicon.c Sat Apr 11 04:34:47 2009 +0000 @@ -1299,6 +1299,7 @@ g_hash_table_destroy(icon_file_cache); g_hash_table_destroy(pointer_icon_cache); g_free(old_icons_dir); + g_free(cache_dir); } void purple_buddy_icon_get_scale_size(PurpleBuddyIconSpec *spec, int *width, int *height) diff -r d6a31b0ad109 -r d6a863df7884 libpurple/conversation.c --- a/libpurple/conversation.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/conversation.c Sat Apr 11 04:34:47 2009 +0000 @@ -33,7 +33,7 @@ #include "signals.h" #include "util.h" -#define SEND_TYPED_TIMEOUT 5000 +#define SEND_TYPED_TIMEOUT_SECONDS 5 static GList *conversations = NULL; static GList *ims = NULL; @@ -1122,8 +1122,9 @@ { g_return_if_fail(im != NULL); - im->send_typed_timeout = purple_timeout_add(SEND_TYPED_TIMEOUT, send_typed_cb, - purple_conv_im_get_conversation(im)); + im->send_typed_timeout = purple_timeout_add_seconds(SEND_TYPED_TIMEOUT_SECONDS, + send_typed_cb, + purple_conv_im_get_conversation(im)); } void diff -r d6a31b0ad109 -r d6a863df7884 libpurple/core.c --- a/libpurple/core.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/core.c Sat Apr 11 04:34:47 2009 +0000 @@ -216,15 +216,10 @@ /* The SSL plugins must be uninit before they're unloaded */ purple_ssl_uninit(); - /* Unload all plugins before the UI because UI plugins might call - * UI-specific functions */ - purple_debug_info("main", "Unloading all plugins\n"); - purple_plugins_destroy_all(); - - /* Shut down the UI before all the subsystems */ - ops = purple_core_get_ui_ops(); - if (ops != NULL && ops->quit != NULL) - ops->quit(); + /* Unload all non-loader, non-prpl plugins before shutting down + * subsystems. */ + purple_debug_info("main", "Unloading normal plugins\n"); + purple_plugins_unload(PURPLE_PLUGIN_STANDARD); /* Save .xml files, remove signals, etc. */ purple_smileys_uninit(); @@ -247,7 +242,16 @@ purple_imgstore_uninit(); purple_network_uninit(); - /* Everything after this must not try to read any prefs */ + /* Everything after unloading all plugins must not fail if prpls aren't + * around */ + purple_debug_info("main", "Unloading all plugins\n"); + purple_plugins_destroy_all(); + + ops = purple_core_get_ui_ops(); + if (ops != NULL && ops->quit != NULL) + ops->quit(); + + /* Everything after prefs_uninit must not try to read any prefs */ purple_prefs_uninit(); purple_plugins_uninit(); #ifdef HAVE_DBUS @@ -255,8 +259,9 @@ #endif purple_cmds_uninit(); - /* Everything after this cannot try to write things to the confdir */ + /* Everything after util_uninit cannot try to write things to the confdir */ purple_util_uninit(); + purple_log_uninit(); purple_signals_uninit(); diff -r d6a31b0ad109 -r d6a863df7884 libpurple/example/Makefile.am diff -r d6a31b0ad109 -r d6a863df7884 libpurple/ft.c --- a/libpurple/ft.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/ft.c Sat Apr 11 04:34:47 2009 +0000 @@ -458,7 +458,7 @@ { PurpleXferType type; struct stat st; - char *msg, *utf8; + char *msg, *utf8, *base; PurpleAccount *account; PurpleBuddy *buddy; @@ -505,7 +505,9 @@ purple_xfer_set_local_filename(xfer, filename); purple_xfer_set_size(xfer, st.st_size); - utf8 = g_filename_to_utf8(g_basename(filename), -1, NULL, NULL, NULL); + base = g_path_get_basename(filename); + utf8 = g_filename_to_utf8(base, -1, NULL, NULL, NULL); + g_free(base); purple_xfer_set_filename(xfer, utf8); msg = g_strdup_printf(_("Offering to send %s to %s"), diff -r d6a31b0ad109 -r d6a863df7884 libpurple/internal.h --- a/libpurple/internal.h Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/internal.h Sat Apr 11 04:34:47 2009 +0000 @@ -222,7 +222,6 @@ # endif #endif -#include #include #ifndef G_DEFINE_TYPE diff -r d6a31b0ad109 -r d6a863df7884 libpurple/media.c --- a/libpurple/media.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/media.c Sat Apr 11 04:34:47 2009 +0000 @@ -28,7 +28,7 @@ #include "internal.h" -#include "connection.h" +#include "account.h" #include "marshallers.h" #include "media.h" #include "media-gst.h" @@ -109,7 +109,7 @@ { #ifdef USE_VV PurpleMediaManager *manager; - PurpleConnection *pc; + PurpleAccount *account; FsConference *conference; gboolean initiator; gpointer prpl_data; @@ -166,7 +166,7 @@ enum { PROP_0, PROP_MANAGER, - PROP_CONNECTION, + PROP_ACCOUNT, PROP_CONFERENCE, PROP_INITIATOR, PROP_PRPL_DATA, @@ -298,10 +298,10 @@ PURPLE_TYPE_MEDIA_MANAGER, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); - g_object_class_install_property(gobject_class, PROP_CONNECTION, - g_param_spec_pointer("connection", - "PurpleConnection", - "The connection this media session is on.", + g_object_class_install_property(gobject_class, PROP_ACCOUNT, + g_param_spec_pointer("account", + "PurpleAccount", + "The account this media session is on.", G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); g_object_class_install_property(gobject_class, PROP_CONFERENCE, @@ -528,8 +528,8 @@ purple_media_setup_pipeline(media); break; - case PROP_CONNECTION: - media->priv->pc = g_value_get_pointer(value); + case PROP_ACCOUNT: + media->priv->account = g_value_get_pointer(value); break; case PROP_CONFERENCE: { if (media->priv->conference) @@ -564,8 +564,8 @@ case PROP_MANAGER: g_value_set_object(value, media->priv->manager); break; - case PROP_CONNECTION: - g_value_set_pointer(value, media->priv->pc); + case PROP_ACCOUNT: + g_value_set_pointer(value, media->priv->account); break; case PROP_CONFERENCE: g_value_set_object(value, media->priv->conference); @@ -2055,14 +2055,14 @@ } #endif -PurpleConnection * -purple_media_get_connection(PurpleMedia *media) +PurpleAccount * +purple_media_get_account(PurpleMedia *media) { #ifdef USE_VV - PurpleConnection *pc; + PurpleAccount *account; g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); - g_object_get(G_OBJECT(media), "connection", &pc, NULL); - return pc; + g_object_get(G_OBJECT(media), "account", &account, NULL); + return account; #else return NULL; #endif diff -r d6a31b0ad109 -r d6a863df7884 libpurple/media.h --- a/libpurple/media.h Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/media.h Sat Apr 11 04:34:47 2009 +0000 @@ -362,15 +362,15 @@ GList *purple_media_get_session_names(PurpleMedia *media); /** - * Gets the PurpleConnection this media session is on. + * Gets the PurpleAccount this media session is on. * - * @param media The media session to retrieve the connection from. + * @param media The media session to retrieve the account from. * - * @return The connection retrieved. + * @return The account retrieved. * * @since 2.6.0 */ -PurpleConnection *purple_media_get_connection(PurpleMedia *media); +PurpleAccount *purple_media_get_account(PurpleMedia *media); /** * Gets the prpl data from the media session. diff -r d6a31b0ad109 -r d6a863df7884 libpurple/mediamanager.c --- a/libpurple/mediamanager.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/mediamanager.c Sat Apr 11 04:34:47 2009 +0000 @@ -26,7 +26,7 @@ #include "internal.h" -#include "connection.h" +#include "account.h" #include "debug.h" #include "marshallers.h" #include "media.h" @@ -249,7 +249,7 @@ PurpleMedia * purple_media_manager_create_media(PurpleMediaManager *manager, - PurpleConnection *gc, + PurpleAccount *account, const char *conference_type, const char *remote_user, gboolean initiator) @@ -261,8 +261,7 @@ gboolean signal_ret; if (conference == NULL) { - purple_conv_present_error(remote_user, - purple_connection_get_account(gc), + purple_conv_present_error(remote_user, account, _("Error creating conference.")); purple_debug_error("media", "Conference == NULL\n"); return NULL; @@ -270,7 +269,7 @@ media = PURPLE_MEDIA(g_object_new(purple_media_get_type(), "manager", manager, - "connection", gc, + "account", account, "conference", conference, "initiator", initiator, NULL)); @@ -278,8 +277,7 @@ ret = gst_element_set_state(GST_ELEMENT(conference), GST_STATE_PLAYING); if (ret == GST_STATE_CHANGE_FAILURE) { - purple_conv_present_error(remote_user, - purple_connection_get_account(gc), + purple_conv_present_error(remote_user, account, _("Error creating conference.")); purple_debug_error("media", "Failed to start conference.\n"); g_object_unref(media); @@ -287,7 +285,7 @@ } g_signal_emit(manager, purple_media_manager_signals[INIT_MEDIA], 0, - media, gc, remote_user, &signal_ret); + media, account, remote_user, &signal_ret); if (signal_ret == FALSE) { g_object_unref(media); @@ -312,8 +310,8 @@ } GList * -purple_media_manager_get_media_by_connection(PurpleMediaManager *manager, - PurpleConnection *pc) +purple_media_manager_get_media_by_account(PurpleMediaManager *manager, + PurpleAccount *account) { #ifdef USE_VV GList *media = NULL; @@ -323,7 +321,7 @@ iter = manager->priv->medias; for (; iter; iter = g_list_next(iter)) { - if (purple_media_get_connection(iter->data) == pc) { + if (purple_media_get_account(iter->data) == account) { media = g_list_prepend(media, iter->data); } } @@ -497,7 +495,6 @@ g_object_unref(info2); return FALSE; } - g_object_unref(info2); manager->priv->elements = g_list_prepend(manager->priv->elements, info); @@ -560,7 +557,8 @@ if (info2 == NULL) purple_media_manager_register_element(manager, info); - g_object_unref(info2); + else + g_object_unref(info2); type = purple_media_element_info_get_element_type(info); diff -r d6a31b0ad109 -r d6a863df7884 libpurple/mediamanager.h --- a/libpurple/mediamanager.h Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/mediamanager.h Sat Apr 11 04:34:47 2009 +0000 @@ -35,7 +35,7 @@ /** @copydoc _PurpleMediaManagerClass */ typedef struct _PurpleMediaManagerClass PurpleMediaManagerClass; -#include "connection.h" +#include "account.h" #include "media.h" G_BEGIN_DECLS @@ -78,7 +78,7 @@ * Creates a media session. * * @param manager The media manager to create the session under. - * @param gc The connection to create the session on. + * @param account The account to create the session on. * @param conference_type The conference type to feed into Farsight2. * @param remote_user The remote user to initiate the session with. * @@ -87,7 +87,7 @@ * @since 2.6.0 */ PurpleMedia *purple_media_manager_create_media(PurpleMediaManager *manager, - PurpleConnection *gc, + PurpleAccount *account, const char *conference_type, const char *remote_user, gboolean initiator); @@ -104,17 +104,17 @@ GList *purple_media_manager_get_media(PurpleMediaManager *manager); /** - * Gets all of the media sessions for a given connection. + * Gets all of the media sessions for a given account. * * @param manager The media manager to get the sessions from. - * @param pc The connection the sessions are on. + * @param account The account the sessions are on. * - * @return A list of the media sessions on the given connection. + * @return A list of the media sessions on the given account. * * @since 2.6.0 */ -GList *purple_media_manager_get_media_by_connection( - PurpleMediaManager *manager, PurpleConnection *pc); +GList *purple_media_manager_get_media_by_account( + PurpleMediaManager *manager, PurpleAccount *account); /** * Removes a media session from the media manager. diff -r d6a31b0ad109 -r d6a863df7884 libpurple/mime.c --- a/libpurple/mime.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/mime.c Sat Apr 11 04:34:47 2009 +0000 @@ -25,9 +25,6 @@ #include #include -#include -#include -#include #include "internal.h" diff -r d6a31b0ad109 -r d6a863df7884 libpurple/mime.h --- a/libpurple/mime.h Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/mime.h Sat Apr 11 04:34:47 2009 +0000 @@ -25,7 +25,6 @@ #define _PURPLE_MIME_H #include -#include #ifdef __cplusplus extern "C" { diff -r d6a31b0ad109 -r d6a863df7884 libpurple/plugin.c --- a/libpurple/plugin.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/plugin.c Sat Apr 11 04:34:47 2009 +0000 @@ -1201,6 +1201,11 @@ purple_signals_disconnect_by_handle(handle); purple_signals_unregister_by_instance(handle); + + while (search_paths) { + g_free(search_paths->data); + search_paths = g_list_delete_link(search_paths, search_paths); + } } /************************************************************************** @@ -1229,6 +1234,21 @@ } void +purple_plugins_unload(PurplePluginType type) +{ +#ifdef PURPLE_PLUGINS + GList *l; + + for (l = plugins; l; l = l->next) { + PurplePlugin *plugin = l->data; + if (plugin->info->type == type && purple_plugin_is_loaded(plugin)) + purple_plugin_unload(plugin); + } + +#endif /* PURPLE_PLUGINS */ +} + +void purple_plugins_destroy_all(void) { #ifdef PURPLE_PLUGINS diff -r d6a31b0ad109 -r d6a863df7884 libpurple/plugin.h --- a/libpurple/plugin.h Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/plugin.h Sat Apr 11 04:34:47 2009 +0000 @@ -29,7 +29,7 @@ #ifndef _PURPLE_PLUGIN_H_ #define _PURPLE_PLUGIN_H_ -#include +#include #include #include "signals.h" #include "value.h" @@ -503,6 +503,11 @@ void purple_plugins_unload_all(void); /** + * Unloads all plugins of a specific type. + */ +void purple_plugins_unload(PurplePluginType type); + +/** * Destroys all registered plugins. */ void purple_plugins_destroy_all(void); diff -r d6a31b0ad109 -r d6a863df7884 libpurple/plugins/Makefile.am diff -r d6a31b0ad109 -r d6a863df7884 libpurple/plugins/filectl.c --- a/libpurple/plugins/filectl.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/plugins/filectl.c Sat Apr 11 04:34:47 2009 +0000 @@ -220,7 +220,7 @@ plugin_load(PurplePlugin *plugin) { init_file(); - check = purple_timeout_add(5000, (GSourceFunc)check_file, NULL); + check = purple_timeout_add_seconds(5, (GSourceFunc)check_file, NULL); return TRUE; } diff -r d6a31b0ad109 -r d6a863df7884 libpurple/plugins/joinpart.c --- a/libpurple/plugins/joinpart.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/plugins/joinpart.c Sat Apr 11 04:34:47 2009 +0000 @@ -194,7 +194,7 @@ PURPLE_CALLBACK(received_chat_msg_cb), users); /* Cleanup every 5 minutes */ - id = purple_timeout_add(1000 * 60 * 5, (GSourceFunc)clean_users_hash, users); + id = purple_timeout_add_seconds(60 * 5, (GSourceFunc)clean_users_hash, users); data = g_new(gpointer, 2); data[0] = users; diff -r d6a31b0ad109 -r d6a863df7884 libpurple/plugins/perl/Makefile.am diff -r d6a31b0ad109 -r d6a863df7884 libpurple/plugins/ssl/Makefile.am diff -r d6a31b0ad109 -r d6a863df7884 libpurple/plugins/tcl/Makefile.am diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/bonjour/Makefile.am diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/gg/Makefile.am diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/irc/Makefile.am diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/irc/msgs.c --- a/libpurple/protocols/irc/msgs.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/protocols/irc/msgs.c Sat Apr 11 04:34:47 2009 +0000 @@ -128,7 +128,7 @@ irc_blist_timeout(irc); if (!irc->timer) - irc->timer = purple_timeout_add(45000, (GSourceFunc)irc_blist_timeout, (gpointer)irc); + irc->timer = purple_timeout_add_seconds(45, (GSourceFunc)irc_blist_timeout, (gpointer)irc); } void irc_msg_default(struct irc_conn *irc, const char *name, const char *from, char **args) diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/jabber/buddy.c --- a/libpurple/protocols/jabber/buddy.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/protocols/jabber/buddy.c Sat Apr 11 04:34:47 2009 +0000 @@ -1656,7 +1656,7 @@ } js->pending_buddy_info_requests = g_slist_prepend(js->pending_buddy_info_requests, jbi); - jbi->timeout_handle = purple_timeout_add(30000, jabber_buddy_get_info_timeout, jbi); + jbi->timeout_handle = purple_timeout_add_seconds(30, jabber_buddy_get_info_timeout, jbi); } void jabber_buddy_get_info(PurpleConnection *gc, const char *who) diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/jabber/google.c --- a/libpurple/protocols/jabber/google.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/protocols/jabber/google.c Sat Apr 11 04:34:47 2009 +0000 @@ -340,7 +340,8 @@ session->remote_jid = jid; session->media = purple_media_manager_create_media( - purple_media_manager_get(), js->gc, + purple_media_manager_get(), + purple_connection_get_account(js->gc), "fsrtpconference", session->remote_jid, TRUE); purple_media_set_prpl_data(session->media, session); @@ -389,8 +390,10 @@ return; } - session->media = purple_media_manager_create_media(purple_media_manager_get(), js->gc, - "fsrtpconference", session->remote_jid, FALSE); + session->media = purple_media_manager_create_media( + purple_media_manager_get(), + purple_connection_get_account(js->gc), + "fsrtpconference", session->remote_jid, FALSE); purple_media_set_prpl_data(session->media, session); @@ -572,8 +575,9 @@ if (!id.initiator) return; - iter = purple_media_manager_get_media_by_connection( - purple_media_manager_get(), js->gc); + iter = purple_media_manager_get_media_by_account( + purple_media_manager_get(), + purple_connection_get_account(js->gc)); for (; iter; iter = g_list_delete_link(iter, iter)) { GoogleSession *gsession = purple_media_get_prpl_data(iter->data); diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/jabber/jabber.c --- a/libpurple/protocols/jabber/jabber.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/protocols/jabber/jabber.c Sat Apr 11 04:34:47 2009 +0000 @@ -2628,7 +2628,7 @@ #ifdef USE_VV typedef struct { - PurpleConnection *pc; + PurpleAccount *account; gchar *who; PurpleMediaSessionType type; @@ -2651,7 +2651,7 @@ GList *labels = purple_request_field_choice_get_labels(field); gchar *who = g_strdup_printf("%s/%s", request->who, (gchar*)g_list_nth_data(labels, selected_id)); - jabber_initiate_media(request->pc, who, request->type); + jabber_initiate_media(request->account, who, request->type); g_free(who); g_free(request->who); @@ -2660,11 +2660,12 @@ #endif gboolean -jabber_initiate_media(PurpleConnection *gc, const char *who, +jabber_initiate_media(PurpleAccount *account, const char *who, PurpleMediaSessionType type) { #ifdef USE_VV - JabberStream *js = (JabberStream *) gc->proto_data; + JabberStream *js = (JabberStream *) + purple_account_get_connection(account)->proto_data; JabberBuddy *jb; JabberBuddyResource *jbr = NULL; char *resource; @@ -2689,11 +2690,9 @@ JINGLE_APP_RTP_SUPPORT_AUDIO) && jabber_resource_has_capability(jbr, GOOGLE_VOICE_CAP)) - return jabber_google_session_initiate( - gc->proto_data, who, type); + return jabber_google_session_initiate(js, who, type); else - return jingle_rtp_initiate_media( - gc->proto_data, who, type); + return jingle_rtp_initiate_media(js, who, type); } jb = jabber_buddy_find(js, who, FALSE); @@ -2712,7 +2711,7 @@ msg = g_strdup_printf(_("Unable to initiate media with %s: not subscribed to user presence"), who); } - purple_notify_error(js->gc, _("Media Initiation Failed"), + purple_notify_error(account, _("Media Initiation Failed"), _("Media Initiation Failed"), msg); g_free(msg); return FALSE; @@ -2723,7 +2722,7 @@ gboolean result; jbr = jb->resources->data; name = g_strdup_printf("%s/%s", who, jbr->name); - result = jabber_initiate_media(gc, name, type); + result = jabber_initiate_media(account, name, type); g_free(name); return result; } else { @@ -2743,7 +2742,7 @@ PurpleMediaCaps caps; gchar *name; name = g_strdup_printf("%s/%s", who, ljbr->name); - caps = jabber_get_media_caps(gc, name); + caps = jabber_get_media_caps(account, name); g_free(name); if ((type & PURPLE_MEDIA_AUDIO) && @@ -2778,7 +2777,7 @@ gboolean result; purple_request_field_destroy(field); name = g_strdup_printf("%s/%s", who, jbr->name); - result = jabber_initiate_media(gc, name, type); + result = jabber_initiate_media(account, name, type); g_free(name); return result; } @@ -2787,17 +2786,17 @@ fields = purple_request_fields_new(); group = purple_request_field_group_new(NULL); request = g_new0(JabberMediaRequest, 1); - request->pc = gc; + request->account = account; request->who = g_strdup(who); request->type = type; purple_request_field_group_add_field(group, field); purple_request_fields_add_group(fields, group); - purple_request_fields(gc, _("Select a Resource"), msg, NULL, - fields, _("Initiate Media"), + purple_request_fields(account, _("Select a Resource"), msg, + NULL, fields, _("Initiate Media"), G_CALLBACK(jabber_media_ok_cb), _("Cancel"), G_CALLBACK(jabber_media_cancel_cb), - gc->account, who, NULL, request); + account, who, NULL, request); g_free(msg); return TRUE; @@ -2806,10 +2805,11 @@ return FALSE; } -PurpleMediaCaps jabber_get_media_caps(PurpleConnection *gc, const char *who) +PurpleMediaCaps jabber_get_media_caps(PurpleAccount *account, const char *who) { #ifdef USE_VV - JabberStream *js = (JabberStream *) gc->proto_data; + JabberStream *js = (JabberStream *) + purple_account_get_connection(account)->proto_data; JabberBuddy *jb; JabberBuddyResource *jbr; PurpleMediaCaps caps = PURPLE_MEDIA_CAPS_NONE; @@ -2875,7 +2875,7 @@ gchar *name; jbr = jb->resources->data; name = g_strdup_printf("%s/%s", who, jbr->name); - caps = jabber_get_media_caps(gc, name); + caps = jabber_get_media_caps(account, name); g_free(name); } else { /* we've got multiple resources, combine their caps */ @@ -2886,7 +2886,7 @@ gchar *name; jbr = l->data; name = g_strdup_printf("%s/%s", who, jbr->name); - caps |= jabber_get_media_caps(gc, name); + caps |= jabber_get_media_caps(account, name); g_free(name); } } diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/jabber/jabber.h --- a/libpurple/protocols/jabber/jabber.h Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/protocols/jabber/jabber.h Sat Apr 11 04:34:47 2009 +0000 @@ -324,9 +324,9 @@ gboolean jabber_offline_message(const PurpleBuddy *buddy); int jabber_prpl_send_raw(PurpleConnection *gc, const char *buf, int len); GList *jabber_actions(PurplePlugin *plugin, gpointer context); -gboolean jabber_initiate_media(PurpleConnection *gc, const char *who, +gboolean jabber_initiate_media(PurpleAccount *account, const char *who, PurpleMediaSessionType type); -PurpleMediaCaps jabber_get_media_caps(PurpleConnection *gc, const char *who); +PurpleMediaCaps jabber_get_media_caps(PurpleAccount *account, const char *who); void jabber_register_commands(void); void jabber_init_plugin(PurplePlugin *plugin); diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/jabber/jingle/rtp.c --- a/libpurple/protocols/jabber/jingle/rtp.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/protocols/jabber/jingle/rtp.c Sat Apr 11 04:34:47 2009 +0000 @@ -204,8 +204,9 @@ { JabberStream *js = jingle_session_get_js(session); PurpleMedia *media = NULL; - GList *iter = purple_media_manager_get_media_by_connection( - purple_media_manager_get(), js->gc); + GList *iter = purple_media_manager_get_media_by_account( + purple_media_manager_get(), + purple_connection_get_account(js->gc)); for (; iter; iter = g_list_delete_link(iter, iter)) { JingleSession *media_session = @@ -466,6 +467,9 @@ { purple_debug_info("jingle-rtp", "stream-info: type %d " "id: %s name: %s\n", type, sid, name); + + g_return_if_fail(JINGLE_IS_SESSION(session)); + if (type == PURPLE_MEDIA_INFO_HANGUP) { jabber_iq_send(jingle_session_terminate_packet( session, "success")); @@ -518,9 +522,11 @@ JabberStream *js = jingle_session_get_js(session); gchar *remote_jid = jingle_session_get_remote_jid(session); - PurpleMedia *media = purple_media_manager_create_media(purple_media_manager_get(), - js->gc, "fsrtpconference", remote_jid, - jingle_session_is_initiator(session)); + PurpleMedia *media = purple_media_manager_create_media( + purple_media_manager_get(), + purple_connection_get_account(js->gc), + "fsrtpconference", remote_jid, + jingle_session_is_initiator(session)); g_free(remote_jid); if (!media) { diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/msn/Makefile.am diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/msn/msg.c --- a/libpurple/protocols/msn/msg.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/protocols/msn/msg.c Sat Apr 11 04:34:47 2009 +0000 @@ -984,3 +984,67 @@ g_hash_table_destroy(body); } +void +msn_invite_msg(MsnCmdProc *cmdproc, MsnMessage *msg) +{ + GHashTable *body; + const gchar *guid; + + g_return_if_fail(cmdproc != NULL); + g_return_if_fail(msg != NULL); + + body = msn_message_get_hashtable_from_body(msg); + + if (body == NULL) { + purple_debug_warning("msn", + "Unable to parse invite msg body.\n"); + return; + } + + guid = g_hash_table_lookup(body, "Application-GUID"); + + if (guid == NULL) { + const gchar *cmd = g_hash_table_lookup( + body, "Invitation-Command"); + + if (cmd && !strcmp(cmd, "CANCEL")) { + const gchar *code = g_hash_table_lookup( + body, "Cancel-Code"); + purple_debug_info("msn", + "MSMSGS invitation cancelled: %s.\n", + code ? code : "no reason given"); + } else + purple_debug_warning("msn", "Invite msg missing " + "Application-GUID.\n"); + } else if (!strcmp(guid, "{02D3C01F-BF30-4825-A83A-DE7AF41648AA}")) { + purple_debug_info("msn", "Computer call\n"); + + if (cmdproc->session) { + PurpleConversation *conv = NULL; + gchar *from = msg->remote_user; + gchar *buf = NULL; + + if (from) + conv = purple_find_conversation_with_account( + PURPLE_CONV_TYPE_IM, from, + cmdproc->session->account); + if (conv) + buf = g_strdup_printf( + _("%s sent you a voice chat " + "invite, which is not yet " + "supported."), from); + if (buf) { + purple_conversation_write(conv, NULL, buf, + PURPLE_MESSAGE_SYSTEM | + PURPLE_MESSAGE_NOTIFY, + time(NULL)); + g_free(buf); + } + } + } else + purple_debug_warning("msn", + "Unhandled invite msg with GUID %s.\n", guid); + + g_hash_table_destroy(body); +} + diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/msn/msn.h --- a/libpurple/protocols/msn/msn.h Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/protocols/msn/msn.h Sat Apr 11 04:34:47 2009 +0000 @@ -76,6 +76,8 @@ #define BUDDY_ALIAS_MAXLEN 387 +#define MSN_CAM_GUID "4BD96FC0-AB17-4425-A14A-439185962DC8" +#define MSN_CAM_REQUEST_GUID "1C9AA97E-9C05-4583-A3BD-908A196F1E92" #define MSN_FT_GUID "5D3E02AB-6190-11D3-BBBB-00C04F795683" #define MSN_OBJ_GUID "A4268EEC-FEC5-49E5-95C3-F126696BDBF6" diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/msn/session.c --- a/libpurple/protocols/msn/session.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/protocols/msn/session.c Sat Apr 11 04:34:47 2009 +0000 @@ -303,7 +303,7 @@ for (l = remote_user->group_ids; l != NULL; l = l->next) { const char *name = msn_userlist_find_group_name(remote_user->userlist, l->data); - if (name && !g_strcasecmp(group_name, name)) + if (name && !g_ascii_strcasecmp(group_name, name)) { found = TRUE; break; diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/msn/slp.c --- a/libpurple/protocols/msn/slp.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/protocols/msn/slp.c Sat Apr 11 04:34:47 2009 +0000 @@ -377,6 +377,50 @@ purple_xfer_request(xfer); } + } else if (!strcmp(euf_guid, MSN_CAM_REQUEST_GUID)) { + purple_debug_info("msn", "Cam request.\n"); + if (slpcall && slpcall->slplink && + slpcall->slplink->session) { + PurpleConversation *conv; + gchar *from = slpcall->slplink->remote_user; + conv = purple_find_conversation_with_account( + PURPLE_CONV_TYPE_IM, from, + slpcall->slplink->session->account); + if (conv) { + char *buf; + buf = g_strdup_printf( + _("%s requests to view your " + "webcam, but this request is " + "not yet supported."), from); + purple_conversation_write(conv, NULL, buf, + PURPLE_MESSAGE_SYSTEM | + PURPLE_MESSAGE_NOTIFY, + time(NULL)); + g_free(buf); + } + } + } else if (!strcmp(euf_guid, MSN_CAM_GUID)) { + purple_debug_info("msn", "Cam invite.\n"); + if (slpcall && slpcall->slplink && + slpcall->slplink->session) { + PurpleConversation *conv; + gchar *from = slpcall->slplink->remote_user; + conv = purple_find_conversation_with_account( + PURPLE_CONV_TYPE_IM, from, + slpcall->slplink->session->account); + if (conv) { + char *buf; + buf = g_strdup_printf( + _("%s has sent you a webcam " + "invite, which is not yet " + "supported."), from); + purple_conversation_write(conv, NULL, buf, + PURPLE_MESSAGE_SYSTEM | + PURPLE_MESSAGE_NOTIFY, + time(NULL)); + g_free(buf); + } + } } else purple_debug_warning("msn", "SLP SessionReq with unknown EUF-GUID: %s\n", euf_guid); } diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/msn/slplink.c --- a/libpurple/protocols/msn/slplink.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/protocols/msn/slplink.c Sat Apr 11 04:34:47 2009 +0000 @@ -46,7 +46,7 @@ pload = msn_message_gen_payload(msg, &pload_size); if (!purple_util_write_data_to_file_absolute(tmp, pload, pload_size)) { - purple_debug_error("msn", "could not save debug file"); + purple_debug_error("msn", "could not save debug file\n"); } g_free(tmp); } @@ -682,7 +682,9 @@ size = st.st_size; if(!file_name) { - u8 = purple_utf8_try_convert(g_basename(file_path)); + base = g_path_get_basename(file_path); + u8 = purple_utf8_try_convert(base); + g_free(base); file_name = u8; } diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/msn/switchboard.c --- a/libpurple/protocols/msn/switchboard.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/protocols/msn/switchboard.c Sat Apr 11 04:34:47 2009 +0000 @@ -1237,10 +1237,8 @@ msn_emoticon_msg); msn_table_add_msg_type(cbs_table, "text/x-msnmsgr-datacast", msn_datacast_msg); -#if 0 - msn_table_add_msg_type(cbs_table, "text/x-msmmsginvite", + msn_table_add_msg_type(cbs_table, "text/x-msmsgsinvite", msn_invite_msg); -#endif } void diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/msn/userlist.c --- a/libpurple/protocols/msn/userlist.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/protocols/msn/userlist.c Sat Apr 11 04:34:47 2009 +0000 @@ -448,7 +448,7 @@ g_return_val_if_fail(user->passport != NULL, NULL); - if (!g_strcasecmp(passport, user->passport)){ + if (!g_ascii_strcasecmp(passport, user->passport)){ return user; } } @@ -470,7 +470,7 @@ continue; } - if ( !g_strcasecmp(uid, user->uid) ) { + if ( !g_ascii_strcasecmp(uid, user->uid) ) { return user; } } @@ -492,7 +492,7 @@ continue; } - if (!g_strcasecmp(number, user->phone.mobile)) { + if (!g_ascii_strcasecmp(number, user->phone.mobile)) { return user; } } @@ -524,7 +524,7 @@ { MsnGroup *group = l->data; - if (!g_strcasecmp(group->id,id)) + if (!g_ascii_strcasecmp(group->id,id)) return group; } @@ -543,7 +543,7 @@ { MsnGroup *group = l->data; - if ((group->name != NULL) && !g_strcasecmp(name, group->name)) + if ((group->name != NULL) && !g_ascii_strcasecmp(name, group->name)) return group; } @@ -784,7 +784,7 @@ { user = (MsnUser *)l->data; - if (!g_strcasecmp(who, user->passport)) { + if (!g_ascii_strcasecmp(who, user->passport)) { userlist->pending = g_list_delete_link(userlist->pending, l); break; } diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/msnp9/Makefile.am diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/msnp9/httpconn.c --- a/libpurple/protocols/msnp9/httpconn.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/protocols/msnp9/httpconn.c Sat Apr 11 04:34:47 2009 +0000 @@ -703,7 +703,7 @@ httpconn->inpa = purple_input_add(httpconn->fd, PURPLE_INPUT_READ, read_cb, data); - httpconn->timer = purple_timeout_add(2000, msn_httpconn_poll, httpconn); + httpconn->timer = purple_timeout_add_seconds(3, msn_httpconn_poll, httpconn); msn_httpconn_process_queue(httpconn); } diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/msnp9/slp.c --- a/libpurple/protocols/msnp9/slp.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/protocols/msnp9/slp.c Sat Apr 11 04:34:47 2009 +0000 @@ -33,8 +33,8 @@ #include "smiley.h" -/* ms to delay between sending buddy icon requests to the server. */ -#define BUDDY_ICON_DELAY 20000 +/* Seconds to delay between sending buddy icon requests to the server. */ +#define BUDDY_ICON_DELAY 20 static void send_ok(MsnSlpCall *slpcall, const char *branch, const char *type, const char *content); @@ -1058,8 +1058,8 @@ purple_timeout_remove(userlist->buddy_icon_request_timer); } - /* Wait BUDDY_ICON_DELAY ms before freeing our window slot and requesting the next icon. */ - userlist->buddy_icon_request_timer = purple_timeout_add(BUDDY_ICON_DELAY, + /* Wait BUDDY_ICON_DELAY_S seconds before freeing our window slot and requesting the next icon. */ + userlist->buddy_icon_request_timer = purple_timeout_add_seconds(BUDDY_ICON_DELAY, msn_release_buddy_icon_request_timeout, userlist); } diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/msnp9/slpcall.c --- a/libpurple/protocols/msnp9/slpcall.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/protocols/msnp9/slpcall.c Sat Apr 11 04:34:47 2009 +0000 @@ -68,7 +68,7 @@ msn_slplink_add_slpcall(slplink, slpcall); - slpcall->timer = purple_timeout_add(MSN_SLPCALL_TIMEOUT, msn_slp_call_timeout, slpcall); + slpcall->timer = purple_timeout_add_seconds(MSN_SLPCALL_TIMEOUT, msn_slp_call_timeout, slpcall); return slpcall; } diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/msnp9/slpcall.h --- a/libpurple/protocols/msnp9/slpcall.h Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/protocols/msnp9/slpcall.h Sat Apr 11 04:34:47 2009 +0000 @@ -33,7 +33,7 @@ #include "slpsession.h" /* The official client seems to timeout slp calls after 5 minutes */ -#define MSN_SLPCALL_TIMEOUT 300000 +#define MSN_SLPCALL_TIMEOUT 300 typedef enum { diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/msnp9/transaction.c --- a/libpurple/protocols/msnp9/transaction.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/protocols/msnp9/transaction.c Sat Apr 11 04:34:47 2009 +0000 @@ -211,7 +211,7 @@ purple_timeout_remove(trans->timer); } trans->timeout_cb = cb; - trans->timer = purple_timeout_add(60000, transaction_timeout, trans); + trans->timer = purple_timeout_add_seconds(60, transaction_timeout, trans); } void diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/myspace/Makefile.am diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/myspace/myspace.c --- a/libpurple/protocols/myspace/myspace.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/protocols/myspace/myspace.c Sat Apr 11 04:34:47 2009 +0000 @@ -1245,7 +1245,7 @@ /* Disable due to problems with timeouts. TODO: fix. */ #ifdef MSIM_USE_KEEPALIVE - purple_timeout_add(MSIM_KEEPALIVE_INTERVAL_CHECK, + purple_timeout_add_seconds(MSIM_KEEPALIVE_INTERVAL_CHECK, (GSourceFunc)msim_check_alive, session); #endif diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/myspace/myspace.h --- a/libpurple/protocols/myspace/myspace.h Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/protocols/myspace/myspace.h Sat Apr 11 04:34:47 2009 +0000 @@ -114,8 +114,8 @@ #define MSIM_KEEPALIVE_INTERVAL (3 * 60) /*#define MSIM_USE_KEEPALIVE*/ -/* Time to check if alive (milliseconds) */ -#define MSIM_KEEPALIVE_INTERVAL_CHECK (30 * 1000) +/* Time to check if alive (seconds) */ +#define MSIM_KEEPALIVE_INTERVAL_CHECK 30 /* Time to check for new mail (milliseconds) */ #define MSIM_MAIL_INTERVAL_CHECK (60 * 1000) diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/novell/Makefile.am diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/oscar/Makefile.am diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/oscar/oscar.c --- a/libpurple/protocols/oscar/oscar.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/protocols/oscar/oscar.c Sat Apr 11 04:34:47 2009 +0000 @@ -1268,7 +1268,7 @@ aim_ssi_reqdata(od); if (od->getblisttimer > 0) purple_timeout_remove(od->getblisttimer); - od->getblisttimer = purple_timeout_add(30000, purple_ssi_rerequestdata, od); + od->getblisttimer = purple_timeout_add_seconds(30, purple_ssi_rerequestdata, od); aim_locate_reqrights(od); aim_buddylist_reqrights(od, conn); @@ -5047,7 +5047,7 @@ _("The AIM servers were temporarily unable to send " "your buddy list. Your buddy list is not lost, and " "will probably become available in a few minutes.")); - od->getblisttimer = purple_timeout_add(30000, purple_ssi_rerequestdata, od); + od->getblisttimer = purple_timeout_add_seconds(30, purple_ssi_rerequestdata, od); return 1; } diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/oscar/peer.c --- a/libpurple/protocols/oscar/peer.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/protocols/oscar/peer.c Sat Apr 11 04:34:47 2009 +0000 @@ -812,7 +812,7 @@ (conn->client_connect_data != NULL)) { /* Connecting... */ - conn->connect_timeout_timer = purple_timeout_add(5000, + conn->connect_timeout_timer = purple_timeout_add_seconds(5, peer_connection_tooktoolong, conn); return; } diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/qq/Makefile.am diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/sametime/Makefile.am diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/sametime/sametime.c --- a/libpurple/protocols/sametime/sametime.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/protocols/sametime/sametime.c Sat Apr 11 04:34:47 2009 +0000 @@ -28,8 +28,6 @@ /* glib includes */ #include -#include -#include /* purple includes */ #include "internal.h" @@ -810,7 +808,7 @@ static void blist_schedule(struct mwPurplePluginData *pd) { if(pd->save_event) return; - pd->save_event = purple_timeout_add(BLIST_SAVE_SECONDS * 1000, + pd->save_event = purple_timeout_add_seconds(BLIST_SAVE_SECONDS, blist_save_cb, pd); } diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/silc/Makefile.am diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/simple/Makefile.am diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/yahoo/Makefile.am diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/yahoo/yahoo.c --- a/libpurple/protocols/yahoo/yahoo.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/protocols/yahoo/yahoo.c Sat Apr 11 04:34:47 2009 +0000 @@ -2829,6 +2829,7 @@ p2p_data->host_username = g_strdup(who); p2p_data->val_13 = val_13; p2p_data->connection_type = YAHOO_P2P_WE_ARE_SERVER; + p2p_data->source = -1; purple_network_listen(YAHOO_PAGER_PORT_P2P, SOCK_STREAM, yahoo_p2p_server_listen_cb, p2p_data); @@ -2932,10 +2933,9 @@ if (base64) { guint32 ip; - char *tmp2; YahooFriend *f; char *host_ip; - struct yahoo_p2p_data *p2p_data = g_new0(struct yahoo_p2p_data, 1); + struct yahoo_p2p_data *p2p_data; decoded = purple_base64_decode(base64, &len); if (len) { @@ -2944,9 +2944,7 @@ g_free(tmp); } - tmp2 = g_strndup((const gchar *)decoded, len); /* so its \0 terminated...*/ - ip = strtol(tmp2, NULL, 10); - g_free(tmp2); + ip = strtol((gchar *)decoded, NULL, 10); g_free(decoded); host_ip = g_strdup_printf("%u.%u.%u.%u", ip & 0xff, (ip >> 8) & 0xff, (ip >> 16) & 0xff, (ip >> 24) & 0xff); @@ -2964,12 +2962,14 @@ val_11 = f->session_id; } - p2p_data->host_username = g_strdup(who); + p2p_data = g_new0(struct yahoo_p2p_data, 1); + p2p_data->host_username = g_strdup(who); p2p_data->val_13 = val_13; p2p_data->session_id = val_11; p2p_data->host_ip = host_ip; p2p_data->gc = gc; p2p_data->connection_type = YAHOO_P2P_WE_ARE_CLIENT; + p2p_data->source = -1; /* connect to host */ if((purple_proxy_connect(NULL, account, host_ip, YAHOO_PAGER_PORT_P2P, yahoo_p2p_init_cb, p2p_data))==NULL) { diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/zephyr/Makefile.am diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/zephyr/ZVariables.c --- a/libpurple/protocols/zephyr/ZVariables.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/protocols/zephyr/ZVariables.c Sat Apr 11 04:34:47 2009 +0000 @@ -186,7 +186,7 @@ #define max(a,b) ((a > b) ? (a) : (b)) #endif - if (g_strncasecmp(bfr, var, max(strlen(var), cp - bfr))) + if (g_ascii_strncasecmp(bfr, var, max(strlen(var), cp - bfr))) return(0); /* var is not the var in bfr ==> no match */ diff -r d6a31b0ad109 -r d6a863df7884 libpurple/protocols/zephyr/zephyr.c --- a/libpurple/protocols/zephyr/zephyr.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/protocols/zephyr/zephyr.c Sat Apr 11 04:34:47 2009 +0000 @@ -960,7 +960,7 @@ tc = tree_child(ptree,0)->contents; /* g_strcasecmp() is deprecated. What is the encoding here??? */ - if (ptree->num_children > 0 && tc && !g_strcasecmp(tc, key)) { + if (ptree->num_children > 0 && tc && !g_ascii_strcasecmp(tc, key)) { return ptree; } else { parse_tree *result = &null_parse_tree; @@ -1880,7 +1880,7 @@ } else if (use_tzc(zephyr)) { zephyr->nottimer = purple_timeout_add(100, check_notify_tzc, gc); } - zephyr->loctimer = purple_timeout_add(20000, check_loc, gc); + zephyr->loctimer = purple_timeout_add_seconds(20, check_loc, gc); } diff -r d6a31b0ad109 -r d6a863df7884 libpurple/prpl.c --- a/libpurple/prpl.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/prpl.c Sat Apr 11 04:34:47 2009 +0000 @@ -515,7 +515,7 @@ if (prpl_info && PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, initiate_media)) { /* should check that the protocol supports this media type here? */ - return prpl_info->initiate_media(gc, who, type); + return prpl_info->initiate_media(account, who, type); } else #endif return FALSE; @@ -538,7 +538,7 @@ if (prpl_info && PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, get_media_caps)) { - return prpl_info->get_media_caps(gc, who); + return prpl_info->get_media_caps(account, who); } #endif return PURPLE_MEDIA_CAPS_NONE; diff -r d6a31b0ad109 -r d6a863df7884 libpurple/prpl.h --- a/libpurple/prpl.h Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/prpl.h Sat Apr 11 04:34:47 2009 +0000 @@ -464,22 +464,22 @@ /** * Initiate a media session with the given contact. * - * @param conn The connection to initiate the media session on. + * @param account The account to initiate the media session on. * @param who The remote user to initiate the session with. * @param type The type of media session to initiate. * @return TRUE if the call succeeded else FALSE. (Doesn't imply the media session or stream will be successfully created) */ - gboolean (*initiate_media)(PurpleConnection *gc, const char *who, + gboolean (*initiate_media)(PurpleAccount *account, const char *who, PurpleMediaSessionType type); /** * Checks to see if the given contact supports the given type of media session. * - * @param conn The connection the contact is on. + * @param account The account the contact is on. * @param who The remote user to check for media capability with. * @return The media caps the contact supports. */ - PurpleMediaCaps (*get_media_caps)(PurpleConnection *gc, + PurpleMediaCaps (*get_media_caps)(PurpleAccount *account, const char *who); }; diff -r d6a31b0ad109 -r d6a863df7884 libpurple/server.c --- a/libpurple/server.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/server.c Sat Apr 11 04:34:47 2009 +0000 @@ -587,6 +587,11 @@ account = purple_connection_get_account(gc); + /* + * XXX: Should we be setting this here, or relying on prpls to set it? + */ + flags |= PURPLE_MESSAGE_RECV; + if (PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc))->set_permit_deny == NULL) { /* protocol does not support privacy, handle it ourselves */ if (!purple_privacy_check(account, who)) { @@ -630,11 +635,6 @@ if (conv == NULL) conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, name, gc->account); - /* - * XXX: Should we be setting this here, or relying on prpls to set it? - */ - flags |= PURPLE_MESSAGE_RECV; - if (conv == NULL) conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, name); @@ -939,6 +939,14 @@ if (!conv) return; + /* Did I send the message? */ + if (purple_strequal(purple_conv_chat_get_nick(chat), who)) { + flags |= PURPLE_MESSAGE_SEND; + flags &= ~PURPLE_MESSAGE_RECV; /* Just in case some prpl sets it! */ + } else { + flags |= PURPLE_MESSAGE_RECV; + } + /* * Make copies of the message and the sender in case plugins want * to free these strings and replace them with a modifed version. diff -r d6a31b0ad109 -r d6a863df7884 libpurple/win32/win32dep.c --- a/libpurple/win32/win32dep.c Sun Apr 05 21:54:03 2009 +0000 +++ b/libpurple/win32/win32dep.c Sat Apr 11 04:34:47 2009 +0000 @@ -467,7 +467,14 @@ WSACleanup(); g_free(app_data_dir); + g_free(install_dir); + g_free(lib_dir); + g_free(locale_dir); + app_data_dir = NULL; + install_dir = NULL; + lib_dir = NULL; + locale_dir = NULL; libpurpledll_hInstance = NULL; } diff -r d6a31b0ad109 -r d6a863df7884 pidgin/eggtrayicon.h --- a/pidgin/eggtrayicon.h Sun Apr 05 21:54:03 2009 +0000 +++ b/pidgin/eggtrayicon.h Sat Apr 11 04:34:47 2009 +0000 @@ -21,8 +21,7 @@ #ifndef __EGG_TRAY_ICON_H__ #define __EGG_TRAY_ICON_H__ -#include -#include +#include #include G_BEGIN_DECLS diff -r d6a31b0ad109 -r d6a863df7884 pidgin/gtkblist.c --- a/pidgin/gtkblist.c Sun Apr 05 21:54:03 2009 +0000 +++ b/pidgin/gtkblist.c Sat Apr 11 04:34:47 2009 +0000 @@ -5505,6 +5505,7 @@ GtkWidget *sep; GtkWidget *label; char *pretty, *tmp; + const char *theme_name; GtkAccelGroup *accel_group; GtkTreeSelection *selection; GtkTargetEntry dte[] = {{"PURPLE_BLIST_NODE", GTK_TARGET_SAME_APP, DRAG_ROW}, @@ -5523,7 +5524,11 @@ gtkblist = PIDGIN_BLIST(list); priv = PIDGIN_BUDDY_LIST_GET_PRIVATE(gtkblist); - priv->current_theme = PIDGIN_BLIST_THEME(purple_theme_manager_find_theme(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/blist/theme"), "blist")); + theme_name = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/blist/theme"); + if (theme_name && *theme_name) + priv->current_theme = PIDGIN_BLIST_THEME(purple_theme_manager_find_theme(theme_name, "blist")); + else + priv->current_theme = NULL; gtkblist->empty_avatar = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, 32, 32); gdk_pixbuf_fill(gtkblist->empty_avatar, 0x00000000); @@ -5790,7 +5795,7 @@ purple_blist_set_visible(purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/list_visible")); /* start the refresh timer */ - gtkblist->refresh_timer = g_timeout_add(30000, (GSourceFunc)pidgin_blist_refresh_timer, list); + gtkblist->refresh_timer = purple_timeout_add_seconds(30, (GSourceFunc)pidgin_blist_refresh_timer, list); handle = pidgin_blist_get_handle(); @@ -5911,7 +5916,7 @@ blist = purple_get_blist(); gtkblist = PIDGIN_BLIST(purple_get_blist()); - gtkblist->refresh_timer = g_timeout_add(30000,(GSourceFunc)pidgin_blist_refresh_timer, blist); + gtkblist->refresh_timer = purple_timeout_add_seconds(30,(GSourceFunc)pidgin_blist_refresh_timer, blist); } static gboolean get_iter_from_node(PurpleBlistNode *node, GtkTreeIter *iter) { @@ -6632,7 +6637,7 @@ pidgin_blist_tooltip_destroy(); if (gtkblist->refresh_timer) - g_source_remove(gtkblist->refresh_timer); + purple_timeout_remove(gtkblist->refresh_timer); if (gtkblist->timeout) g_source_remove(gtkblist->timeout); if (gtkblist->drag_timeout) @@ -7447,7 +7452,7 @@ if(gtknode->recent_signonoff_timer > 0) purple_timeout_remove(gtknode->recent_signonoff_timer); - gtknode->recent_signonoff_timer = purple_timeout_add(10000, + gtknode->recent_signonoff_timer = purple_timeout_add_seconds(10, (GSourceFunc)buddy_signonoff_timeout_cb, buddy); } diff -r d6a31b0ad109 -r d6a863df7884 pidgin/gtkcellrendererexpander.c --- a/pidgin/gtkcellrendererexpander.c Sun Apr 05 21:54:03 2009 +0000 +++ b/pidgin/gtkcellrendererexpander.c Sat Apr 11 04:34:47 2009 +0000 @@ -30,7 +30,6 @@ */ #include -#include #include "gtkcellrendererexpander.h" static void pidgin_cell_renderer_expander_get_property (GObject *object, diff -r d6a31b0ad109 -r d6a863df7884 pidgin/gtkcellrendererexpander.h --- a/pidgin/gtkcellrendererexpander.h Sun Apr 05 21:54:03 2009 +0000 +++ b/pidgin/gtkcellrendererexpander.h Sat Apr 11 04:34:47 2009 +0000 @@ -21,7 +21,7 @@ #ifndef _PIDGINCELLRENDEREREXPANDER_H_ #define _PIDGINCELLRENDEREREXPANDER_H_ -#include +#include #ifdef __cplusplus extern "C" { diff -r d6a31b0ad109 -r d6a863df7884 pidgin/gtkcellrendererprogress.h --- a/pidgin/gtkcellrendererprogress.h Sun Apr 05 21:54:03 2009 +0000 +++ b/pidgin/gtkcellrendererprogress.h Sat Apr 11 04:34:47 2009 +0000 @@ -21,7 +21,7 @@ #ifndef _PIDGINCELLRENDERERPROGRESS_H_ #define _PIDGINCELLRENDERERPROGRESS_H_ -#include +#include #ifdef __cplusplus extern "C" { diff -r d6a31b0ad109 -r d6a863df7884 pidgin/gtkconv.c --- a/pidgin/gtkconv.c Sun Apr 05 21:54:03 2009 +0000 +++ b/pidgin/gtkconv.c Sat Apr 11 04:34:47 2009 +0000 @@ -7514,7 +7514,7 @@ } /* In case a conversation is started after the buddy has signed-on/off */ - g_timeout_add(11000, (GSourceFunc)update_buddy_status_timeout, buddy); + purple_timeout_add_seconds(11, (GSourceFunc)update_buddy_status_timeout, buddy); } static void diff -r d6a31b0ad109 -r d6a863df7884 pidgin/gtkdebug.c --- a/pidgin/gtkdebug.c Sun Apr 05 21:54:03 2009 +0000 +++ b/pidgin/gtkdebug.c Sat Apr 11 04:34:47 2009 +0000 @@ -94,7 +94,7 @@ if(debug_win->timer != 0) { const gchar *text; - g_source_remove(debug_win->timer); + purple_timeout_remove(debug_win->timer); text = gtk_entry_get_text(GTK_ENTRY(debug_win->expression)); purple_prefs_set_string(PIDGIN_PREFS_ROOT "/debug/regex", text); @@ -552,7 +552,7 @@ } if(win->timer == 0) - win->timer = purple_timeout_add(5000, (GSourceFunc)regex_timer_cb, win); + win->timer = purple_timeout_add_seconds(5, (GSourceFunc)regex_timer_cb, win); regex_compile(win); } diff -r d6a31b0ad109 -r d6a863df7884 pidgin/gtkdnd-hints.h --- a/pidgin/gtkdnd-hints.h Sun Apr 05 21:54:03 2009 +0000 +++ b/pidgin/gtkdnd-hints.h Sat Apr 11 04:34:47 2009 +0000 @@ -25,7 +25,7 @@ #define _PIDGIN_DND_HINTS_H_ #include -#include +#include /** * Conversation drag-and-drop arrow types. diff -r d6a31b0ad109 -r d6a863df7884 pidgin/gtkimhtml.c --- a/pidgin/gtkimhtml.c Sun Apr 05 21:54:03 2009 +0000 +++ b/pidgin/gtkimhtml.c Sat Apr 11 04:34:47 2009 +0000 @@ -45,7 +45,7 @@ #include "gtksourceundomanager.h" #include "gtksourceview-marshal.h" #include -#include +#include #include #include #include diff -r d6a31b0ad109 -r d6a863df7884 pidgin/gtkimhtml.h --- a/pidgin/gtkimhtml.h Sun Apr 05 21:54:03 2009 +0000 +++ b/pidgin/gtkimhtml.h Sat Apr 11 04:34:47 2009 +0000 @@ -26,9 +26,7 @@ #define _PIDGINIMHTML_H_ #include -#include -#include -#include +#include #include "gtksourceundomanager.h" #include "connection.h" diff -r d6a31b0ad109 -r d6a863df7884 pidgin/gtkimhtmltoolbar.c diff -r d6a31b0ad109 -r d6a863df7884 pidgin/gtkimhtmltoolbar.h --- a/pidgin/gtkimhtmltoolbar.h Sun Apr 05 21:54:03 2009 +0000 +++ b/pidgin/gtkimhtmltoolbar.h Sat Apr 11 04:34:47 2009 +0000 @@ -23,7 +23,7 @@ #ifndef _PIDGINIMHTMLTOOLBAR_H_ #define _PIDGINIMHTMLTOOLBAR_H_ -#include +#include #include "gtkimhtml.h" #ifdef __cplusplus diff -r d6a31b0ad109 -r d6a863df7884 pidgin/gtkmain.c --- a/pidgin/gtkmain.c Sun Apr 05 21:54:03 2009 +0000 +++ b/pidgin/gtkmain.c Sat Apr 11 04:34:47 2009 +0000 @@ -787,7 +787,7 @@ DBusMessage *message = dbus_message_new_method_call(DBUS_SERVICE_PURPLE, DBUS_PATH_PURPLE, DBUS_INTERFACE_PURPLE, "PurpleBlistSetVisible"); gboolean tr = TRUE; - dbus_message_append_args(message, DBUS_TYPE_UINT32, &tr, DBUS_TYPE_INVALID); + dbus_message_append_args(message, DBUS_TYPE_INT32, &tr, DBUS_TYPE_INVALID); dbus_connection_send_with_reply_and_block(conn, message, -1, NULL); dbus_message_unref(message); #endif diff -r d6a31b0ad109 -r d6a863df7884 pidgin/gtkmedia.c --- a/pidgin/gtkmedia.c Sun Apr 05 21:54:03 2009 +0000 +++ b/pidgin/gtkmedia.c Sat Apr 11 04:34:47 2009 +0000 @@ -97,7 +97,6 @@ GtkWidget *recv_widget; GtkWidget *local_video; GtkWidget *remote_video; - PurpleConnection *pc; guint timeout_id; PurpleMediaSessionType request_type; @@ -432,7 +431,7 @@ { PurpleConversation *conv = purple_find_conversation_with_account( PURPLE_CONV_TYPE_ANY, gtkmedia->priv->screenname, - purple_connection_get_account(gtkmedia->priv->pc)); + purple_media_get_account(gtkmedia->priv->media)); if (conv != NULL) purple_conversation_write(conv, NULL, msg, PURPLE_MESSAGE_SYSTEM, time(NULL)); @@ -476,7 +475,7 @@ { PurpleConversation *conv = purple_find_conversation_with_account( PURPLE_CONV_TYPE_ANY, gtkmedia->priv->screenname, - purple_connection_get_account(gtkmedia->priv->pc)); + purple_media_get_account(gtkmedia->priv->media)); if (conv != NULL) purple_conversation_write(conv, NULL, error, PURPLE_MESSAGE_ERROR, time(NULL)); @@ -495,25 +494,6 @@ gtk_widget_show(GTK_WIDGET(gtkmedia)); } -static gboolean -plug_delete_event_cb(GtkWidget *widget, gpointer data) -{ - return TRUE; -} - -static gboolean -plug_removed_cb(GtkWidget *widget, gpointer data) -{ - return TRUE; -} - -static void -socket_realize_cb(GtkWidget *widget, gpointer data) -{ - gtk_socket_add_id(GTK_SOCKET(widget), - gtk_plug_get_id(GTK_PLUG(data))); -} - static void pidgin_media_accept_cb(PurpleMedia *media, int index) { @@ -531,15 +511,14 @@ static gboolean pidgin_request_timeout_cb(PidginMedia *gtkmedia) { - PurpleConnection *pc; + PurpleAccount *account; PurpleBuddy *buddy; const gchar *alias; PurpleMediaSessionType type; gchar *message = NULL; - pc = purple_media_get_connection(gtkmedia->priv->media); - buddy = purple_find_buddy(purple_connection_get_account(pc), - gtkmedia->priv->screenname); + account = purple_media_get_account(gtkmedia->priv->media); + buddy = purple_find_buddy(account, gtkmedia->priv->screenname); alias = buddy ? purple_buddy_get_contact_alias(buddy) : gtkmedia->priv->screenname; type = gtkmedia->priv->request_type; @@ -560,7 +539,7 @@ purple_request_accept_cancel(gtkmedia, "Media invitation", message, NULL, PURPLE_DEFAULT_ACTION_NONE, - (void*)pc, gtkmedia->priv->screenname, NULL, + (void*)account, gtkmedia->priv->screenname, NULL, gtkmedia->priv->media, pidgin_media_accept_cb, pidgin_media_reject_cb); @@ -570,21 +549,97 @@ } static void +#if GTK_CHECK_VERSION(2,12,0) +pidgin_media_input_volume_changed(GtkScaleButton *range, double value, + PurpleMedia *media) +{ + double val = (double)value * 100.0; +#else pidgin_media_input_volume_changed(GtkRange *range, PurpleMedia *media) { double val = (double)gtk_range_get_value(GTK_RANGE(range)); +#endif purple_prefs_set_int("/pidgin/media/audio/volume/input", val); - val /= 10.0; - purple_media_set_input_volume(media, NULL, val); + purple_media_set_input_volume(media, NULL, val / 10.0); } static void +#if GTK_CHECK_VERSION(2,12,0) +pidgin_media_output_volume_changed(GtkScaleButton *range, double value, + PurpleMedia *media) +{ + double val = (double)value * 100.0; +#else pidgin_media_output_volume_changed(GtkRange *range, PurpleMedia *media) { double val = (double)gtk_range_get_value(GTK_RANGE(range)); +#endif purple_prefs_set_int("/pidgin/media/audio/volume/output", val); - val /= 10.0; - purple_media_set_output_volume(media, NULL, NULL, val); + purple_media_set_output_volume(media, NULL, NULL, val / 10.0); +} + +static GtkWidget * +pidgin_media_add_audio_widget(PidginMedia *gtkmedia, + PurpleMediaSessionType type) +{ + GtkWidget *volume_widget, *progress_parent, *volume, *progress; + double value; + + if (type & PURPLE_MEDIA_SEND_AUDIO) { + value = purple_prefs_get_int( + "/pidgin/media/audio/volume/input"); + } else if (type & PURPLE_MEDIA_RECV_AUDIO) { + value = purple_prefs_get_int( + "/pidgin/media/audio/volume/output"); + } else + g_return_val_if_reached(NULL); + +#if GTK_CHECK_VERSION(2,12,0) + /* Setup widget structure */ + volume_widget = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); + progress_parent = gtk_vbox_new(FALSE, 0); + gtk_box_pack_start(GTK_BOX(volume_widget), + progress_parent, TRUE, TRUE, 0); + + /* Volume button */ + volume = gtk_volume_button_new(); + gtk_scale_button_set_value(GTK_SCALE_BUTTON(volume), value/100.0); + gtk_box_pack_end(GTK_BOX(volume_widget), + volume, FALSE, FALSE, 0); +#else + /* Setup widget structure */ + volume_widget = gtk_vbox_new(FALSE, 0); + progress_parent = volume_widget; + + /* Volume slider */ + volume = gtk_hscale_new_with_range(0.0, 100.0, 5.0); + gtk_range_set_increments(GTK_RANGE(volume), 5.0, 25.0); + gtk_range_set_value(GTK_RANGE(volume), value); + gtk_scale_set_draw_value(GTK_SCALE(volume), FALSE); + gtk_box_pack_end(GTK_BOX(volume_widget), + volume, TRUE, FALSE, 0); +#endif + + /* Volume level indicator */ + progress = gtk_progress_bar_new(); + gtk_widget_set_size_request(progress, 250, 10); + gtk_box_pack_end(GTK_BOX(progress_parent), progress, TRUE, FALSE, 0); + + if (type & PURPLE_MEDIA_SEND_AUDIO) { + g_signal_connect (G_OBJECT(volume), "value-changed", + G_CALLBACK(pidgin_media_input_volume_changed), + gtkmedia->priv->media); + gtkmedia->priv->send_progress = progress; + } else if (type & PURPLE_MEDIA_RECV_AUDIO) { + g_signal_connect (G_OBJECT(volume), "value-changed", + G_CALLBACK(pidgin_media_output_volume_changed), + gtkmedia->priv->media); + gtkmedia->priv->recv_progress = progress; + } + + gtk_widget_show_all(volume_widget); + + return volume_widget; } static void @@ -619,27 +674,12 @@ PidginMediaRealizeData *data; GtkWidget *aspect; GtkWidget *remote_video; - GtkWidget *plug; - GtkWidget *socket; GdkColor color = {0, 0, 0, 0}; aspect = gtk_aspect_frame_new(NULL, 0.5, 0.5, 4.0/3.0, FALSE); gtk_frame_set_shadow_type(GTK_FRAME(aspect), GTK_SHADOW_IN); gtk_box_pack_start(GTK_BOX(recv_widget), aspect, TRUE, TRUE, 0); - plug = gtk_plug_new(0); - g_signal_connect(G_OBJECT(plug), "delete-event", - G_CALLBACK(plug_delete_event_cb), plug); - gtk_widget_show(plug); - - socket = gtk_socket_new(); - g_signal_connect(G_OBJECT(socket), "realize", - G_CALLBACK(socket_realize_cb), plug); - g_signal_connect(G_OBJECT(socket), "plug-removed", - G_CALLBACK(plug_removed_cb), NULL); - gtk_container_add(GTK_CONTAINER(aspect), socket); - gtk_widget_show(socket); - data = g_new0(PidginMediaRealizeData, 1); data->gtkmedia = gtkmedia; data->session_id = g_strdup(sid); @@ -649,7 +689,7 @@ gtk_widget_modify_bg(remote_video, GTK_STATE_NORMAL, &color); g_signal_connect(G_OBJECT(remote_video), "realize", G_CALLBACK(realize_cb), data); - gtk_container_add(GTK_CONTAINER(plug), remote_video); + gtk_container_add(GTK_CONTAINER(aspect), remote_video); gtk_widget_set_size_request (GTK_WIDGET(remote_video), 320, 240); gtk_widget_show(remote_video); gtk_widget_show(aspect); @@ -660,27 +700,12 @@ PidginMediaRealizeData *data; GtkWidget *aspect; GtkWidget *local_video; - GtkWidget *plug; - GtkWidget *socket; GdkColor color = {0, 0, 0, 0}; aspect = gtk_aspect_frame_new(NULL, 0.5, 0.5, 4.0/3.0, FALSE); gtk_frame_set_shadow_type(GTK_FRAME(aspect), GTK_SHADOW_IN); gtk_box_pack_start(GTK_BOX(send_widget), aspect, TRUE, TRUE, 0); - plug = gtk_plug_new(0); - g_signal_connect(G_OBJECT(plug), "delete-event", - G_CALLBACK(plug_delete_event_cb), plug); - gtk_widget_show(plug); - - socket = gtk_socket_new(); - g_signal_connect(G_OBJECT(socket), "realize", - G_CALLBACK(socket_realize_cb), plug); - g_signal_connect(G_OBJECT(socket), "plug-removed", - G_CALLBACK(plug_removed_cb), NULL); - gtk_container_add(GTK_CONTAINER(aspect), socket); - gtk_widget_show(socket); - data = g_new0(PidginMediaRealizeData, 1); data->gtkmedia = gtkmedia; data->session_id = g_strdup(sid); @@ -690,7 +715,7 @@ gtk_widget_modify_bg(local_video, GTK_STATE_NORMAL, &color); g_signal_connect(G_OBJECT(local_video), "realize", G_CALLBACK(realize_cb), data); - gtk_container_add(GTK_CONTAINER(plug), local_video); + gtk_container_add(GTK_CONTAINER(aspect), local_video); gtk_widget_set_size_request (GTK_WIDGET(local_video), 160, 120); gtk_widget_show(local_video); @@ -700,28 +725,13 @@ } if (type & PURPLE_MEDIA_RECV_AUDIO) { - GtkWidget *volume = gtk_hscale_new_with_range(0.0, 100.0, 5.0); - gtk_range_set_increments(GTK_RANGE(volume), 5.0, 25.0); - gtk_range_set_value(GTK_RANGE(volume), - purple_prefs_get_int( - "/pidgin/media/audio/volume/output")); - gtk_scale_set_draw_value(GTK_SCALE(volume), FALSE); - g_signal_connect (G_OBJECT(volume), "value-changed", - G_CALLBACK(pidgin_media_output_volume_changed), - media); gtk_box_pack_end(GTK_BOX(recv_widget), - volume, FALSE, FALSE, 0); - gtk_widget_show(volume); - - gtkmedia->priv->recv_progress = gtk_progress_bar_new(); - gtk_widget_set_size_request(gtkmedia->priv->recv_progress, 320, 10); - gtk_box_pack_end(GTK_BOX(recv_widget), - gtkmedia->priv->recv_progress, FALSE, FALSE, 0); - gtk_widget_show(gtkmedia->priv->recv_progress); + pidgin_media_add_audio_widget(gtkmedia, + PURPLE_MEDIA_RECV_AUDIO), FALSE, FALSE, 0); } if (type & PURPLE_MEDIA_SEND_AUDIO) { GstElement *media_src; - GtkWidget *hbox, *volume; + GtkWidget *hbox; hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); gtk_box_pack_end(GTK_BOX(send_widget), hbox, FALSE, FALSE, 0); @@ -735,28 +745,13 @@ gtk_widget_show(gtkmedia->priv->mute); gtk_widget_show(GTK_WIDGET(hbox)); - volume = gtk_hscale_new_with_range(0.0, 100.0, 5.0); - gtk_range_set_increments(GTK_RANGE(volume), 5.0, 25.0); - gtk_range_set_value(GTK_RANGE(volume), - purple_prefs_get_int( - "/pidgin/media/audio/volume/input")); - gtk_scale_set_draw_value(GTK_SCALE(volume), FALSE); - g_signal_connect (G_OBJECT(volume), "value-changed", - G_CALLBACK (pidgin_media_input_volume_changed), - media); - gtk_box_pack_end(GTK_BOX(send_widget), - volume, FALSE, FALSE, 0); - gtk_widget_show(volume); - media_src = purple_media_get_src(media, sid); gtkmedia->priv->send_level = gst_bin_get_by_name( GST_BIN(media_src), "sendlevel"); - gtkmedia->priv->send_progress = gtk_progress_bar_new(); - gtk_widget_set_size_request(gtkmedia->priv->send_progress, 320, 10); gtk_box_pack_end(GTK_BOX(send_widget), - gtkmedia->priv->send_progress, FALSE, FALSE, 0); - gtk_widget_show(gtkmedia->priv->send_progress); + pidgin_media_add_audio_widget(gtkmedia, + PURPLE_MEDIA_SEND_AUDIO), FALSE, FALSE, 0); gtk_widget_show(gtkmedia->priv->mute); } @@ -932,15 +927,13 @@ static gboolean pidgin_media_new_cb(PurpleMediaManager *manager, PurpleMedia *media, - PurpleConnection *pc, gchar *screenname, gpointer nul) + PurpleAccount *account, gchar *screenname, gpointer nul) { PidginMedia *gtkmedia = PIDGIN_MEDIA( pidgin_media_new(media, screenname)); - PurpleBuddy *buddy = purple_find_buddy( - purple_connection_get_account(pc), screenname); + PurpleBuddy *buddy = purple_find_buddy(account, screenname); const gchar *alias = buddy ? purple_buddy_get_contact_alias(buddy) : screenname; - gtkmedia->priv->pc = pc; gtk_window_set_title(GTK_WINDOW(gtkmedia), alias); if (purple_media_is_initiator(media, NULL, NULL) == TRUE) diff -r d6a31b0ad109 -r d6a863df7884 pidgin/gtkmedia.h --- a/pidgin/gtkmedia.h Sun Apr 05 21:54:03 2009 +0000 +++ b/pidgin/gtkmedia.h Sat Apr 11 04:34:47 2009 +0000 @@ -1,8 +1,9 @@ /** - * @file media.h Account API - * @ingroup core - * - * Pidgin + * @file gtkmedia.h Pidgin Media API + * @ingroup pidgin + */ + +/* Pidgin * * 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 diff -r d6a31b0ad109 -r d6a863df7884 pidgin/gtkmenutray.c --- a/pidgin/gtkmenutray.c Sun Apr 05 21:54:03 2009 +0000 +++ b/pidgin/gtkmenutray.c Sat Apr 11 04:34:47 2009 +0000 @@ -21,9 +21,7 @@ #include "gtkmenutray.h" -#include -#include -#include +#include /****************************************************************************** * Enums diff -r d6a31b0ad109 -r d6a863df7884 pidgin/gtkmenutray.h --- a/pidgin/gtkmenutray.h Sun Apr 05 21:54:03 2009 +0000 +++ b/pidgin/gtkmenutray.h Sat Apr 11 04:34:47 2009 +0000 @@ -24,9 +24,7 @@ #ifndef PIDGIN_MENU_TRAY_H #define PIDGIN_MENU_TRAY_H -#include -#include -#include +#include #define PIDGIN_TYPE_MENU_TRAY (pidgin_menu_tray_get_gtype()) #define PIDGIN_MENU_TRAY(obj) (GTK_CHECK_CAST((obj), PIDGIN_TYPE_MENU_TRAY, PidginMenuTray)) diff -r d6a31b0ad109 -r d6a863df7884 pidgin/gtkplugin.c --- a/pidgin/gtkplugin.c Sun Apr 05 21:54:03 2009 +0000 +++ b/pidgin/gtkplugin.c Sat Apr 11 04:34:47 2009 +0000 @@ -135,7 +135,13 @@ gtk_list_store_append (ls, &iter); - name = g_markup_escape_text(plug->info->name ? _(plug->info->name) : g_basename(plug->path), -1); + if (plug->info->name) { + name = g_markup_escape_text(_(plug->info->name), -1); + } else { + char *tmp = g_path_get_basename(plug->path); + name = g_markup_escape_text(tmp, -1); + g_free(tmp); + } version = g_markup_escape_text(purple_plugin_get_version(plug), -1); summary = g_markup_escape_text(purple_plugin_get_summary(plug), -1); diff -r d6a31b0ad109 -r d6a863df7884 pidgin/gtksound.c --- a/pidgin/gtksound.c Sun Apr 05 21:54:03 2009 +0000 +++ b/pidgin/gtksound.c Sat Apr 11 04:34:47 2009 +0000 @@ -226,9 +226,9 @@ account_signon_cb(PurpleConnection *gc, gpointer data) { if (mute_login_sounds_timeout != 0) - g_source_remove(mute_login_sounds_timeout); + purple_timeout_remove(mute_login_sounds_timeout); mute_login_sounds = TRUE; - mute_login_sounds_timeout = purple_timeout_add(10000, unmute_login_sounds_cb, NULL); + mute_login_sounds_timeout = purple_timeout_add_seconds(10, unmute_login_sounds_cb, NULL); } const char * diff -r d6a31b0ad109 -r d6a863df7884 pidgin/gtksourceiter.h --- a/pidgin/gtksourceiter.h Sun Apr 05 21:54:03 2009 +0000 +++ b/pidgin/gtksourceiter.h Sat Apr 11 04:34:47 2009 +0000 @@ -28,7 +28,7 @@ #ifndef _PIDGINSOURCEITER_H_ #define _PIDGINSOURCEITER_H_ -#include +#include G_BEGIN_DECLS diff -r d6a31b0ad109 -r d6a863df7884 pidgin/gtksourceundomanager.h --- a/pidgin/gtksourceundomanager.h Sun Apr 05 21:54:03 2009 +0000 +++ b/pidgin/gtksourceundomanager.h Sat Apr 11 04:34:47 2009 +0000 @@ -26,7 +26,7 @@ #ifndef __GTK_SOURCE_UNDO_MANAGER_H__ #define __GTK_SOURCE_UNDO_MANAGER_H__ -#include +#include #define GTK_SOURCE_TYPE_UNDO_MANAGER (gtk_source_undo_manager_get_type ()) #define GTK_SOURCE_UNDO_MANAGER(obj) (GTK_CHECK_CAST ((obj), GTK_SOURCE_TYPE_UNDO_MANAGER, GtkSourceUndoManager)) diff -r d6a31b0ad109 -r d6a863df7884 pidgin/gtkstatusbox.c --- a/pidgin/gtkstatusbox.c Sun Apr 05 21:54:03 2009 +0000 +++ b/pidgin/gtkstatusbox.c Sat Apr 11 04:34:47 2009 +0000 @@ -67,7 +67,8 @@ # endif #endif -#define TYPING_TIMEOUT 4000 +/* Timeout for typing notifications in seconds */ +#define TYPING_TIMEOUT 4 static void imhtml_changed_cb(GtkTextBuffer *buffer, void *data); static void imhtml_format_changed_cb(GtkIMHtml *imhtml, GtkIMHtmlButtons buttons, void *data); @@ -1155,7 +1156,7 @@ /* Reset the status if Escape was pressed */ if (event->keyval == GDK_Escape) { - g_source_remove(status_box->typing); + purple_timeout_remove(status_box->typing); status_box->typing = 0; if (status_box->account != NULL) update_to_reflect_account_status(status_box, status_box->account, @@ -1168,8 +1169,8 @@ } pidgin_status_box_pulse_typing(status_box); - g_source_remove(status_box->typing); - status_box->typing = g_timeout_add(TYPING_TIMEOUT, (GSourceFunc)remove_typing_cb, status_box); + purple_timeout_remove(status_box->typing); + status_box->typing = purple_timeout_add_seconds(TYPING_TIMEOUT, (GSourceFunc)remove_typing_cb, status_box); return FALSE; } @@ -2596,7 +2597,7 @@ return; } - g_source_remove(status_box->typing); + purple_timeout_remove(status_box->typing); status_box->typing = 0; activate_currently_selected_status(status_box); @@ -2624,7 +2625,7 @@ DATA_COLUMN, &data, -1); if (status_box->typing != 0) - g_source_remove(status_box->typing); + purple_timeout_remove(status_box->typing); status_box->typing = 0; if (GTK_WIDGET_IS_SENSITIVE(GTK_WIDGET(status_box))) @@ -2692,7 +2693,7 @@ GtkTextIter start, end; GtkTextBuffer *buffer; gtk_widget_show_all(status_box->vbox); - status_box->typing = g_timeout_add(TYPING_TIMEOUT, (GSourceFunc)remove_typing_cb, status_box); + status_box->typing = purple_timeout_add_seconds(TYPING_TIMEOUT, (GSourceFunc)remove_typing_cb, status_box); gtk_widget_grab_focus(status_box->imhtml); buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(status_box->imhtml)); gtk_text_buffer_get_bounds(buffer, &start, &end); @@ -2741,9 +2742,9 @@ { if (status_box->typing != 0) { pidgin_status_box_pulse_typing(status_box); - g_source_remove(status_box->typing); + purple_timeout_remove(status_box->typing); } - status_box->typing = g_timeout_add(TYPING_TIMEOUT, (GSourceFunc)remove_typing_cb, status_box); + status_box->typing = purple_timeout_add_seconds(TYPING_TIMEOUT, (GSourceFunc)remove_typing_cb, status_box); } pidgin_status_box_refresh(status_box); } diff -r d6a31b0ad109 -r d6a863df7884 pidgin/gtkstatusbox.h --- a/pidgin/gtkstatusbox.h Sun Apr 05 21:54:03 2009 +0000 +++ b/pidgin/gtkstatusbox.h Sat Apr 11 04:34:47 2009 +0000 @@ -34,8 +34,6 @@ #include "imgstore.h" #include "savedstatuses.h" #include "status.h" -#include -#include G_BEGIN_DECLS diff -r d6a31b0ad109 -r d6a863df7884 pidgin/gtkutils.c --- a/pidgin/gtkutils.c Sun Apr 05 21:54:03 2009 +0000 +++ b/pidgin/gtkutils.c Sat Apr 11 04:34:47 2009 +0000 @@ -950,7 +950,7 @@ "accel changed, scheduling save.\n"); if (!accels_save_timer) - accels_save_timer = g_timeout_add(5000, pidgin_save_accels, + accels_save_timer = purple_timeout_add_seconds(5, pidgin_save_accels, NULL); } diff -r d6a31b0ad109 -r d6a863df7884 pidgin/minidialog.c --- a/pidgin/minidialog.c Sun Apr 05 21:54:03 2009 +0000 +++ b/pidgin/minidialog.c Sat Apr 11 04:34:47 2009 +0000 @@ -26,8 +26,7 @@ #include "internal.h" -#include -#include +#include #include "libpurple/prefs.h" diff -r d6a31b0ad109 -r d6a863df7884 pidgin/minidialog.h --- a/pidgin/minidialog.h Sun Apr 05 21:54:03 2009 +0000 +++ b/pidgin/minidialog.h Sat Apr 11 04:34:47 2009 +0000 @@ -28,8 +28,7 @@ #define __PIDGIN_MINI_DIALOG_H__ #include -#include -#include +#include G_BEGIN_DECLS diff -r d6a31b0ad109 -r d6a863df7884 pidgin/pidginstock.c --- a/pidgin/pidginstock.c Sun Apr 05 21:54:03 2009 +0000 +++ b/pidgin/pidginstock.c Sat Apr 11 04:34:47 2009 +0000 @@ -201,7 +201,7 @@ #ifdef USE_VV { PIDGIN_STOCK_TOOLBAR_AUDIO_CALL, "toolbar", "audio-call.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, { PIDGIN_STOCK_TOOLBAR_VIDEO_CALL, "toolbar", "video-call.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_TOOLBAR_AUDIO_VIDEO_CALL, "toolbar", "audio-video-call.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, + { PIDGIN_STOCK_TOOLBAR_AUDIO_VIDEO_CALL, "toolbar", "audio-video-call.png", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, #endif }; diff -r d6a31b0ad109 -r d6a863df7884 pidgin/pidginstock.h --- a/pidgin/pidginstock.h Sun Apr 05 21:54:03 2009 +0000 +++ b/pidgin/pidginstock.h Sat Apr 11 04:34:47 2009 +0000 @@ -23,7 +23,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ -#include +#include #include "gtkstatus-icon-theme.h" #ifndef _PIDGIN_STOCK_H_ diff -r d6a31b0ad109 -r d6a863df7884 pidgin/plugins/Makefile.am diff -r d6a31b0ad109 -r d6a863df7884 pidgin/plugins/cap/Makefile.am diff -r d6a31b0ad109 -r d6a863df7884 pidgin/plugins/cap/cap.c --- a/pidgin/plugins/cap/cap.c Sun Apr 05 21:54:03 2009 +0000 +++ b/pidgin/plugins/cap/cap.c Sat Apr 11 04:34:47 2009 +0000 @@ -135,7 +135,7 @@ /* g_free(stats->hourly_usage); */ /* g_free(stats->daily_usage); */ if (stats->timeout_source_id != 0) - g_source_remove(stats->timeout_source_id); + purple_timeout_remove(stats->timeout_source_id); g_free(stats); } @@ -352,7 +352,7 @@ if (buddy == NULL) return; - interval = purple_prefs_get_int("/plugins/gtk/cap/max_msg_difference") * 1000 * 60; + interval = purple_prefs_get_int("/plugins/gtk/cap/max_msg_difference") * 60; words = word_count(message); stats = get_stats_for(buddy); @@ -361,9 +361,9 @@ stats->last_message = time(NULL); stats->last_message_status_id = purple_status_get_id(get_status_for(buddy)); if(stats->timeout_source_id != 0) - g_source_remove(stats->timeout_source_id); + purple_timeout_remove(stats->timeout_source_id); - stats->timeout_source_id = g_timeout_add(interval, max_message_difference_cb, stats); + stats->timeout_source_id = purple_timeout_add_seconds(interval, max_message_difference_cb, stats); } /* received-im-msg */ @@ -386,7 +386,7 @@ * then cancel the timeout callback. */ if(stats->timeout_source_id != 0) { purple_debug_info("cap", "Cancelling timeout callback\n"); - g_source_remove(stats->timeout_source_id); + purple_timeout_remove(stats->timeout_source_id); stats->timeout_source_id = 0; } @@ -697,7 +697,7 @@ static void cancel_conversation_timeouts(gpointer key, gpointer value, gpointer user_data) { CapStatistics *stats = value; if(stats->timeout_source_id != 0) { - g_source_remove(stats->timeout_source_id); + purple_timeout_remove(stats->timeout_source_id); stats->timeout_source_id = 0; } } diff -r d6a31b0ad109 -r d6a863df7884 pidgin/plugins/gestures/Makefile.am diff -r d6a31b0ad109 -r d6a863df7884 pidgin/plugins/gevolution/Makefile.am diff -r d6a31b0ad109 -r d6a863df7884 pidgin/plugins/mailchk.c --- a/pidgin/plugins/mailchk.c Sun Apr 05 21:54:03 2009 +0000 +++ b/pidgin/plugins/mailchk.c Sat Apr 11 04:34:47 2009 +0000 @@ -13,7 +13,7 @@ #define UNREAD_MAIL 0x02 #define NEW_MAIL 0x04 -static guint32 timer = 0; +static guint timer = 0; static GtkWidget *mail = NULL; static gint @@ -93,7 +93,7 @@ PurpleBuddyList *list = purple_get_blist(); if (list && PURPLE_IS_GTK_BLIST(list) && !timer) { check_timeout(NULL); /* we want the box to be drawn immediately */ - timer = g_timeout_add(2000, check_timeout, NULL); + timer = purple_timeout_add_seconds(2, check_timeout, NULL); } } @@ -102,7 +102,7 @@ { PurpleBuddyList *list = purple_get_blist(); if ((!list || !PURPLE_IS_GTK_BLIST(list) || !PIDGIN_BLIST(list)->vbox) && timer) { - g_source_remove(timer); + purple_timeout_remove(timer); timer = 0; } } @@ -123,7 +123,7 @@ } if (list && PURPLE_IS_GTK_BLIST(list) && PIDGIN_BLIST(list)->vbox) - timer = g_timeout_add(2000, check_timeout, NULL); + timer = purple_timeout_add_seconds(2, check_timeout, NULL); purple_signal_connect(conn_handle, "signed-on", plugin, PURPLE_CALLBACK(signon_cb), NULL); @@ -137,7 +137,7 @@ plugin_unload(PurplePlugin *plugin) { if (timer) - g_source_remove(timer); + purple_timeout_remove(timer); timer = 0; if (mail) gtk_widget_destroy(mail); diff -r d6a31b0ad109 -r d6a863df7884 pidgin/plugins/musicmessaging/Makefile.am diff -r d6a31b0ad109 -r d6a863df7884 pidgin/plugins/musicmessaging/musicmessaging.c --- a/pidgin/plugins/musicmessaging/musicmessaging.c Sun Apr 05 21:54:03 2009 +0000 +++ b/pidgin/plugins/musicmessaging/musicmessaging.c Sat Apr 11 04:34:47 2009 +0000 @@ -529,7 +529,7 @@ args[1] = "-session_id"; session_id = g_string_new(""); - g_string_sprintfa(session_id, "%d", mmconv_from_conv_loc(mmconv->conv)); + g_string_append_printf(session_id, "%d", mmconv_from_conv_loc(mmconv->conv)); args[2] = session_id->str; args[3] = NULL; diff -r d6a31b0ad109 -r d6a863df7884 pidgin/plugins/ticker/Makefile.am diff -r d6a31b0ad109 -r d6a863df7884 pidgin/plugins/ticker/gtkticker.h --- a/pidgin/plugins/ticker/gtkticker.h Sun Apr 05 21:54:03 2009 +0000 +++ b/pidgin/plugins/ticker/gtkticker.h Sat Apr 11 04:34:47 2009 +0000 @@ -26,8 +26,7 @@ #include -#include -#include +#include #ifdef __cplusplus diff -r d6a31b0ad109 -r d6a863df7884 po/POTFILES.in --- a/po/POTFILES.in Sun Apr 05 21:54:03 2009 +0000 +++ b/po/POTFILES.in Sat Apr 11 04:34:47 2009 +0000 @@ -37,6 +37,7 @@ finch/plugins/gnthistory.c finch/plugins/grouping.c finch/plugins/lastlog.c +finch/plugins/gnttinyurl.c libpurple/account.c libpurple/blist.c libpurple/certificate.c @@ -88,7 +89,6 @@ libpurple/protocols/jabber/buddy.c libpurple/protocols/jabber/chat.c libpurple/protocols/jabber/jabber.c -libpurple/protocols/jabber/jingle.c libpurple/protocols/jabber/libxmpp.c libpurple/protocols/jabber/message.c libpurple/protocols/jabber/parser.c