summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPacho Ramos <pacho@gentoo.org>2013-04-21 11:39:40 +0000
committerPacho Ramos <pacho@gentoo.org>2013-04-21 11:39:40 +0000
commit021820ee8dc9dd08b7f0f93d438e4952e377ed65 (patch)
tree40b280ad37d7987e46d680f29b32a6acfcf7cd53 /net-voip/telepathy-haze
parentRemove the version from dev-tex/tex4ht (diff)
downloadgentoo-2-021820ee8dc9dd08b7f0f93d438e4952e377ed65.tar.gz
gentoo-2-021820ee8dc9dd08b7f0f93d438e4952e377ed65.tar.bz2
gentoo-2-021820ee8dc9dd08b7f0f93d438e4952e377ed65.zip
Version bump, bug #466256 by Andreas Mielke
(Portage version: 2.1.11.62/cvs/Linux x86_64, signed Manifest commit with key A188FBD4)
Diffstat (limited to 'net-voip/telepathy-haze')
-rw-r--r--net-voip/telepathy-haze/ChangeLog10
-rw-r--r--net-voip/telepathy-haze/files/001-handle_purple_account_request_password.patch269
-rw-r--r--net-voip/telepathy-haze/files/002-fix_resource_leakage.patch141
-rw-r--r--net-voip/telepathy-haze/files/003-fix_more_resource_leaks.patch213
-rw-r--r--net-voip/telepathy-haze/telepathy-haze-0.7.0.ebuild38
5 files changed, 670 insertions, 1 deletions
diff --git a/net-voip/telepathy-haze/ChangeLog b/net-voip/telepathy-haze/ChangeLog
index e6c8764713aa..45150588e8e3 100644
--- a/net-voip/telepathy-haze/ChangeLog
+++ b/net-voip/telepathy-haze/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for net-voip/telepathy-haze
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-voip/telepathy-haze/ChangeLog,v 1.38 2013/03/30 17:10:44 eva Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-voip/telepathy-haze/ChangeLog,v 1.39 2013/04/21 11:39:40 pacho Exp $
+
+*telepathy-haze-0.7.0 (21 Apr 2013)
+
+ 21 Apr 2013; Pacho Ramos <pacho@gentoo.org>
+ +files/001-handle_purple_account_request_password.patch,
+ +files/002-fix_resource_leakage.patch,
+ +files/003-fix_more_resource_leaks.patch, +telepathy-haze-0.7.0.ebuild:
+ Version bump, bug #466256 by Andreas Mielke
30 Mar 2013; Gilles Dartiguelongue <eva@gentoo.org>
-telepathy-haze-0.5.0.ebuild:
diff --git a/net-voip/telepathy-haze/files/001-handle_purple_account_request_password.patch b/net-voip/telepathy-haze/files/001-handle_purple_account_request_password.patch
new file mode 100644
index 000000000000..e53b378c0a31
--- /dev/null
+++ b/net-voip/telepathy-haze/files/001-handle_purple_account_request_password.patch
@@ -0,0 +1,269 @@
+From 66b7fff2f65b65a5d298bf868bb8e21a32492a58 Mon Sep 17 00:00:00 2001
+From: Stefan Becker <chemobejk@gmail.com>
+Date: Tue, 09 Apr 2013 16:30:34 +0000
+Subject: request: handle purple_account_request_password()
+
+This is needed for libpurple plugins with optional password, e.g. SIPE
+since 1.14.1. That libpurple API call boils down to a
+purple_request_fields() call.
+
+The flagging for --enable-leaky-request-stubs was refactored so that
+this new code is always compiled in.
+
+https://bugs.freedesktop.org/show_bug.cgi?id=63326
+---
+diff --git a/src/connection.c b/src/connection.c
+index 0b272a9..6e9121d 100644
+--- a/src/connection.c
++++ b/src/connection.c
+@@ -42,6 +42,7 @@
+ #include "connection-avatars.h"
+ #include "connection-mail.h"
+ #include "extensions/extensions.h"
++#include "request.h"
+
+ #include "connection-capabilities.h"
+
+@@ -138,6 +139,9 @@ struct _HazeConnectionPrivate
+ gchar *prpl_id;
+ PurplePluginProtocolInfo *prpl_info;
+
++ /* Set if purple_account_request_password() was called */
++ gpointer password_request;
++
+ /* Set if purple_account_disconnect has been called or is scheduled to be
+ * called, so should not be called again.
+ */
+@@ -446,6 +450,11 @@ _haze_connection_password_manager_prompt_cb (GObject *source,
+ {
+ DEBUG ("Simple password manager failed: %s", error->message);
+
++ if (priv->password_request)
++ {
++ haze_request_password_cb(priv->password_request, NULL);
++ }
++
+ if (base_conn->status != TP_CONNECTION_STATUS_DISCONNECTED)
+ {
+ tp_base_connection_disconnect_with_dbus_error (base_conn,
+@@ -454,7 +463,13 @@ _haze_connection_password_manager_prompt_cb (GObject *source,
+ }
+
+ /* no need to call purple_account_disconnect because _connect
+- * was never called */
++ * was never called ...
++ * ... unless we had a dynamic password request */
++ if (priv->password_request)
++ {
++ priv->disconnecting = TRUE;
++ purple_account_disconnect (self->account);
++ }
+
+ g_error_free (error);
+ return;
+@@ -463,11 +478,17 @@ _haze_connection_password_manager_prompt_cb (GObject *source,
+ g_free (priv->password);
+ priv->password = g_strdup (password->str);
+
+- purple_account_set_password (self->account, priv->password);
++ if (priv->password_request)
++ {
++ haze_request_password_cb (priv->password_request, priv->password);
++ } else
++ {
++ purple_account_set_password (self->account, priv->password);
+
+- purple_account_set_enabled(self->account, UI_ID, TRUE);
+- purple_account_connect (self->account);
+- priv->connect_called = TRUE;
++ purple_account_set_enabled(self->account, UI_ID, TRUE);
++ purple_account_connect (self->account);
++ priv->connect_called = TRUE;
++ }
+ }
+
+ static gboolean
+@@ -516,6 +537,20 @@ _haze_connection_start_connecting (TpBaseConnection *base,
+ return TRUE;
+ }
+
++void haze_connection_request_password (PurpleAccount *account,
++ void *user_data)
++{
++ HazeConnection *self = ACCOUNT_GET_HAZE_CONNECTION (account);
++ HazeConnectionPrivate *priv = self->priv;
++
++ priv->password_request = user_data;
++
++ /* pop up auth channel */
++ tp_simple_password_manager_prompt_async (self->password_manager,
++ _haze_connection_password_manager_prompt_cb,
++ self);
++}
++
+ static void
+ _haze_connection_shut_down (TpBaseConnection *base)
+ {
+diff --git a/src/connection.h b/src/connection.h
+index c69a7c1..2e68935 100644
+--- a/src/connection.h
++++ b/src/connection.h
+@@ -111,6 +111,9 @@ const gchar *haze_get_fallback_group (void);
+ const gchar **haze_connection_get_implemented_interfaces (void);
+ const gchar **haze_connection_get_guaranteed_interfaces (void);
+
++void haze_connection_request_password (PurpleAccount *account,
++ gpointer user_data);
++
+ G_END_DECLS
+
+ #endif /* #ifndef __HAZE_CONNECTION_H__*/
+diff --git a/src/main.c b/src/main.c
+index afa0a02..4cd171c 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -141,9 +141,7 @@ haze_ui_init (void)
+ purple_accounts_set_ui_ops (haze_get_account_ui_ops ());
+ purple_conversations_set_ui_ops (haze_get_conv_ui_ops ());
+ purple_connections_set_ui_ops (haze_get_connection_ui_ops ());
+-#ifdef ENABLE_LEAKY_REQUEST_STUBS
+ purple_request_set_ui_ops (haze_request_get_ui_ops ());
+-#endif
+ purple_notify_set_ui_ops (haze_notify_get_ui_ops ());
+ purple_privacy_set_ui_ops (haze_get_privacy_ui_ops ());
+ }
+diff --git a/src/request.c b/src/request.c
+index 408678b..dae859d 100644
+--- a/src/request.c
++++ b/src/request.c
+@@ -18,6 +18,8 @@
+ *
+ */
+
++#include "config.h"
++
+ #include <glib-object.h>
+
+ #include <libpurple/account.h>
+@@ -25,7 +27,9 @@
+
+ #include "debug.h"
+ #include "request.h"
++#include "connection.h"
+
++#ifdef ENABLE_LEAKY_REQUEST_STUBS
+ static gpointer
+ haze_request_input (const char *title,
+ const char *primary,
+@@ -95,6 +99,30 @@ haze_request_action (const char *title,
+
+ return NULL;
+ }
++#endif
++
++struct password_data {
++ PurpleRequestFields *fields;
++ PurpleRequestField *password;
++ GCallback ok_cb;
++ GCallback cancel_cb;
++ void *user_data;
++};
++
++void haze_request_password_cb (gpointer user_data,
++ const gchar *password)
++{
++ struct password_data *pd = user_data;
++
++ if (password) {
++ purple_request_field_string_set_value(pd->password, password);
++ ((PurpleRequestFieldsCb)pd->ok_cb)(pd->user_data, pd->fields);
++ } else {
++ ((PurpleRequestFieldsCb)pd->cancel_cb)(pd->user_data, pd->fields);
++ }
++
++ g_free(pd);
++}
+
+ static gpointer
+ haze_request_fields (const char *title,
+@@ -110,14 +138,36 @@ haze_request_fields (const char *title,
+ PurpleConversation *conv,
+ void *user_data)
+ {
+- DEBUG ("ignoring request:");
+- DEBUG (" title: %s", (title ? title : "(null)"));
+- DEBUG (" primary: %s", (primary ? primary : "(null)"));
+- DEBUG (" secondary: %s", (secondary ? secondary : "(null)"));
++ /*
++ * We must support purple_account_request_password() which boils down
++ * to purple_request_fields() with certain parameters. I'm not sure
++ * if this the best way of doing this, but it works.
++ */
++ if (purple_request_fields_exists(fields, "password") &&
++ purple_request_fields_exists(fields, "remember")) {
++ struct password_data *pd = g_new0(struct password_data, 1);
++
++ DEBUG ("triggering password request");
++
++ pd->fields = fields;
++ pd->password = purple_request_fields_get_field(fields, "password");
++ pd->ok_cb = ok_cb;
++ pd->cancel_cb = cancel_cb;
++ pd->user_data = user_data;
++
++ haze_connection_request_password(account, pd);
++
++ } else {
++ DEBUG ("ignoring request:");
++ DEBUG (" title: %s", (title ? title : "(null)"));
++ DEBUG (" primary: %s", (primary ? primary : "(null)"));
++ DEBUG (" secondary: %s", (secondary ? secondary : "(null)"));
++ }
+
+ return NULL;
+ }
+
++#ifdef ENABLE_LEAKY_REQUEST_STUBS
+ static gpointer
+ haze_request_file (const char *title,
+ const char *filename,
+@@ -152,7 +202,7 @@ haze_request_folder (const char *title,
+
+ return NULL;
+ }
+-
++#endif
+
+ /*
+ void (*close_request)(PurpleRequestType type, void *ui_handle);
+@@ -160,12 +210,14 @@ haze_request_folder (const char *title,
+
+ static PurpleRequestUiOps request_uiops =
+ {
++#ifdef ENABLE_LEAKY_REQUEST_STUBS
+ .request_input = haze_request_input,
+ .request_choice = haze_request_choice,
+ .request_action = haze_request_action,
+- .request_fields = haze_request_fields,
+ .request_file = haze_request_file,
+- .request_folder = haze_request_folder
++ .request_folder = haze_request_folder,
++#endif
++ .request_fields = haze_request_fields
+ };
+
+ PurpleRequestUiOps *
+diff --git a/src/request.h b/src/request.h
+index d896cc6..cc572d6 100644
+--- a/src/request.h
++++ b/src/request.h
+@@ -20,4 +20,7 @@
+
+ #include <libpurple/request.h>
+
++void haze_request_password_cb (gpointer user_data,
++ const gchar *password);
++
+ PurpleRequestUiOps *haze_request_get_ui_ops (void);
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/net-voip/telepathy-haze/files/002-fix_resource_leakage.patch b/net-voip/telepathy-haze/files/002-fix_resource_leakage.patch
new file mode 100644
index 000000000000..ebf15dd6dc4c
--- /dev/null
+++ b/net-voip/telepathy-haze/files/002-fix_resource_leakage.patch
@@ -0,0 +1,141 @@
+From eef971c3aeb61b9b60013f3b728f62e7ac5580bf Mon Sep 17 00:00:00 2001
+From: Stefan Becker <chemobejk@gmail.com>
+Date: Wed, 10 Apr 2013 13:13:04 +0000
+Subject: request: fix resource leakage
+
+It is the responsibility of the UI code to free the "fields" parameter
+after haze_request_fields() has been called. This has to be done with
+purple_request_close() and handled in the close_request() UI operation.
+
+https://bugs.freedesktop.org/show_bug.cgi?id=63326
+---
+diff --git a/src/request.c b/src/request.c
+index dae859d..db54317 100644
+--- a/src/request.c
++++ b/src/request.c
+@@ -101,7 +101,7 @@ haze_request_action (const char *title,
+ }
+ #endif
+
+-struct password_data {
++struct fields_data {
+ PurpleRequestFields *fields;
+ PurpleRequestField *password;
+ GCallback ok_cb;
+@@ -109,21 +109,40 @@ struct password_data {
+ void *user_data;
+ };
+
++static void haze_close_request(PurpleRequestType type, void *ui_handle)
++{
++ struct fields_data *fd = ui_handle;
++
++ purple_request_fields_destroy(fd->fields);
++ g_free(fd);
++}
++
+ void haze_request_password_cb (gpointer user_data,
+ const gchar *password)
+ {
+- struct password_data *pd = user_data;
++ struct fields_data *fd = user_data;
+
+ if (password) {
+- purple_request_field_string_set_value(pd->password, password);
+- ((PurpleRequestFieldsCb)pd->ok_cb)(pd->user_data, pd->fields);
++ purple_request_field_string_set_value(fd->password, password);
++ ((PurpleRequestFieldsCb)fd->ok_cb)(fd->user_data, fd->fields);
+ } else {
+- ((PurpleRequestFieldsCb)pd->cancel_cb)(pd->user_data, pd->fields);
++ ((PurpleRequestFieldsCb)fd->cancel_cb)(fd->user_data, fd->fields);
+ }
+
+- g_free(pd);
++ purple_request_close(PURPLE_REQUEST_FIELDS, fd);
+ }
+
++static gboolean haze_request_fields_destroy(gpointer user_data)
++{
++ purple_request_close(PURPLE_REQUEST_FIELDS, user_data);
++ return FALSE;
++}
++
++/*
++ * We must support purple_account_request_password() which boils down
++ * to purple_request_fields() with certain parameters. I'm not sure
++ * if this the best way of doing this, but it works.
++ */
+ static gpointer
+ haze_request_fields (const char *title,
+ const char *primary,
+@@ -138,33 +157,34 @@ haze_request_fields (const char *title,
+ PurpleConversation *conv,
+ void *user_data)
+ {
+- /*
+- * We must support purple_account_request_password() which boils down
+- * to purple_request_fields() with certain parameters. I'm not sure
+- * if this the best way of doing this, but it works.
+- */
++ struct fields_data *fd = g_new0(struct fields_data, 1);
++
++ /* it is our responsibility to destroy this data */
++ fd->fields = fields;
++
+ if (purple_request_fields_exists(fields, "password") &&
+ purple_request_fields_exists(fields, "remember")) {
+- struct password_data *pd = g_new0(struct password_data, 1);
+
+ DEBUG ("triggering password request");
+
+- pd->fields = fields;
+- pd->password = purple_request_fields_get_field(fields, "password");
+- pd->ok_cb = ok_cb;
+- pd->cancel_cb = cancel_cb;
+- pd->user_data = user_data;
++ fd->password = purple_request_fields_get_field(fields, "password");
++ fd->ok_cb = ok_cb;
++ fd->cancel_cb = cancel_cb;
++ fd->user_data = user_data;
+
+- haze_connection_request_password(account, pd);
++ haze_connection_request_password(account, fd);
+
+ } else {
+ DEBUG ("ignoring request:");
+ DEBUG (" title: %s", (title ? title : "(null)"));
+ DEBUG (" primary: %s", (primary ? primary : "(null)"));
+ DEBUG (" secondary: %s", (secondary ? secondary : "(null)"));
++
++ /* Avoid leaking of "fields" */
++ g_idle_add(haze_request_fields_destroy, fd);
+ }
+
+- return NULL;
++ return fd;
+ }
+
+ #ifdef ENABLE_LEAKY_REQUEST_STUBS
+@@ -204,10 +224,6 @@ haze_request_folder (const char *title,
+ }
+ #endif
+
+-/*
+- void (*close_request)(PurpleRequestType type, void *ui_handle);
+-*/
+-
+ static PurpleRequestUiOps request_uiops =
+ {
+ #ifdef ENABLE_LEAKY_REQUEST_STUBS
+@@ -217,7 +233,8 @@ static PurpleRequestUiOps request_uiops =
+ .request_file = haze_request_file,
+ .request_folder = haze_request_folder,
+ #endif
+- .request_fields = haze_request_fields
++ .request_fields = haze_request_fields,
++ .close_request = haze_close_request
+ };
+
+ PurpleRequestUiOps *
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/net-voip/telepathy-haze/files/003-fix_more_resource_leaks.patch b/net-voip/telepathy-haze/files/003-fix_more_resource_leaks.patch
new file mode 100644
index 000000000000..380af23b2955
--- /dev/null
+++ b/net-voip/telepathy-haze/files/003-fix_more_resource_leaks.patch
@@ -0,0 +1,213 @@
+From 4068d8504b2155168b82144a4d45b138e0579ef2 Mon Sep 17 00:00:00 2001
+From: Stefan Becker <chemobejk@gmail.com>
+Date: Thu, 11 Apr 2013 12:45:34 +0000
+Subject: request: fix more resource leaks
+
+Triggered by Will's review comments.
+
+- check callback pointers to be non-NULL before calling them
+- call cancel_cb also in destroy idle callback
+- reset connection's password request field on closing
+- coding style cleanup
+
+https://bugs.freedesktop.org/show_bug.cgi?id=63326
+---
+diff --git a/src/connection.c b/src/connection.c
+index 6e9121d..424802e 100644
+--- a/src/connection.c
++++ b/src/connection.c
+@@ -452,7 +452,7 @@ _haze_connection_password_manager_prompt_cb (GObject *source,
+
+ if (priv->password_request)
+ {
+- haze_request_password_cb(priv->password_request, NULL);
++ haze_request_password_cb (priv->password_request, NULL);
+ }
+
+ if (base_conn->status != TP_CONNECTION_STATUS_DISCONNECTED)
+@@ -481,7 +481,8 @@ _haze_connection_password_manager_prompt_cb (GObject *source,
+ if (priv->password_request)
+ {
+ haze_request_password_cb (priv->password_request, priv->password);
+- } else
++ }
++ else
+ {
+ purple_account_set_password (self->account, priv->password);
+
+@@ -537,8 +538,9 @@ _haze_connection_start_connecting (TpBaseConnection *base,
+ return TRUE;
+ }
+
+-void haze_connection_request_password (PurpleAccount *account,
+- void *user_data)
++void
++haze_connection_request_password (PurpleAccount *account,
++ void *user_data)
+ {
+ HazeConnection *self = ACCOUNT_GET_HAZE_CONNECTION (account);
+ HazeConnectionPrivate *priv = self->priv;
+@@ -551,6 +553,15 @@ void haze_connection_request_password (PurpleAccount *account,
+ self);
+ }
+
++void
++haze_connection_cancel_password_request (PurpleAccount *account)
++{
++ HazeConnection *self = ACCOUNT_GET_HAZE_CONNECTION (account);
++ HazeConnectionPrivate *priv = self->priv;
++
++ priv->password_request = NULL;
++}
++
+ static void
+ _haze_connection_shut_down (TpBaseConnection *base)
+ {
+diff --git a/src/connection.h b/src/connection.h
+index 2e68935..7fc8668 100644
+--- a/src/connection.h
++++ b/src/connection.h
+@@ -113,6 +113,7 @@ const gchar **haze_connection_get_guaranteed_interfaces (void);
+
+ void haze_connection_request_password (PurpleAccount *account,
+ gpointer user_data);
++void haze_connection_cancel_password_request (PurpleAccount *account);
+
+ G_END_DECLS
+
+diff --git a/src/request.c b/src/request.c
+index db54317..8aa7bc9 100644
+--- a/src/request.c
++++ b/src/request.c
+@@ -102,39 +102,62 @@ haze_request_action (const char *title,
+ #endif
+
+ struct fields_data {
++ PurpleAccount *account;
+ PurpleRequestFields *fields;
+ PurpleRequestField *password;
+- GCallback ok_cb;
+- GCallback cancel_cb;
++ PurpleRequestFieldsCb ok_cb;
++ PurpleRequestFieldsCb cancel_cb;
+ void *user_data;
+ };
+
+-static void haze_close_request(PurpleRequestType type, void *ui_handle)
++static void
++haze_close_request (PurpleRequestType type,
++ void *ui_handle)
+ {
+ struct fields_data *fd = ui_handle;
+
+- purple_request_fields_destroy(fd->fields);
+- g_free(fd);
++ haze_connection_cancel_password_request (fd->account);
++ purple_request_fields_destroy (fd->fields);
++ g_slice_free (struct fields_data, fd);
+ }
+
+-void haze_request_password_cb (gpointer user_data,
+- const gchar *password)
++void
++haze_request_password_cb (gpointer user_data,
++ const gchar *password)
+ {
+ struct fields_data *fd = user_data;
+
+- if (password) {
+- purple_request_field_string_set_value(fd->password, password);
+- ((PurpleRequestFieldsCb)fd->ok_cb)(fd->user_data, fd->fields);
+- } else {
+- ((PurpleRequestFieldsCb)fd->cancel_cb)(fd->user_data, fd->fields);
+- }
+-
+- purple_request_close(PURPLE_REQUEST_FIELDS, fd);
++ if (password)
++ {
++ purple_request_field_string_set_value (fd->password, password);
++ if (fd->ok_cb)
++ {
++ (fd->ok_cb) (fd->user_data, fd->fields);
++ }
++ }
++ else
++ {
++ if (fd->cancel_cb)
++ {
++ (fd->cancel_cb) (fd->user_data, fd->fields);
++ }
++ }
++
++ purple_request_close (PURPLE_REQUEST_FIELDS, fd);
+ }
+
+-static gboolean haze_request_fields_destroy(gpointer user_data)
++static gboolean
++haze_request_fields_destroy (gpointer user_data)
+ {
+- purple_request_close(PURPLE_REQUEST_FIELDS, user_data);
++ struct fields_data *fd = user_data;
++
++ if (fd->cancel_cb)
++ {
++ (fd->cancel_cb) (fd->user_data, fd->fields);
++ }
++
++ purple_request_close (PURPLE_REQUEST_FIELDS, user_data);
++
+ return FALSE;
+ }
+
+@@ -157,32 +180,36 @@ haze_request_fields (const char *title,
+ PurpleConversation *conv,
+ void *user_data)
+ {
+- struct fields_data *fd = g_new0(struct fields_data, 1);
++ struct fields_data *fd = g_slice_new0 (struct fields_data);
+
+ /* it is our responsibility to destroy this data */
+- fd->fields = fields;
++ fd->account = account;
++ fd->fields = fields;
++ fd->cancel_cb = (PurpleRequestFieldsCb) cancel_cb;
++ fd->user_data = user_data;
+
+- if (purple_request_fields_exists(fields, "password") &&
+- purple_request_fields_exists(fields, "remember")) {
++ if (purple_request_fields_exists (fields, "password") &&
++ purple_request_fields_exists (fields, "remember"))
++ {
+
+ DEBUG ("triggering password request");
+
+- fd->password = purple_request_fields_get_field(fields, "password");
+- fd->ok_cb = ok_cb;
+- fd->cancel_cb = cancel_cb;
+- fd->user_data = user_data;
++ fd->password = purple_request_fields_get_field (fields, "password");
++ fd->ok_cb = (PurpleRequestFieldsCb) ok_cb;
+
+- haze_connection_request_password(account, fd);
++ haze_connection_request_password (account, fd);
+
+- } else {
++ }
++ else
++ {
+ DEBUG ("ignoring request:");
+ DEBUG (" title: %s", (title ? title : "(null)"));
+ DEBUG (" primary: %s", (primary ? primary : "(null)"));
+ DEBUG (" secondary: %s", (secondary ? secondary : "(null)"));
+
+- /* Avoid leaking of "fields" */
+- g_idle_add(haze_request_fields_destroy, fd);
+- }
++ /* Avoid leaking of "fields" and "user_data" */
++ g_idle_add (haze_request_fields_destroy, fd);
++ }
+
+ return fd;
+ }
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/net-voip/telepathy-haze/telepathy-haze-0.7.0.ebuild b/net-voip/telepathy-haze/telepathy-haze-0.7.0.ebuild
new file mode 100644
index 000000000000..49a7274d2095
--- /dev/null
+++ b/net-voip/telepathy-haze/telepathy-haze-0.7.0.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-voip/telepathy-haze/telepathy-haze-0.7.0.ebuild,v 1.1 2013/04/21 11:39:40 pacho Exp $
+
+EAPI=5
+PYTHON_COMPAT=( python2_{5,6,7} )
+
+inherit eutils python-single-r1
+
+DESCRIPTION="Telepathy connection manager providing libpurple supported protocols."
+HOMEPAGE="http://developer.pidgin.im/wiki/TelepathyHaze"
+SRC_URI="http://telepathy.freedesktop.org/releases/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+#IUSE="test"
+IUSE=""
+
+# Tests failing, see upstream: https://bugs.freedesktop.org/34577
+RESTRICT="test"
+
+RDEPEND="
+ >=net-im/pidgin-2.7
+ >=net-libs/telepathy-glib-0.15.1[${PYTHON_USEDEP}]
+ >=dev-libs/glib-2.22:2
+ >=dev-libs/dbus-glib-0.73
+"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+# test? ( dev-python/twisted-words )"
+
+src_prepare() {
+ # Apply some upstream fixes
+ epatch "${FILESDIR}"/001-handle_purple_account_request_password.patch
+ epatch "${FILESDIR}"/002-fix_resource_leakage.patch
+ epatch "${FILESDIR}"/003-fix_more_resource_leaks.patch
+}