svn path=/trunk/; revision=1246
{
g_free (event->public.icon_name);
g_free (event->public.message);
{
g_free (event->public.icon_name);
g_free (event->public.message);
+
+ if (event->public.contact) {
+ g_object_unref (event->public.contact);
+ }
+
if (event->channel) {
g_signal_handlers_disconnect_by_func (event->channel,
event_remove,
if (event->channel) {
g_signal_handlers_disconnect_by_func (event->channel,
event_remove,
static void
event_manager_add (EmpathyEventManager *manager,
static void
event_manager_add (EmpathyEventManager *manager,
+ EmpathyContact *contact,
const gchar *icon_name,
const gchar *message,
TpChannel *channel,
const gchar *icon_name,
const gchar *message,
TpChannel *channel,
EventPriv *event;
event = g_slice_new0 (EventPriv);
EventPriv *event;
event = g_slice_new0 (EventPriv);
+ event->public.contact = contact ? g_object_ref (contact) : NULL;
event->public.icon_name = g_strdup (icon_name);
event->public.message = g_strdup (message);
event->manager = manager;
event->public.icon_name = g_strdup (icon_name);
event->public.message = g_strdup (message);
event->manager = manager;
empathy_message_get_body (message));
channel = empathy_tp_chat_get_channel (tp_chat);
empathy_message_get_body (message));
channel = empathy_tp_chat_get_channel (tp_chat);
- event_manager_add (manager, EMPATHY_IMAGE_NEW_MESSAGE, msg, channel,
- event_channel_process_func, NULL);
+ event_manager_add (manager, sender, EMPATHY_IMAGE_NEW_MESSAGE, msg,
+ channel, event_channel_process_func, NULL);
msg = g_strdup_printf (_("Incoming call from %s"),
empathy_contact_get_name (contact));
msg = g_strdup_printf (_("Incoming call from %s"),
empathy_contact_get_name (contact));
- event_manager_add (manager, EMPATHY_IMAGE_VOIP, msg, channel,
- event_channel_process_func, NULL);
+ event_manager_add (manager, contact, EMPATHY_IMAGE_VOIP, msg,
+ channel, event_channel_process_func, NULL);
g_free (msg);
g_object_unref (contact);
g_free (msg);
g_object_unref (contact);
empathy_contact_get_name (tube->initiator));
}
empathy_contact_get_name (tube->initiator));
}
- event_manager_add (manager, icon_name, msg, tube->channel,
- event_tube_process_func,
+ event_manager_add (manager, tube->initiator, icon_name, msg,
+ tube->channel, event_tube_process_func,
empathy_dispatcher_tube_ref (tube));
g_free (msg);
empathy_dispatcher_tube_ref (tube));
g_free (msg);
static void
event_pending_subscribe_func (EventPriv *event)
{
static void
event_pending_subscribe_func (EventPriv *event)
{
- EmpathyContact *contact = EMPATHY_CONTACT (event->user_data);
-
- empathy_subscription_dialog_show (contact, NULL);
-
- g_object_unref (contact);
+ empathy_subscription_dialog_show (event->public.contact, NULL);
g_string_append_printf (str, _("\nMessage: %s"), message);
}
g_string_append_printf (str, _("\nMessage: %s"), message);
}
- event_manager_add (manager, GTK_STOCK_DIALOG_QUESTION, str->str, NULL,
- event_pending_subscribe_func,
- g_object_ref (contact));
+ event_manager_add (manager, contact, GTK_STOCK_DIALOG_QUESTION, str->str,
+ NULL, event_pending_subscribe_func, NULL);
g_string_free (str, TRUE);
}
g_string_free (str, TRUE);
}
#include <glib.h>
#include <glib-object.h>
#include <glib.h>
#include <glib-object.h>
+#include <libempathy/empathy-contact.h>
+
G_BEGIN_DECLS
#define EMPATHY_TYPE_EVENT_MANAGER (empathy_event_manager_get_type ())
G_BEGIN_DECLS
#define EMPATHY_TYPE_EVENT_MANAGER (empathy_event_manager_get_type ())
- gchar *icon_name;
- gchar *message;
+ EmpathyContact *contact;
+ gchar *icon_name;
+ gchar *message;
} EmpathyEvent;
GType empathy_event_manager_get_type (void) G_GNUC_CONST;
} EmpathyEvent;
GType empathy_event_manager_get_type (void) G_GNUC_CONST;