Mercurial > pidgin.yaz
changeset 26738:a8dbbcd069ab
propagate from branch 'im.pidgin.pidgin' (head 53303438f1a2d586d17f7efc61cba0bee2329a25)
to branch 'im.pidgin.cpw.darkrain42.xmpp.bosh' (head e6ffb2168588f0ef3faeb34d3beceb030eb89183)
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Sat, 18 Apr 2009 17:43:55 +0000 |
parents | f3a6f9976d9c (diff) 178718b181e4 (current diff) |
children | 91b70522776e |
files | libpurple/media.c libpurple/protocols/jabber/jabber.c libpurple/protocols/jabber/message.c |
diffstat | 27 files changed, 856 insertions(+), 271 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Sun Apr 12 00:43:01 2009 +0000 +++ b/ChangeLog Sat Apr 18 17:43:55 2009 +0000 @@ -26,6 +26,9 @@ IRC: * Correctly handle WHOIS for users who are joined to a large number of channels. + * Notify the user if a /nick command fails, rather than trying + fallback nicks. + Pidgin: * Added -f command line option to tell Pidgin to ignore NetworkManager
--- a/ChangeLog.API Sun Apr 12 00:43:01 2009 +0000 +++ b/ChangeLog.API Sat Apr 18 17:43:55 2009 +0000 @@ -78,6 +78,10 @@ * pidgin_utils_init, pidgin_utils_uninit * pidgin_notify_pounce_add + libgnt: + Added: + * GntProgressBar and functions (Saleem Abdulrasool) + perl: Changed: * Made a bunch of functions act more perl-like. Call the new()
--- a/doc/TCL-HOWTO.dox Sun Apr 12 00:43:01 2009 +0000 +++ b/doc/TCL-HOWTO.dox Sat Apr 18 17:43:55 2009 +0000 @@ -173,6 +173,7 @@ purple::connection displayname gc purple::connection handle purple::connection list +purple::connection state @endcode @c purple::connection is a collection of subcommands pertaining to @@ -192,6 +193,9 @@ this list are appropriate as @c gc arguments to the other @c purple::connection subcommands or other commands requiring a gc. + @c state returns the PurpleConnectionState of this account as one of + the strings "connected", "disconnected", or "connecting". + @code purple::conv_send account who text @endcode
--- a/finch/libgnt/Makefile.am Sun Apr 12 00:43:01 2009 +0000 +++ b/finch/libgnt/Makefile.am Sat Apr 18 17:43:55 2009 +0000 @@ -28,6 +28,7 @@ gntmenu.c \ gntmenuitem.c \ gntmenuitemcheck.c \ + gntprogressbar.c \ gntslider.c \ gntstyle.c \ gnttextview.c \ @@ -56,6 +57,7 @@ gntmenu.h \ gntmenuitem.h \ gntmenuitemcheck.h \ + gntprogressbar.h \ gntslider.h \ gntstyle.h \ gnttextview.h \
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/finch/libgnt/gntprogressbar.c Sat Apr 18 17:43:55 2009 +0000 @@ -0,0 +1,253 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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 "gntprogressbar.h" +#include "gntutils.h" + +#include <string.h> + +typedef struct _GntProgressBarPrivate +{ + gdouble fraction; + gboolean show_value; + GntProgressBarOrientation orientation; +} GntProgressBarPrivate; + +struct _GntProgressBar +{ + GntWidget parent; +#if !GLIB_CHECK_VERSION(2,4,0) + GntProgressBarPrivate priv; +#endif +}; + +#if GLIB_CHECK_VERSION(2,4,0) +#define GNT_PROGRESS_BAR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GNT_TYPE_PROGRESS_BAR, GntProgressBarPrivate)) +#else +#define GNT_PROGRESS_BAR_GET_PRIVATE(o) &(GNT_PROGRESS_BAR(o)->priv) +#endif + +static GntWidgetClass *parent_class = NULL; + + +static void +gnt_progress_bar_draw (GntWidget *widget) +{ + GntProgressBarPrivate *priv = GNT_PROGRESS_BAR_GET_PRIVATE (GNT_PROGRESS_BAR (widget)); + gchar progress[8]; + gint start, end, i, pos; + int color; + + g_snprintf (progress, sizeof (progress), "%.1f%%", priv->fraction * 100); + color = gnt_color_pair(GNT_COLOR_NORMAL); + + switch (priv->orientation) { + case GNT_PROGRESS_LEFT_TO_RIGHT: + case GNT_PROGRESS_RIGHT_TO_LEFT: + start = (priv->orientation == GNT_PROGRESS_LEFT_TO_RIGHT ? 0 : (1.0 - priv->fraction) * widget->priv.width); + end = (priv->orientation == GNT_PROGRESS_LEFT_TO_RIGHT ? widget->priv.width * priv->fraction : widget->priv.width); + + /* background */ + for (i = 0; i < widget->priv.height; i++) + mvwhline (widget->window, i, 0, ' ' | color, widget->priv.width); + + /* foreground */ + for (i = 0; i < widget->priv.height; i++) + mvwhline (widget->window, i, start, ACS_CKBOARD | color | A_REVERSE, end); + + /* text */ + if (priv->show_value) { + pos = widget->priv.width / 2 - strlen (progress) / 2; + for (i = 0; i < progress[i]; i++, pos++) { + wattrset (widget->window, color | ((pos < start || pos > end) ? A_NORMAL : A_REVERSE)); + mvwprintw (widget->window, widget->priv.height / 2, pos, "%c", progress[i]); + } + wattrset (widget->window, color); + } + + break; + case GNT_PROGRESS_TOP_TO_BOTTOM: + case GNT_PROGRESS_BOTTOM_TO_TOP: + start = (priv->orientation == GNT_PROGRESS_TOP_TO_BOTTOM ? 0 : (1.0 - priv->fraction) * widget->priv.height); + end = (priv->orientation == GNT_PROGRESS_TOP_TO_BOTTOM ? widget->priv.height * priv->fraction : widget->priv.height); + + /* background */ + for (i = 0; i < widget->priv.width; i++) + mvwvline (widget->window, 0, i, ' ' | color, widget->priv.height); + + /* foreground */ + for (i = 0; i < widget->priv.width; i++) + mvwvline (widget->window, start, i, ACS_CKBOARD | color | A_REVERSE, end); + + /* text */ + if (priv->show_value) { + pos = widget->priv.height / 2 - strlen (progress) / 2; + for (i = 0; i < progress[i]; i++, pos++) { + wattrset (widget->window, color | ((pos < start || pos > end) ? A_NORMAL : A_REVERSE)); + mvwprintw (widget->window, pos, widget->priv.width / 2, "%c\n", progress[i]); + } + wattrset (widget->window, color); + } + + break; + default: + g_assert_not_reached (); + } +} + +static void +gnt_progress_bar_size_request (GntWidget *widget) +{ + gnt_widget_set_size (widget, widget->priv.minw, widget->priv.minh); +} + +static void +gnt_progress_bar_class_init (gpointer klass, gpointer class_data) +{ + GObjectClass *g_class = G_OBJECT_CLASS (klass); + + parent_class = GNT_WIDGET_CLASS (klass); + +#if GLIB_CHECK_VERSION(2,4,0) + g_type_class_add_private (g_class, sizeof (GntProgressBarPrivate)); +#endif + + parent_class->draw = gnt_progress_bar_draw; + parent_class->size_request = gnt_progress_bar_size_request; +} + +static void +gnt_progress_bar_init (GTypeInstance *instance, gpointer g_class) +{ + GntWidget *widget = GNT_WIDGET (instance); + GntProgressBarPrivate *priv = GNT_PROGRESS_BAR_GET_PRIVATE (GNT_PROGRESS_BAR (widget)); + + gnt_widget_set_take_focus (widget, FALSE); + GNT_WIDGET_SET_FLAGS (widget, GNT_WIDGET_NO_BORDER | GNT_WIDGET_NO_SHADOW | GNT_WIDGET_GROW_X); + + widget->priv.minw = 8; + widget->priv.minh = 1; + + priv->show_value = TRUE; +} + +GType +gnt_progress_bar_get_type (void) +{ + static GType type = 0; + + if (type == 0) { + static const GTypeInfo info = { + sizeof (GntProgressBarClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + gnt_progress_bar_class_init, /* class_init */ + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (GntProgressBar), + 0, /* n_preallocs */ + gnt_progress_bar_init, /* instance_init */ + NULL /* value_table */ + }; + + type = g_type_register_static (GNT_TYPE_WIDGET, "GntProgressBar", &info, 0); + } + + return type; +} + +GntWidget * +gnt_progress_bar_new (void) +{ + GntWidget *widget = g_object_new (GNT_TYPE_PROGRESS_BAR, NULL); + return widget; +} + +void +gnt_progress_bar_set_fraction (GntProgressBar *pbar, gdouble fraction) +{ + GntProgressBarPrivate *priv = GNT_PROGRESS_BAR_GET_PRIVATE (pbar); + + if (fraction > 1.0) + priv->fraction = 1.0; + else if (fraction < 0.0) + priv->fraction = 0.0; + else + priv->fraction = fraction; + + if ((GNT_WIDGET_FLAGS(pbar) & GNT_WIDGET_MAPPED)) + gnt_widget_draw(GNT_WIDGET(pbar)); +} + +void +gnt_progress_bar_set_orientation (GntProgressBar *pbar, + GntProgressBarOrientation orientation) +{ + GntProgressBarPrivate *priv = GNT_PROGRESS_BAR_GET_PRIVATE (pbar); + GntWidget *widget = GNT_WIDGET(pbar); + + priv->orientation = orientation; + if (orientation == GNT_PROGRESS_LEFT_TO_RIGHT || + orientation == GNT_PROGRESS_RIGHT_TO_LEFT) { + GNT_WIDGET_SET_FLAGS(pbar, GNT_WIDGET_GROW_X); + GNT_WIDGET_UNSET_FLAGS(pbar, GNT_WIDGET_GROW_Y); + widget->priv.minw = 8; + widget->priv.minh = 1; + } else { + GNT_WIDGET_UNSET_FLAGS(pbar, GNT_WIDGET_GROW_X); + GNT_WIDGET_SET_FLAGS(pbar, GNT_WIDGET_GROW_Y); + widget->priv.minw = 1; + widget->priv.minh = 8; + } + + if ((GNT_WIDGET_FLAGS(pbar) & GNT_WIDGET_MAPPED)) + gnt_widget_draw(GNT_WIDGET(pbar)); +} + +void +gnt_progress_bar_set_show_progress (GntProgressBar *pbar, gboolean show) +{ + GntProgressBarPrivate *priv = GNT_PROGRESS_BAR_GET_PRIVATE (pbar); + priv->show_value = show; +} + +gdouble +gnt_progress_bar_get_fraction (GntProgressBar *pbar) +{ + GntProgressBarPrivate *priv = GNT_PROGRESS_BAR_GET_PRIVATE (pbar); + return priv->fraction; +} + +GntProgressBarOrientation +gnt_progress_bar_get_orientation (GntProgressBar *pbar) +{ + GntProgressBarPrivate *priv = GNT_PROGRESS_BAR_GET_PRIVATE (pbar); + return priv->orientation; +} + +gboolean +gnt_progress_bar_get_show_progress (GntProgressBar *pbar) +{ + GntProgressBarPrivate *priv = GNT_PROGRESS_BAR_GET_PRIVATE (pbar); + return priv->show_value; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/finch/libgnt/gntprogressbar.h Sat Apr 18 17:43:55 2009 +0000 @@ -0,0 +1,132 @@ +/** + * @file gntprogressbar.h Progress Bar API + * @ingroup gnt + */ +/* + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA + */ + +#ifndef GNT_PROGRESS_BAR_H +#define GNT_PROGRESS_BAR_H + +#include "gnt.h" +#include "gntwidget.h" + +#define GNT_TYPE_PROGRESS_BAR (gnt_progress_bar_get_type ()) +#define GNT_PROGRESS_BAR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GNT_TYPE_PROGRESS_BAR, GntProgressBar)) +#define GNT_PROGRESS_BAR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GNT_TYPE_PROGRESS_BAR, GntProgressBarClass)) +#define GNT_IS_PROGRESS_BAR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNT_TYPE_PROGRESS_BAR)) +#define GNT_IS_PROGRESS_BAR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GNT_TYPE_PROGRESS_BAR)) +#define GNT_PROGRESS_BAR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GNT_TYPE_PROGRESS_BAR, GntProgressBarClass)) + +typedef enum _GntProgressBarOrientation +{ + GNT_PROGRESS_LEFT_TO_RIGHT, + GNT_PROGRESS_RIGHT_TO_LEFT, + GNT_PROGRESS_BOTTOM_TO_TOP, + GNT_PROGRESS_TOP_TO_BOTTOM, +} GntProgressBarOrientation; + +typedef struct _GntProgressBar GntProgressBar; + +typedef struct _GntProgressBarClass +{ + GntWidgetClass parent; + + void (*gnt_reserved1)(void); + void (*gnt_reserved2)(void); + void (*gnt_reserved3)(void); + void (*gnt_reserved4)(void); +} GntProgressBarClass; + +G_BEGIN_DECLS + +/** + * Get the GType for GntProgressBar + * @return The GType for GntProrgressBar + **/ +GType +gnt_progress_bar_get_type (void); + +/** + * Create a new GntProgressBar + * @return The new GntProgressBar + **/ +GntWidget * +gnt_progress_bar_new (void); + +/** + * Set the progress for a progress bar + * + * @param pbar The GntProgressBar + * @param fraction The value between 0 and 1 to display + **/ +void +gnt_progress_bar_set_fraction (GntProgressBar *pbar, gdouble fraction); + +/** + * Set the orientation for a progress bar + * + * @param pbar The GntProgressBar + * @param orientation The orientation to use + **/ +void +gnt_progress_bar_set_orientation (GntProgressBar *pbar, GntProgressBarOrientation orientation); + +/** + * Controls whether the progress value is shown + * + * @param pbar The GntProgressBar + * @param show A boolean indicating if the value is shown + **/ +void +gnt_progress_bar_set_show_progress (GntProgressBar *pbar, gboolean show); + +/** + * Get the progress that is displayed + * + * @param pbar The GntProgressBar + * @return The progress displayed as a value between 0 and 1 + **/ +gdouble +gnt_progress_bar_get_fraction (GntProgressBar *pbar); + +/** + * Get the orientation for the progress bar + * + * @param pbar The GntProgressBar + * @return The current orientation of the progress bar + **/ +GntProgressBarOrientation +gnt_progress_bar_get_orientation (GntProgressBar *pbar); + +/** + * Get a boolean describing if the progress value is shown + * + * @param pbar The GntProgressBar + * @return A boolean @c true if the progress value is shown, @c false otherwise. + **/ +gboolean +gnt_progress_bar_get_show_progress (GntProgressBar *pbar); + +G_END_DECLS + +#endif /* GNT_PROGRESS_BAR_H */
--- a/libpurple/Makefile.mingw Sun Apr 12 00:43:01 2009 +0000 +++ b/libpurple/Makefile.mingw Sat Apr 18 17:43:55 2009 +0000 @@ -35,6 +35,7 @@ buddyicon.c \ certificate.c \ cipher.c \ + circbuffer.c \ cmds.c \ connection.c \ conversation.c \ @@ -44,10 +45,11 @@ dnssrv.c \ eventloop.c \ ft.c \ - circbuffer.c \ idle.c \ imgstore.c \ log.c \ + media.c \ + mediamanager.c \ mime.c \ nat-pmp.c \ network.c \ @@ -66,22 +68,22 @@ server.c \ signals.c \ smiley.c \ - sound.c \ + sound-theme-loader.c \ sound-theme.c \ - sound-theme-loader.c \ + sound.c \ sslconn.c \ status.c \ stringref.c \ stun.c \ - theme.c \ theme-loader.c \ theme-manager.c \ + theme.c \ upnp.c \ util.c \ value.c \ version.c \ + whiteboard.c \ xmlnode.c \ - whiteboard.c \ win32/giowin32.c \ win32/libc_interface.c \ win32/win32dep.c
--- a/libpurple/blist.c Sun Apr 12 00:43:01 2009 +0000 +++ b/libpurple/blist.c Sat Apr 18 17:43:55 2009 +0000 @@ -1582,6 +1582,7 @@ purple_contact_destroy(PurpleContact *contact) { g_hash_table_destroy(contact->node.settings); + g_free(contact->alias); PURPLE_DBUS_UNREGISTER_POINTER(contact); g_free(contact); }
--- a/libpurple/media.c Sun Apr 12 00:43:01 2009 +0000 +++ b/libpurple/media.c Sat Apr 18 17:43:55 2009 +0000 @@ -29,7 +29,6 @@ #include "internal.h" #include "account.h" -#include "marshallers.h" #include "media.h" #include "mediamanager.h" #include "network.h" @@ -37,6 +36,7 @@ #include "debug.h" #ifdef USE_GSTREAMER +#include "marshallers.h" #include "media-gst.h" #endif
--- a/libpurple/mediamanager.c Sun Apr 12 00:43:01 2009 +0000 +++ b/libpurple/mediamanager.c Sat Apr 18 17:43:55 2009 +0000 @@ -28,11 +28,11 @@ #include "account.h" #include "debug.h" -#include "marshallers.h" #include "media.h" #include "mediamanager.h" #ifdef USE_GSTREAMER +#include "marshallers.h" #include "media-gst.h" #endif
--- a/libpurple/network.c Sun Apr 12 00:43:01 2009 +0000 +++ b/libpurple/network.c Sat Apr 18 17:43:55 2009 +0000 @@ -825,8 +825,13 @@ *ip = g_strdup(dst); purple_debug_info("network", "set IP address: %s\n", *ip); } - - g_slist_free(hosts); + + while (hosts != NULL) { + hosts = g_slist_delete_link(hosts, hosts); + /* Free the address */ + g_free(hosts->data); + hosts = g_slist_delete_link(hosts, hosts); + } } void
--- a/libpurple/plugins/perl/perl-common.c Sun Apr 12 00:43:01 2009 +0000 +++ b/libpurple/plugins/perl/perl-common.c Sat Apr 18 17:43:55 2009 +0000 @@ -403,7 +403,7 @@ static SV * purple_perl_sv_from_subtype(const PurpleValue *value, void *arg) { - const char *stash = NULL; + const char *stash = "Purple"; /* ? */ switch (purple_value_get_subtype(value)) { case PURPLE_SUBTYPE_ACCOUNT: @@ -442,6 +442,9 @@ case PURPLE_SUBTYPE_STATUS: stash = "Purple::Status"; break; + case PURPLE_SUBTYPE_SAVEDSTATUS: + stash = "Purple::SavedStatus"; + break; case PURPLE_SUBTYPE_LOG: stash = "Purple::Log"; break; @@ -451,10 +454,19 @@ case PURPLE_SUBTYPE_XMLNODE: stash = "Purple::XMLNode"; break; - - default: - stash = "Purple"; /* ? */ - } + case PURPLE_SUBTYPE_USERINFO: + stash = "Purple::NotifyUserInfo"; + break; + case PURPLE_SUBTYPE_STORED_IMAGE: + stash = "Purple::StoredImage"; + break; + case PURPLE_SUBTYPE_CERTIFICATEPOOL: + stash = "Purple::Certificate::Pool"; + break; + case PURPLE_SUBTYPE_UNKNOWN: + stash = "Purple::Unknown"; + break; + } return sv_2mortal(purple_perl_bless_object(arg, stash)); }
--- a/libpurple/plugins/tcl/tcl_cmds.c Sun Apr 12 00:43:01 2009 +0000 +++ b/libpurple/plugins/tcl/tcl_cmds.c Sat Apr 18 17:43:55 2009 +0000 @@ -683,8 +683,9 @@ int tcl_cmd_connection(ClientData unused, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { Tcl_Obj *list, *elem; - const char *cmds[] = { "account", "displayname", "handle", "list", NULL }; - enum { CMD_CONN_ACCOUNT, CMD_CONN_DISPLAYNAME, CMD_CONN_HANDLE, CMD_CONN_LIST } cmd; + const char *cmds[] = { "account", "displayname", "handle", "list", "state", NULL }; + enum { CMD_CONN_ACCOUNT, CMD_CONN_DISPLAYNAME, CMD_CONN_HANDLE, + CMD_CONN_LIST, CMD_CONN_STATE } cmd; int error; GList *cur; PurpleConnection *gc; @@ -739,6 +740,25 @@ } Tcl_SetObjResult(interp, list); break; + case CMD_CONN_STATE: + if (objc != 3) { + Tcl_WrongNumArgs(interp, 2, objv, "gc"); + return TCL_ERROR; + } + if ((gc = tcl_validate_gc(objv[2], interp)) == NULL) + return TCL_ERROR; + switch (purple_connection_get_state(gc)) { + case PURPLE_DISCONNECTED: + Tcl_SetObjResult(interp, Tcl_NewStringObj("disconnected", -1)); + break; + case PURPLE_CONNECTED: + Tcl_SetObjResult(interp, Tcl_NewStringObj("connected", -1)); + break; + case PURPLE_CONNECTING: + Tcl_SetObjResult(interp, Tcl_NewStringObj("connecting", -1)); + break; + } + break; } return TCL_OK;
--- a/libpurple/protocols/irc/msgs.c Sun Apr 12 00:43:01 2009 +0000 +++ b/libpurple/protocols/irc/msgs.c Sat Apr 18 17:43:55 2009 +0000 @@ -1004,10 +1004,23 @@ void irc_msg_nickused(struct irc_conn *irc, const char *name, const char *from, char **args) { char *newnick, *buf, *end; + PurpleConnection *gc = purple_account_get_connection(irc->account); if (!args || !args[1]) return; + if (gc && purple_connection_get_state(gc) == PURPLE_CONNECTED) { + /* We only want to do the following dance if the connection + has not been successfully completed. If it has, just + notify the user that their /nick command didn't go. */ + buf = g_strdup_printf(_("The nickname \"%s\" is already being used."), + irc->reqnick); + purple_notify_error(gc, _("Nickname in use"), + _("Nickname in use"), buf); + g_free(buf); + g_free(irc->reqnick); + } + if (strlen(args[1]) < strlen(irc->reqnick) || irc->nickused) newnick = g_strdup(args[1]); else
--- a/libpurple/protocols/jabber/google.c Sun Apr 12 00:43:01 2009 +0000 +++ b/libpurple/protocols/jabber/google.c Sat Apr 18 17:43:55 2009 +0000 @@ -1156,7 +1156,12 @@ } } - g_slist_free(hosts); + while (hosts != NULL) { + hosts = g_slist_delete_link(hosts, hosts); + /* Free the address */ + g_free(hosts->data); + hosts = g_slist_delete_link(hosts, hosts); + } } static void
--- a/libpurple/protocols/jabber/jabber.c Sun Apr 12 00:43:01 2009 +0000 +++ b/libpurple/protocols/jabber/jabber.c Sat Apr 18 17:43:55 2009 +0000 @@ -471,7 +471,7 @@ JabberStream *js = gc->proto_data; if (js->keepalive_timeout == -1) { - jabber_ping_jid(js, NULL); + jabber_ping_jid(js, js->user->domain); js->keepalive_timeout = purple_timeout_add_seconds(120, (GSourceFunc)(jabber_keepalive_timeout), gc); }
--- a/libpurple/protocols/jabber/message.c Sun Apr 12 00:43:01 2009 +0000 +++ b/libpurple/protocols/jabber/message.c Sat Apr 18 17:43:55 2009 +0000 @@ -626,24 +626,27 @@ purple_debug_info("jabber", "found %d smileys\n", g_list_length(smiley_refs)); - if (jm->type == JABBER_MESSAGE_GROUPCHAT) { - JabberID *jid = jabber_id_new(jm->from); - JabberChat *chat = NULL; + if (smiley_refs) { + if (jm->type == JABBER_MESSAGE_GROUPCHAT) { + JabberID *jid = jabber_id_new(jm->from); + JabberChat *chat = NULL; - if (jid) { - chat = jabber_chat_find(js, jid->node, jid->domain); - if (chat) conv = chat->conv; - } + if (jid) { + chat = jabber_chat_find(js, jid->node, jid->domain); + if (chat) conv = chat->conv; + } - jabber_id_free(jid); - } else { - conv = - purple_find_conversation_with_account(PURPLE_CONV_TYPE_ANY, - who, account); - if (!conv) { - /* we need to create the conversation here */ - conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, - account, who); + jabber_id_free(jid); + } else { + conv = + purple_find_conversation_with_account(PURPLE_CONV_TYPE_ANY, + who, account); + if (!conv) { + /* we need to create the conversation here */ + conv = + purple_conversation_new(PURPLE_CONV_TYPE_IM, + account, who); + } } } @@ -675,7 +678,7 @@ TRUE)) { const JabberData *data = jabber_data_find_remote_by_cid(cid); - /* if data is already known, we add write it immediatly */ + /* if data is already known, we write it immediatly */ if (data) { purple_debug_info("jabber", "data is already known\n");
--- a/libpurple/protocols/jabber/ping.c Sun Apr 12 00:43:01 2009 +0000 +++ b/libpurple/protocols/jabber/ping.c Sat Apr 18 17:43:55 2009 +0000 @@ -55,15 +55,10 @@ JabberIqType type, const char *id, xmlnode *packet, gpointer data) { - char *own_bare_jid = g_strdup_printf("%s@%s", js->user->node, - js->user->domain); - - if (!from || !strcmp(from, own_bare_jid)) { - /* If the pong is from our bare JID, treat it as a return from the + if (purple_strequal(from, js->user->domain)) + /* If the pong is from the server, assume it's a result of the * keepalive functions */ jabber_keepalive_pong_cb(js); - } - g_free(own_bare_jid); if (type == JABBER_IQ_RESULT) { purple_debug_info("jabber", "PONG!\n");
--- a/libpurple/protocols/yahoo/yahoo.c Sun Apr 12 00:43:01 2009 +0000 +++ b/libpurple/protocols/yahoo/yahoo.c Sat Apr 18 17:43:55 2009 +0000 @@ -2973,8 +2973,10 @@ /* connect to host */ if((purple_proxy_connect(NULL, account, host_ip, YAHOO_PAGER_PORT_P2P, yahoo_p2p_init_cb, p2p_data))==NULL) { - yahoo_p2p_disconnect_destroy_data(p2p_data); purple_debug_info("yahoo","p2p: Connection to %s failed\n", host_ip); + g_free(p2p_data->host_ip); + g_free(p2p_data->host_username); + g_free(p2p_data); } } }
--- a/libpurple/protocols/yahoo/yahoo_filexfer.c Sun Apr 12 00:43:01 2009 +0000 +++ b/libpurple/protocols/yahoo/yahoo_filexfer.c Sat Apr 18 17:43:55 2009 +0000 @@ -1029,12 +1029,7 @@ xd->port = YAHOO_XFER_RELAY_PORT; url = g_strdup_printf("%ld.%ld.%ld.%ld", d, c, b, a); - if (!purple_url_parse(url, &(xd->host), &(xd->port), &(xd->path), NULL, NULL)) { - purple_xfer_cancel_remote(xfer); - g_free(url); - return; - } - g_free(url); + /* Free the address... */ g_free(hosts->data); hosts = g_slist_remove(hosts, hosts->data); @@ -1048,6 +1043,13 @@ hosts = g_slist_remove(hosts, hosts->data); } + if (!purple_url_parse(url, &(xd->host), &(xd->port), &(xd->path), NULL, NULL)) { + purple_xfer_cancel_remote(xfer); + g_free(url); + return; + } + g_free(url); + pkt = yahoo_packet_new(YAHOO_SERVICE_FILETRANS_INFO_15, YAHOO_STATUS_AVAILABLE, yd->session_id); filename = g_path_get_basename(purple_xfer_get_local_filename(xfer));
--- a/libpurple/stun.c Sun Apr 12 00:43:01 2009 +0000 +++ b/libpurple/stun.c Sat Apr 18 17:43:55 2009 +0000 @@ -341,6 +341,12 @@ } if (!purple_network_listen_range(12108, 12208, SOCK_DGRAM, hbn_listen_cb, hosts)) { + while(hosts) { + hosts = g_slist_remove(hosts, hosts->data); + g_free(hosts->data); + hosts = g_slist_remove(hosts, hosts->data); + } + nattype.status = PURPLE_STUN_STATUS_UNKNOWN; nattype.lookup_time = time(NULL); do_callbacks();
--- a/libpurple/theme-manager.c Sun Apr 12 00:43:01 2009 +0000 +++ b/libpurple/theme-manager.c Sat Apr 18 17:43:55 2009 +0000 @@ -130,6 +130,7 @@ theme_dir = g_build_filename(purple_dir, type, NULL); theme = purple_theme_loader_build(loader, theme_dir); + g_free(theme_dir); if (PURPLE_IS_THEME(theme)) purple_theme_manager_add_theme(theme);
--- a/pidgin/gtkblist-theme-loader.c Sun Apr 12 00:43:01 2009 +0000 +++ b/pidgin/gtkblist-theme-loader.c Sat Apr 18 17:43:55 2009 +0000 @@ -21,6 +21,7 @@ */ #include <stdlib.h> +#include <string.h> #include "xmlnode.h" @@ -44,10 +45,10 @@ gchar *filename_full, *data; const gchar *temp; gboolean success = TRUE; - GdkColor *bgcolor, *expanded_bgcolor, *collapsed_bgcolor, *contact_color; + GdkColor bgcolor, expanded_bgcolor, collapsed_bgcolor, contact_color; GdkColor color; - FontColorPair *expanded, *collapsed, *contact, *online, *away, *offline, *idle, *message, *message_nick_said, *status; - PidginBlistLayout *layout; + FontColorPair expanded, collapsed, contact, online, away, offline, idle, message, message_nick_said, status; + PidginBlistLayout layout; PidginBlistTheme *theme; /* Find the theme file */ @@ -63,145 +64,117 @@ sub_node = xmlnode_get_child(root_node, "description"); data = xmlnode_get_data(sub_node); - /* init all structs and colors */ - bgcolor = g_new0(GdkColor, 1); - expanded_bgcolor = g_new0(GdkColor, 1); - collapsed_bgcolor = g_new0(GdkColor, 1); - - layout = g_new0(PidginBlistLayout, 1); - - contact_color = g_new0(GdkColor, 1); - - expanded = g_new0(FontColorPair, 1); - collapsed = g_new0(FontColorPair, 1); - contact = g_new0(FontColorPair, 1); - online = g_new0(FontColorPair, 1); - away = g_new0(FontColorPair, 1); - offline = g_new0(FontColorPair, 1); - idle = g_new0(FontColorPair, 1); - message = g_new0(FontColorPair, 1); - message_nick_said = g_new0(FontColorPair, 1); - status = g_new0(FontColorPair, 1); - /* <blist> */ if ((success = (sub_node = xmlnode_get_child(root_node, "blist")) != NULL)) { - if ((temp = xmlnode_get_attrib(sub_node, "color")) != NULL && gdk_color_parse(temp, bgcolor)) - gdk_colormap_alloc_color(gdk_colormap_get_system(), bgcolor, FALSE, TRUE); - else { - g_free(bgcolor); - bgcolor = NULL; - } + if ((temp = xmlnode_get_attrib(sub_node, "color")) != NULL && gdk_color_parse(temp, &bgcolor)) + gdk_colormap_alloc_color(gdk_colormap_get_system(), &bgcolor, FALSE, TRUE); + else + memset(&bgcolor, 0, sizeof(GdkColor)); } /* <groups> */ if ((success = (success && (sub_node = xmlnode_get_child(root_node, "groups")) != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "expanded")) != NULL))) { - expanded->font = g_strdup(xmlnode_get_attrib(sub_sub_node, "font")); + expanded.font = xmlnode_get_attrib(sub_sub_node, "font"); if ((temp = xmlnode_get_attrib(sub_sub_node, "text_color")) != NULL && gdk_color_parse(temp, &color)) - expanded->color = g_strdup(temp); - else expanded->color = g_strdup(DEFAULT_TEXT_COLOR); + expanded.color = temp; + else expanded.color = DEFAULT_TEXT_COLOR; - if ((temp = xmlnode_get_attrib(sub_sub_node, "background")) != NULL && gdk_color_parse(temp, expanded_bgcolor)) - gdk_colormap_alloc_color(gdk_colormap_get_system(), expanded_bgcolor, FALSE, TRUE); - else { - g_free(expanded_bgcolor); - expanded_bgcolor = NULL; - } + if ((temp = xmlnode_get_attrib(sub_sub_node, "background")) != NULL && gdk_color_parse(temp, &expanded_bgcolor)) + gdk_colormap_alloc_color(gdk_colormap_get_system(), &expanded_bgcolor, FALSE, TRUE); + else + memset(&expanded_bgcolor, 0, sizeof(GdkColor)); } if ((success = (success && sub_node != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "collapsed")) != NULL))) { - collapsed->font = g_strdup(xmlnode_get_attrib(sub_sub_node, "font")); + collapsed.font = xmlnode_get_attrib(sub_sub_node, "font"); if((temp = xmlnode_get_attrib(sub_sub_node, "text_color")) != NULL && gdk_color_parse(temp, &color)) - collapsed->color = g_strdup(temp); - else collapsed->color = g_strdup(DEFAULT_TEXT_COLOR); + collapsed.color = temp; + else collapsed.color = DEFAULT_TEXT_COLOR; - if ((temp = xmlnode_get_attrib(sub_sub_node, "background")) != NULL && gdk_color_parse(temp, collapsed_bgcolor)) - gdk_colormap_alloc_color(gdk_colormap_get_system(), collapsed_bgcolor, FALSE, TRUE); - else { - g_free(collapsed_bgcolor); - collapsed_bgcolor = NULL; - } + if ((temp = xmlnode_get_attrib(sub_sub_node, "background")) != NULL && gdk_color_parse(temp, &collapsed_bgcolor)) + gdk_colormap_alloc_color(gdk_colormap_get_system(), &collapsed_bgcolor, FALSE, TRUE); + else + memset(&collapsed_bgcolor, 0, sizeof(GdkColor)); } /* <buddys> */ if ((success = (success && (sub_node = xmlnode_get_child(root_node, "buddys")) != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "placement")) != NULL))) { - layout->status_icon = (temp = xmlnode_get_attrib(sub_sub_node, "status_icon")) != NULL ? atoi(temp) : 0; - layout->text = (temp = xmlnode_get_attrib(sub_sub_node, "name")) != NULL ? atoi(temp) : 1; - layout->emblem = (temp = xmlnode_get_attrib(sub_sub_node, "emblem")) != NULL ? atoi(temp) : 2; - layout->protocol_icon = (temp = xmlnode_get_attrib(sub_sub_node, "protocol_icon")) != NULL ? atoi(temp) : 3; - layout->buddy_icon = (temp = xmlnode_get_attrib(sub_sub_node, "buddy_icon")) != NULL ? atoi(temp) : 4; - layout->show_status = (temp = xmlnode_get_attrib(sub_sub_node, "status_icon")) != NULL ? atoi(temp) != 0 : 1; + layout.status_icon = (temp = xmlnode_get_attrib(sub_sub_node, "status_icon")) != NULL ? atoi(temp) : 0; + layout.text = (temp = xmlnode_get_attrib(sub_sub_node, "name")) != NULL ? atoi(temp) : 1; + layout.emblem = (temp = xmlnode_get_attrib(sub_sub_node, "emblem")) != NULL ? atoi(temp) : 2; + layout.protocol_icon = (temp = xmlnode_get_attrib(sub_sub_node, "protocol_icon")) != NULL ? atoi(temp) : 3; + layout.buddy_icon = (temp = xmlnode_get_attrib(sub_sub_node, "buddy_icon")) != NULL ? atoi(temp) : 4; + layout.show_status = (temp = xmlnode_get_attrib(sub_sub_node, "status_icon")) != NULL ? atoi(temp) != 0 : 1; } if ((success = (success && sub_node != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "background")) != NULL))) { - if(gdk_color_parse(xmlnode_get_attrib(sub_sub_node, "color"), contact_color)) - gdk_colormap_alloc_color(gdk_colormap_get_system(), contact_color, FALSE, TRUE); - else { - g_free(contact_color); - contact_color = NULL; - } + if(gdk_color_parse(xmlnode_get_attrib(sub_sub_node, "color"), &contact_color)) + gdk_colormap_alloc_color(gdk_colormap_get_system(), &contact_color, FALSE, TRUE); + else + memset(&contact_color, 0, sizeof(GdkColor)); } if ((success = (success && sub_node != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "contact_text")) != NULL))) { - contact->font = g_strdup(xmlnode_get_attrib(sub_sub_node, "font")); + contact.font = xmlnode_get_attrib(sub_sub_node, "font"); if(gdk_color_parse(temp = xmlnode_get_attrib(sub_sub_node, "color"), &color)) - contact->color = g_strdup(temp); - else contact->color = g_strdup(DEFAULT_TEXT_COLOR); + contact.color = temp; + else contact.color = DEFAULT_TEXT_COLOR; } if ((success = (success && sub_node != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "online_text")) != NULL))) { - online->font = g_strdup(xmlnode_get_attrib(sub_sub_node, "font")); + online.font = xmlnode_get_attrib(sub_sub_node, "font"); if(gdk_color_parse(temp = xmlnode_get_attrib(sub_sub_node, "color"), &color)) - online->color = g_strdup(temp); - else online->color = g_strdup(DEFAULT_TEXT_COLOR); + online.color = temp; + else online.color = DEFAULT_TEXT_COLOR; } if ((success = (success && sub_node != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "away_text")) != NULL))) { - away->font = g_strdup(xmlnode_get_attrib(sub_sub_node, "font")); + away.font = xmlnode_get_attrib(sub_sub_node, "font"); if(gdk_color_parse(temp = xmlnode_get_attrib(sub_sub_node, "color"), &color)) - away->color = g_strdup(temp); - else away->color = g_strdup(DEFAULT_TEXT_COLOR); + away.color = temp; + else away.color = DEFAULT_TEXT_COLOR; } if ((success = (success && sub_node != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "offline_text")) != NULL))) { - offline->font = g_strdup(xmlnode_get_attrib(sub_sub_node, "font")); + offline.font = xmlnode_get_attrib(sub_sub_node, "font"); if(gdk_color_parse(temp = xmlnode_get_attrib(sub_sub_node, "color"), &color)) - online->color = g_strdup(temp); - else online->color = g_strdup(DEFAULT_TEXT_COLOR); + offline.color = temp; + else offline.color = DEFAULT_TEXT_COLOR; } if ((success = (success && sub_node != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "idle_text")) != NULL))) { - idle->font = g_strdup(xmlnode_get_attrib(sub_sub_node, "font")); + idle.font = xmlnode_get_attrib(sub_sub_node, "font"); if(gdk_color_parse(temp = xmlnode_get_attrib(sub_sub_node, "color"), &color)) - idle->color = g_strdup(temp); - else online->color = g_strdup(DEFAULT_TEXT_COLOR); + idle.color = temp; + else idle.color = DEFAULT_TEXT_COLOR; } if ((success = (success && sub_node != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "message_text")) != NULL))) { - message->font = g_strdup(xmlnode_get_attrib(sub_sub_node, "font")); + message.font = xmlnode_get_attrib(sub_sub_node, "font"); if(gdk_color_parse(temp = xmlnode_get_attrib(sub_sub_node, "color"), &color)) - message->color = g_strdup(temp); - else message->color = g_strdup(DEFAULT_TEXT_COLOR); + message.color = temp; + else message.color = DEFAULT_TEXT_COLOR; } if ((success = (success && sub_node != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "message_nick_said_text")) != NULL))) { - message_nick_said->font = g_strdup(xmlnode_get_attrib(sub_sub_node, "font")); + message_nick_said.font = xmlnode_get_attrib(sub_sub_node, "font"); if(gdk_color_parse(temp = xmlnode_get_attrib(sub_sub_node, "color"), &color)) - message_nick_said->color = g_strdup(temp); - else message_nick_said->color = g_strdup(DEFAULT_TEXT_COLOR); + message_nick_said.color = temp; + else message_nick_said.color = DEFAULT_TEXT_COLOR; } if ((success = (success && sub_node != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "status_text")) != NULL))) { - status->font = g_strdup(xmlnode_get_attrib(sub_sub_node, "font")); + status.font = xmlnode_get_attrib(sub_sub_node, "font"); if(gdk_color_parse(temp = xmlnode_get_attrib(sub_sub_node, "color"), &color)) - status->color = g_strdup(temp); - else status->color = g_strdup(DEFAULT_TEXT_COLOR); + status.color = temp; + else status.color = DEFAULT_TEXT_COLOR; } /* name is required for theme manager */ @@ -215,21 +188,21 @@ "image", xmlnode_get_attrib(root_node, "image"), "directory", dir, "description", data, - "background-color", bgcolor, - "layout", layout, - "expanded-color", expanded_bgcolor, - "expanded-text", expanded, - "collapsed-color", collapsed_bgcolor, - "collapsed-text", collapsed, - "contact-color", contact_color, - "contact", contact, - "online", online, - "away", away, - "offline", offline, - "idle", idle, - "message", message, - "message_nick_said", message_nick_said, - "status", status, NULL); + "background-color", &bgcolor, + "layout", &layout, + "expanded-color", &expanded_bgcolor, + "expanded-text", &expanded, + "collapsed-color", &collapsed_bgcolor, + "collapsed-text", &collapsed, + "contact-color", &contact_color, + "contact", &contact, + "online", &online, + "away", &away, + "offline", &offline, + "idle", &idle, + "message", &message, + "message_nick_said", &message_nick_said, + "status", &status, NULL); xmlnode_free(root_node); g_free(data);
--- a/pidgin/gtkblist-theme.c Sun Apr 12 00:43:01 2009 +0000 +++ b/pidgin/gtkblist-theme.c Sat Apr 18 17:43:55 2009 +0000 @@ -96,14 +96,21 @@ free_font_and_color(FontColorPair *pair) { if (pair != NULL) { - if (pair->font) - g_free(pair->font); - if (pair->color) - g_free(pair->color); + g_free((gchar *)pair->font); + g_free((gchar *)pair->color); g_free(pair); } } +static FontColorPair * +copy_font_and_color(const FontColorPair *pair) +{ + FontColorPair *copy = g_new0(FontColorPair, 1); + copy->font = g_strdup(pair->font); + copy->color = g_strdup(pair->color); + return copy; +} + /****************************************************************************** * GObject Stuff *****************************************************************************/ @@ -245,17 +252,22 @@ priv = PIDGIN_BLIST_THEME_GET_PRIVATE(obj); /* Buddy List */ + gdk_color_free(priv->bgcolor); g_free(priv->layout); /* Group */ + gdk_color_free(priv->expanded_color); free_font_and_color(priv->expanded); + gdk_color_free(priv->collapsed_color); free_font_and_color(priv->collapsed); /* Buddy */ + gdk_color_free(priv->contact_color); free_font_and_color(priv->contact); free_font_and_color(priv->online); free_font_and_color(priv->away); free_font_and_color(priv->offline); + free_font_and_color(priv->idle); free_font_and_color(priv->message); free_font_and_color(priv->message_nick_said); free_font_and_color(priv->status); @@ -581,7 +593,7 @@ /* Set Methods */ void -pidgin_blist_theme_set_background_color(PidginBlistTheme *theme, GdkColor *color) +pidgin_blist_theme_set_background_color(PidginBlistTheme *theme, const GdkColor *color) { PidginBlistThemePrivate *priv; @@ -589,7 +601,8 @@ priv = PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme)); - priv->bgcolor = color; + gdk_color_free(priv->bgcolor); + priv->bgcolor = gdk_color_copy(color); } void @@ -605,7 +618,7 @@ } void -pidgin_blist_theme_set_layout(PidginBlistTheme *theme, PidginBlistLayout *layout) +pidgin_blist_theme_set_layout(PidginBlistTheme *theme, const PidginBlistLayout *layout) { PidginBlistThemePrivate *priv; @@ -614,11 +627,11 @@ priv = PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme)); g_free(priv->layout); - priv->layout = layout; + priv->layout = g_memdup(layout, sizeof(PidginBlistLayout)); } void -pidgin_blist_theme_set_expanded_background_color(PidginBlistTheme *theme, GdkColor *color) +pidgin_blist_theme_set_expanded_background_color(PidginBlistTheme *theme, const GdkColor *color) { PidginBlistThemePrivate *priv; @@ -626,11 +639,12 @@ priv = PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme)); - priv->expanded_color = color; + gdk_color_free(priv->expanded_color); + priv->expanded_color = gdk_color_copy(color); } void -pidgin_blist_theme_set_expanded_text_info(PidginBlistTheme *theme, FontColorPair *pair) +pidgin_blist_theme_set_expanded_text_info(PidginBlistTheme *theme, const FontColorPair *pair) { PidginBlistThemePrivate *priv; @@ -639,11 +653,11 @@ priv = PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme)); free_font_and_color(priv->expanded); - priv->expanded = pair; + priv->expanded = copy_font_and_color(pair); } void -pidgin_blist_theme_set_collapsed_background_color(PidginBlistTheme *theme, GdkColor *color) +pidgin_blist_theme_set_collapsed_background_color(PidginBlistTheme *theme, const GdkColor *color) { PidginBlistThemePrivate *priv; @@ -651,11 +665,12 @@ priv = PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme)); - priv->collapsed_color = color; + gdk_color_free(priv->collapsed_color); + priv->collapsed_color = gdk_color_copy(color); } void -pidgin_blist_theme_set_collapsed_text_info(PidginBlistTheme *theme, FontColorPair *pair) +pidgin_blist_theme_set_collapsed_text_info(PidginBlistTheme *theme, const FontColorPair *pair) { PidginBlistThemePrivate *priv; @@ -664,11 +679,11 @@ priv = PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme)); free_font_and_color(priv->collapsed); - priv->collapsed = pair; + priv->collapsed = copy_font_and_color(pair); } void -pidgin_blist_theme_set_contact_color(PidginBlistTheme *theme, GdkColor *color) +pidgin_blist_theme_set_contact_color(PidginBlistTheme *theme, const GdkColor *color) { PidginBlistThemePrivate *priv; @@ -676,11 +691,12 @@ priv = PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme)); - priv->contact_color = color; + gdk_color_free(priv->contact_color); + priv->contact_color = gdk_color_copy(color); } void -pidgin_blist_theme_set_contact_text_info(PidginBlistTheme *theme, FontColorPair *pair) +pidgin_blist_theme_set_contact_text_info(PidginBlistTheme *theme, const FontColorPair *pair) { PidginBlistThemePrivate *priv; @@ -689,11 +705,11 @@ priv = PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme)); free_font_and_color(priv->contact); - priv->contact = pair; + priv->contact = copy_font_and_color(pair); } void -pidgin_blist_theme_set_online_text_info(PidginBlistTheme *theme, FontColorPair *pair) +pidgin_blist_theme_set_online_text_info(PidginBlistTheme *theme, const FontColorPair *pair) { PidginBlistThemePrivate *priv; @@ -702,11 +718,11 @@ priv = PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme)); free_font_and_color(priv->online); - priv->online = pair; + priv->online = copy_font_and_color(pair); } void -pidgin_blist_theme_set_away_text_info(PidginBlistTheme *theme, FontColorPair *pair) +pidgin_blist_theme_set_away_text_info(PidginBlistTheme *theme, const FontColorPair *pair) { PidginBlistThemePrivate *priv; @@ -715,11 +731,11 @@ priv = PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme)); free_font_and_color(priv->away); - priv->away = pair; + priv->away = copy_font_and_color(pair); } void -pidgin_blist_theme_set_offline_text_info(PidginBlistTheme *theme, FontColorPair *pair) +pidgin_blist_theme_set_offline_text_info(PidginBlistTheme *theme, const FontColorPair *pair) { PidginBlistThemePrivate *priv; @@ -728,11 +744,11 @@ priv = PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme)); free_font_and_color(priv->offline); - priv->offline = pair; + priv->offline = copy_font_and_color(pair); } void -pidgin_blist_theme_set_idle_text_info(PidginBlistTheme *theme, FontColorPair *pair) +pidgin_blist_theme_set_idle_text_info(PidginBlistTheme *theme, const FontColorPair *pair) { PidginBlistThemePrivate *priv; @@ -741,11 +757,11 @@ priv = PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme)); free_font_and_color(priv->idle); - priv->idle = pair; + priv->idle = copy_font_and_color(pair); } void -pidgin_blist_theme_set_unread_message_text_info(PidginBlistTheme *theme, FontColorPair *pair) +pidgin_blist_theme_set_unread_message_text_info(PidginBlistTheme *theme, const FontColorPair *pair) { PidginBlistThemePrivate *priv; @@ -754,11 +770,11 @@ priv = PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme)); free_font_and_color(priv->message); - priv->message = pair; + priv->message = copy_font_and_color(pair); } void -pidgin_blist_theme_set_unread_message_nick_said_text_info(PidginBlistTheme *theme, FontColorPair *pair) +pidgin_blist_theme_set_unread_message_nick_said_text_info(PidginBlistTheme *theme, const FontColorPair *pair) { PidginBlistThemePrivate *priv; @@ -767,11 +783,11 @@ priv = PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme)); free_font_and_color(priv->message_nick_said); - priv->message_nick_said = pair; + priv->message_nick_said = copy_font_and_color(pair); } void -pidgin_blist_theme_set_status_text_info(PidginBlistTheme *theme, FontColorPair *pair) +pidgin_blist_theme_set_status_text_info(PidginBlistTheme *theme, const FontColorPair *pair) { PidginBlistThemePrivate *priv; @@ -780,5 +796,5 @@ priv = PIDGIN_BLIST_THEME_GET_PRIVATE(G_OBJECT(theme)); free_font_and_color(priv->status); - priv->status = pair; + priv->status = copy_font_and_color(pair); }
--- a/pidgin/gtkblist-theme.h Sun Apr 12 00:43:01 2009 +0000 +++ b/pidgin/gtkblist-theme.h Sat Apr 18 17:43:55 2009 +0000 @@ -61,8 +61,8 @@ typedef struct { - gchar *font; - gchar *color; + const gchar *font; + const gchar *color; } FontColorPair; @@ -220,7 +220,7 @@ * * @param color The new background color. */ -void pidgin_blist_theme_set_background_color(PidginBlistTheme *theme, GdkColor *color); +void pidgin_blist_theme_set_background_color(PidginBlistTheme *theme, const GdkColor *color); /** * Sets the opacity to be used for this buddy list theme. @@ -234,84 +234,84 @@ * * @param layout The new layout. */ -void pidgin_blist_theme_set_layout(PidginBlistTheme *theme, PidginBlistLayout *layout); +void pidgin_blist_theme_set_layout(PidginBlistTheme *theme, const PidginBlistLayout *layout); /** * Sets the background color to be used for expanded groups. * * @param color The new background color. */ -void pidgin_blist_theme_set_expanded_background_color(PidginBlistTheme *theme, GdkColor *color); +void pidgin_blist_theme_set_expanded_background_color(PidginBlistTheme *theme, const GdkColor *color); /** * Sets the text color and font to be used for expanded groups. * * @param pair The new text font at color pair. */ -void pidgin_blist_theme_set_expanded_text_info(PidginBlistTheme *theme, FontColorPair *pair); +void pidgin_blist_theme_set_expanded_text_info(PidginBlistTheme *theme, const FontColorPair *pair); /** * Sets the background color to be used for collapsed groups. * * @param color The new background color. */ -void pidgin_blist_theme_set_collapsed_background_color(PidginBlistTheme *theme, GdkColor *color); +void pidgin_blist_theme_set_collapsed_background_color(PidginBlistTheme *theme, const GdkColor *color); /** * Sets the text color and font to be used for expanded groups. * * @param pair The new text font at color pair. */ -void pidgin_blist_theme_set_collapsed_text_info(PidginBlistTheme *theme, FontColorPair *pair); +void pidgin_blist_theme_set_collapsed_text_info(PidginBlistTheme *theme, const FontColorPair *pair); /** * Sets the background color to be used for contacts and chats. * * @param color The color to use for contacts and chats. */ -void pidgin_blist_theme_set_contact_color(PidginBlistTheme *theme, GdkColor *color); +void pidgin_blist_theme_set_contact_color(PidginBlistTheme *theme, const GdkColor *color); /** * Sets the text color and font to be used for expanded contacts. * * @param pair The new text font at color pair. */ -void pidgin_blist_theme_set_contact_text_info(PidginBlistTheme *theme, FontColorPair *pair); +void pidgin_blist_theme_set_contact_text_info(PidginBlistTheme *theme, const FontColorPair *pair); /** * Sets the text color and font to be used for online buddies. * * @param pair The new text font at color pair. */ -void pidgin_blist_theme_set_online_text_info(PidginBlistTheme *theme, FontColorPair *pair); +void pidgin_blist_theme_set_online_text_info(PidginBlistTheme *theme, const FontColorPair *pair); /** * Sets the text color and font to be used for away and idle buddies. * * @param pair The new text font at color pair. */ -void pidgin_blist_theme_set_away_text_info(PidginBlistTheme *theme, FontColorPair *pair); +void pidgin_blist_theme_set_away_text_info(PidginBlistTheme *theme, const FontColorPair *pair); /** * Sets the text color and font to be used for offline buddies. * * @param pair The new text font at color pair. */ -void pidgin_blist_theme_set_offline_text_info(PidginBlistTheme *theme, FontColorPair *pair); +void pidgin_blist_theme_set_offline_text_info(PidginBlistTheme *theme, const FontColorPair *pair); /** * Sets the text color and font to be used for idle buddies. * * @param pair The new text font at color pair. */ -void pidgin_blist_theme_set_idle_text_info(PidginBlistTheme *theme, FontColorPair *pair); +void pidgin_blist_theme_set_idle_text_info(PidginBlistTheme *theme, const FontColorPair *pair); /** * Sets the text color and font to be used for buddies with unread messages. * * @param pair The new text font at color pair. */ -void pidgin_blist_theme_set_unread_message_text_info(PidginBlistTheme *theme, FontColorPair *pair); +void pidgin_blist_theme_set_unread_message_text_info(PidginBlistTheme *theme, const FontColorPair *pair); /** * Sets the text color and font to be used for a chat with unread messages @@ -319,14 +319,14 @@ * * @param pair The new text font at color pair. */ -void pidgin_blist_theme_set_unread_message_nick_said_text_info(PidginBlistTheme *theme, FontColorPair *pair); +void pidgin_blist_theme_set_unread_message_nick_said_text_info(PidginBlistTheme *theme, const FontColorPair *pair); /** * Sets the text color and font to be used for buddy status messages. * * @param pair The new text font at color pair. */ -void pidgin_blist_theme_set_status_text_info(PidginBlistTheme *theme, FontColorPair *pair); +void pidgin_blist_theme_set_status_text_info(PidginBlistTheme *theme, const FontColorPair *pair); G_END_DECLS #endif /* PIDGIN_BLIST_THEME_H */
--- a/pidgin/gtkblist.c Sun Apr 12 00:43:01 2009 +0000 +++ b/pidgin/gtkblist.c Sat Apr 18 17:43:55 2009 +0000 @@ -6197,7 +6197,7 @@ PurpleBlistNode *selected_node = NULL; GtkTreeIter iter; FontColorPair *pair; - gchar *text_color, *text_font; + gchar const *text_color, *text_font; PidginBlistTheme *theme; group = (PurpleGroup*)gnode;
--- a/po/de.po Sun Apr 12 00:43:01 2009 +0000 +++ b/po/de.po Sat Apr 18 17:43:55 2009 +0000 @@ -11,9 +11,9 @@ msgstr "" "Project-Id-Version: de\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-03-28 16:59+0100\n" -"PO-Revision-Date: 2009-03-28 16:53+0100\n" -"Last-Translator: Jochen Kemnade <jochenkemnade@web.de>\n" +"POT-Creation-Date: 2009-04-16 16:28+0200\n" +"PO-Revision-Date: 2009-04-16 16:27+0200\n" +"Last-Translator: Björn Voigt <bjoern@cs.tu-berlin.de>\n" "Language-Team: German <de@li.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -614,19 +614,6 @@ msgid "Send To" msgstr "Senden an" -msgid "Invite message" -msgstr "Einladungsnachricht" - -msgid "Invite" -msgstr "Einladen" - -msgid "" -"Please enter the name of the user you wish to invite,\n" -"along with an optional invite message." -msgstr "" -"Bitte geben Sie den Benutzernamen der Person ein, die Sie einladen möchten " -"zusammen mit einer optionalen Einladungsnachricht." - msgid "Conversation" msgstr "Unterhaltung" @@ -889,6 +876,39 @@ msgid "System Log" msgstr "System-Mitschnitt" +msgid "Calling ... " +msgstr "Anrufen..." + +msgid "Hangup" +msgstr "Auflegen" + +#. Number of actions +msgid "Accept" +msgstr "Akzeptieren" + +msgid "Reject" +msgstr "Ablehnen" + +msgid "Call in progress." +msgstr "Anruf läuft." + +msgid "The call has been terminated." +msgstr "Der Anruf wurde beendet." + +#, c-format +msgid "%s wishes to start an audio session with you." +msgstr "%s möchte eine Audio-Sitzung mit Ihnen starten." + +#, c-format +msgid "%s is trying to start an unsupported media session type with you." +msgstr "" + +msgid "You have rejected the call." +msgstr "Sie haben den Anruf abgelehnt." + +msgid "call: Make an audio call." +msgstr "call: Einen Audio-Anruf tätigen." + msgid "Emails" msgstr "E-Mails" @@ -923,6 +943,9 @@ msgid "IM" msgstr "Nachricht" +msgid "Invite" +msgstr "Einladen" + msgid "(none)" msgstr "(kein)" @@ -1092,7 +1115,7 @@ #, c-format msgid "%s has paused while typing to you (%s)" -msgstr "%s hat beim Schreiben an Sie (%s) angehalten" +msgstr "%s hat beim Tippen an Sie (%s) angehalten" #, c-format msgid "%s has signed on (%s)" @@ -1537,6 +1560,27 @@ msgid "Lastlog plugin." msgstr "Verlauf-Plugin." +msgid "" +"\n" +"Fetching TinyURL..." +msgstr "" + +msgid "Only create TinyURL for urls of this length or greater" +msgstr "" + +msgid "TinyURL (or other) address prefix" +msgstr "" + +#, fuzzy +msgid "TinyURL" +msgstr "URL anpassen" + +msgid "TinyURL plugin" +msgstr "" + +msgid "When receiving a message with URL(s), TinyURL for easier copying" +msgstr "" + msgid "accounts" msgstr "Konten" @@ -1638,13 +1682,6 @@ msgid "SSL Certificate Verification" msgstr "SSL-Zertifikatsüberprüfung" -#. Number of actions -msgid "Accept" -msgstr "Akzeptieren" - -msgid "Reject" -msgstr "Ablehnen" - msgid "_View Certificate..." msgstr "Ze_rtifikat ansehen..." @@ -1792,6 +1829,18 @@ msgid "%s left the room (%s)." msgstr "%s hat den Raum verlassen (%s)." +#, fuzzy +msgid "Invite to chat" +msgstr "Zur Konferenz einladen" + +#. Put our happy label in it. +msgid "" +"Please enter the name of the user you wish to invite, along with an optional " +"invite message." +msgstr "" +"Bitte geben Sie den Benutzernamen der Person ein, die Sie einladen möchten " +"zusammen mit einer optionalen Einladungsnachricht." + #, c-format msgid "Failed to get connection: %s" msgstr "Kann keine Verbindung herstellen: %s" @@ -2631,7 +2680,7 @@ msgstr "Nicht nachfragen. Immer als Alarm sichern." msgid "One Time Password" -msgstr "" +msgstr "Einmalpasswort" #. *< type #. *< ui_requirement @@ -2640,13 +2689,13 @@ #. *< priority #. *< id msgid "One Time Password Support" -msgstr "" +msgstr "Unterstützung für Einmalpasswörter" #. *< name #. *< version #. * summary msgid "Enforce that passwords are used only once." -msgstr "" +msgstr "Erzwinge, dass Passwörter nur einmal verwendet werden." #. * description msgid "" @@ -3748,6 +3797,10 @@ msgid "Operating System" msgstr "Betriebssystem" +#, fuzzy +msgid "Local Time" +msgstr "Lokale Datei:" + msgid "Last Activity" msgstr "Letzte Aktivität" @@ -4493,6 +4546,37 @@ msgid "%s has buzzed you!" msgstr "%s hat bei Ihnen angeklopft!" +#, fuzzy, c-format +msgid "Unable to initiate media with %s: invalid JID" +msgstr "Kann die Nachricht an %s nicht senden, ungültige JID" + +#, fuzzy, c-format +msgid "Unable to initiate media with %s: user is not online" +msgstr "Kann die Datei nicht an %s senden, Benutzer ist nicht online" + +#, fuzzy, c-format +msgid "Unable to initiate media with %s: not subscribed to user presence" +msgstr "" +"Kann die Datei nicht an %s senden, Anwesenheit des Benutzers nicht abonniert" + +#, fuzzy +msgid "Media Initiation Failed" +msgstr "Registrierung fehlgeschlagen" + +#, fuzzy, c-format +msgid "" +"Please select the resource of %s with which you would like to start a media " +"session." +msgstr "" +"Bitte wählen Sie die Ressource von %s, an die Sie eine Datei schicken möchten" + +msgid "Select a Resource" +msgstr "Wählen Sie eine Ressource" + +#, fuzzy +msgid "Initiate Media" +msgstr "Initiiere _Chat" + msgid "config: Configure a chat room." msgstr "config: Konfiguriere einen Chatraum." @@ -4687,9 +4771,6 @@ msgstr "" "Bitte wählen Sie die Ressource von %s, an die Sie eine Datei schicken möchten" -msgid "Select a Resource" -msgstr "Wählen Sie eine Ressource" - msgid "Edit User Mood" msgstr "Benutzerstimmung ändern" @@ -7308,9 +7389,8 @@ msgid "Change his/her memo as you like" msgstr "" -#, fuzzy msgid "_Modify" -msgstr "Bearbeiten" +msgstr "_Bearbeiten" #, fuzzy msgid "Memo Modify" @@ -10345,6 +10425,16 @@ msgid "I_M" msgstr "I_M" +#, fuzzy +msgid "_Audio Call" +msgstr "Chat _hinzufügen" + +msgid "Audio/_Video Call" +msgstr "Audio/_Video-Anruf" + +msgid "_Video Call" +msgstr "_Video-Anruf" + msgid "_Send File..." msgstr "_Datei versenden..." @@ -10775,14 +10865,6 @@ msgid "Invite Buddy Into Chat Room" msgstr "Buddy in einen Chatraum einladen" -#. Put our happy label in it. -msgid "" -"Please enter the name of the user you wish to invite, along with an optional " -"invite message." -msgstr "" -"Bitte geben Sie den Benutzernamen der Person ein, die Sie einladen möchten " -"zusammen mit einer optionalen Einladungsnachricht." - msgid "_Buddy:" msgstr "_Buddy:" @@ -10857,6 +10939,22 @@ msgid "/Conversation/Clea_r Scrollback" msgstr "/Unterhaltung/_Leeren" +#, fuzzy +msgid "/Conversation/M_edia" +msgstr "/Unterhaltung/Me_hr" + +#, fuzzy +msgid "/Conversation/Media/_Audio Call" +msgstr "/Unterhaltung/Me_hr" + +#, fuzzy +msgid "/Conversation/Media/_Video Call" +msgstr "/Unterhaltung/Me_hr" + +#, fuzzy +msgid "/Conversation/Media/Audio\\/Video _Call" +msgstr "/Unterhaltung/Betrachte _Mitschnitt" + msgid "/Conversation/Se_nd File..." msgstr "/Unterhaltung/Datei _senden..." @@ -10929,6 +11027,18 @@ msgid "/Conversation/View Log" msgstr "/Unterhaltung/Betrachte Mitschnitt" +#, fuzzy +msgid "/Conversation/Media/Audio Call" +msgstr "/Unterhaltung/Mehr" + +#, fuzzy +msgid "/Conversation/Media/Video Call" +msgstr "/Unterhaltung/Betrachte Mitschnitt" + +#, fuzzy +msgid "/Conversation/Media/Audio\\/Video Call" +msgstr "/Unterhaltung/Mehr" + msgid "/Conversation/Send File..." msgstr "/Unterhaltung/Datei senden ..." @@ -12073,6 +12183,23 @@ msgid "Exiting because another libpurple client is already running.\n" msgstr "Wird geschlossen, da bereits ein anderer libpurple-Client läuft\n" +msgid "/_Media" +msgstr "/_Medien" + +msgid "/Media/_Hangup" +msgstr "/Medien/_Auflegen" + +msgid "Calling..." +msgstr "Anrufen..." + +#, c-format +msgid "%s wishes to start an audio/video session with you." +msgstr "" + +#, c-format +msgid "%s wishes to start a video session with you." +msgstr "" + #, c-format msgid "%s has %d new message." msgid_plural "%s has %d new messages." @@ -12240,43 +12367,33 @@ msgid "Pounce Target" msgstr "Alarm-Ziel" -#, fuzzy msgid "Started typing" -msgstr "zu tippen beginnt" - -#, fuzzy +msgstr "Beginnt zu tippen" + msgid "Paused while typing" -msgstr "beim Tippen anhält" - -#, fuzzy +msgstr "Hat beim Tippen angehalten" + msgid "Signed on" -msgstr "sich anmeldet" - -#, fuzzy +msgstr "Hat sich anmeldet" + msgid "Returned from being idle" -msgstr "%s ist nicht mehr inaktiv (%s)" - -#, fuzzy +msgstr "Ist nicht mehr inaktiv" + msgid "Returned from being away" -msgstr "wieder anwesend ist" - -#, fuzzy +msgstr "Ist wieder anwesend" + msgid "Stopped typing" -msgstr "Tippen gestoppt" - -#, fuzzy +msgstr "Hat das Tippen gestoppt" + msgid "Signed off" -msgstr "sich abmeldet" - -#, fuzzy +msgstr "Hat sich abmeldet" + msgid "Became idle" -msgstr "untätig wird" - -#, fuzzy +msgstr "Wurde untätig" + msgid "Went away" -msgstr "Bei Abwesenheit" - -#, fuzzy +msgstr "Ging hinaus" + msgid "Sent a message" msgstr "Eine Nachricht senden" @@ -12420,9 +12537,6 @@ msgid "Cannot start browser configuration program." msgstr "Kann das Browser-Konfigurationsprogramm nicht starten." -msgid "ST_UN server:" -msgstr "ST_UN Server:" - msgid "<span style=\"italic\">Example: stunserver.org</span>" msgstr "<span style=\"italic\">Beispiel: stunserver.org</span>" @@ -12447,6 +12561,10 @@ msgid "_End port:" msgstr "_End-Port:" +#. TURN server +msgid "Relay Server (TURN)" +msgstr "Relay-Server (TURN)" + msgid "Proxy Server & Browser" msgstr "Proxy-Server & Browser" @@ -12477,7 +12595,7 @@ #. This is a global option that affects SOCKS4 usage even with account-specific proxy settings msgid "Use remote DNS with SOCKS4 proxies" -msgstr "Remote-DNS mit SOCKS4-Proxys benuten" +msgstr "Remote-DNS mit SOCKS4-Proxys benutzen" msgid "_User:" msgstr "_Benutzer:" @@ -14003,3 +14121,16 @@ msgid "This plugin is useful for debbuging XMPP servers or clients." msgstr "" "Dieses Plugin ist nützlich zur Fehlersuche in XMPP-Servern oder -Clients." + +#~ msgid "Invite message" +#~ msgstr "Einladungsnachricht" + +#~ msgid "" +#~ "Please enter the name of the user you wish to invite,\n" +#~ "along with an optional invite message." +#~ msgstr "" +#~ "Bitte geben Sie den Benutzernamen der Person ein, die Sie einladen " +#~ "möchten zusammen mit einer optionalen Einladungsnachricht." + +#~ msgid "ST_UN server:" +#~ msgstr "ST_UN Server:"