aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonny Lamb <jonnylamb@gnome.org>2010-12-09 00:04:00 +0800
committerJonny Lamb <jonnylamb@gnome.org>2011-01-26 21:33:17 +0800
commitb9bccbb48e82c1a431408a3d10931ac7c2c3e8e7 (patch)
tree419785459c8efc418f1e31153b54258bae419a37
parentaa549c4790e7d7cdeb7f858008759faa5369b4df (diff)
downloadgsoc2013-empathy-b9bccbb48e82c1a431408a3d10931ac7c2c3e8e7.tar
gsoc2013-empathy-b9bccbb48e82c1a431408a3d10931ac7c2c3e8e7.tar.gz
gsoc2013-empathy-b9bccbb48e82c1a431408a3d10931ac7c2c3e8e7.tar.bz2
gsoc2013-empathy-b9bccbb48e82c1a431408a3d10931ac7c2c3e8e7.tar.lz
gsoc2013-empathy-b9bccbb48e82c1a431408a3d10931ac7c2c3e8e7.tar.xz
gsoc2013-empathy-b9bccbb48e82c1a431408a3d10931ac7c2c3e8e7.tar.zst
gsoc2013-empathy-b9bccbb48e82c1a431408a3d10931ac7c2c3e8e7.zip
event-manager: add the account to the EmpathyEvent struct
Signed-off-by: Jonny Lamb <jonnylamb@gnome.org>
-rw-r--r--src/empathy-event-manager.c35
-rw-r--r--src/empathy-event-manager.h1
2 files changed, 23 insertions, 13 deletions
diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c
index fdd0672ee..763f31e1c 100644
--- a/src/empathy-event-manager.c
+++ b/src/empathy-event-manager.c
@@ -167,6 +167,11 @@ event_free (EventPriv *event)
g_object_unref (event->public.contact);
}
+ if (event->public.account)
+ {
+ g_object_unref (event->public.account);
+ }
+
g_slice_free (EventPriv, event);
}
@@ -208,6 +213,7 @@ display_notify_area (void)
static void
event_manager_add (EmpathyEventManager *manager,
+ TpAccount *account,
EmpathyContact *contact,
EmpathyEventType type,
const gchar *icon_name,
@@ -221,6 +227,7 @@ event_manager_add (EmpathyEventManager *manager,
EventPriv *event;
event = g_slice_new0 (EventPriv);
+ event->public.account = account != NULL ? g_object_ref (account) : NULL;
event->public.contact = contact ? g_object_ref (contact) : NULL;
event->public.type = type;
event->public.icon_name = g_strdup (icon_name);
@@ -544,9 +551,9 @@ event_manager_chat_message_received_cb (EmpathyTpChat *tp_chat,
event_update (approval->manager, event, EMPATHY_IMAGE_NEW_MESSAGE, header,
msg);
else
- event_manager_add (approval->manager, sender, EMPATHY_EVENT_TYPE_CHAT,
- EMPATHY_IMAGE_NEW_MESSAGE, header, msg, approval,
- event_text_channel_process_func, NULL);
+ event_manager_add (approval->manager, NULL, sender,
+ EMPATHY_EVENT_TYPE_CHAT, EMPATHY_IMAGE_NEW_MESSAGE, header, msg,
+ approval, event_text_channel_process_func, NULL);
empathy_sound_play (window, EMPATHY_SOUND_CONVERSATION_NEW);
@@ -618,8 +625,8 @@ event_manager_media_channel_got_contact (EventManagerApproval *approval)
video ? _("Incoming video call from %s") :_("Incoming call from %s"),
empathy_contact_get_alias (approval->contact));
- event_manager_add (approval->manager, approval->contact,
- EMPATHY_EVENT_TYPE_VOIP,
+ event_manager_add (approval->manager, NULL,
+ approval->contact, EMPATHY_EVENT_TYPE_VOIP,
video ? EMPATHY_IMAGE_VIDEO_CALL : EMPATHY_IMAGE_VOIP,
header, NULL, approval,
event_channel_process_voip_func, NULL);
@@ -750,9 +757,10 @@ display_invite_room_dialog (EventManagerApproval *approval)
tp_channel_get_identifier (approval->main_channel));
}
- event_manager_add (approval->manager, approval->contact,
- EMPATHY_EVENT_TYPE_INVITATION, EMPATHY_IMAGE_GROUP_MESSAGE, msg,
- invite_msg, approval, event_room_channel_process_func, NULL);
+ event_manager_add (approval->manager, NULL,
+ approval->contact, EMPATHY_EVENT_TYPE_INVITATION,
+ EMPATHY_IMAGE_GROUP_MESSAGE, msg, invite_msg, approval,
+ event_room_channel_process_func, NULL);
empathy_sound_play (window, EMPATHY_SOUND_CONVERSATION_NEW);
@@ -797,8 +805,9 @@ event_manager_ft_got_contact_cb (TpConnection *connection,
header = g_strdup_printf (_("Incoming file transfer from %s"),
empathy_contact_get_alias (approval->contact));
- event_manager_add (approval->manager, approval->contact,
- EMPATHY_EVENT_TYPE_TRANSFER, EMPATHY_IMAGE_DOCUMENT_SEND, header, NULL,
+ event_manager_add (approval->manager, NULL,
+ approval->contact, EMPATHY_EVENT_TYPE_TRANSFER,
+ EMPATHY_IMAGE_DOCUMENT_SEND, header, NULL,
approval, event_channel_process_func, NULL);
/* FIXME better sound for incoming file transfers ?*/
@@ -1010,7 +1019,7 @@ event_manager_pendings_changed_cb (EmpathyContactList *list,
else
event_msg = NULL;
- event_manager_add (manager, contact, EMPATHY_EVENT_TYPE_SUBSCRIPTION,
+ event_manager_add (manager, NULL, contact, EMPATHY_EVENT_TYPE_SUBSCRIPTION,
GTK_STOCK_DIALOG_QUESTION, header, event_msg, NULL,
event_pending_subscribe_func, NULL);
@@ -1052,7 +1061,7 @@ event_manager_presence_changed_cb (EmpathyContact *contact,
header = g_strdup_printf (_("%s is now offline."),
empathy_contact_get_alias (contact));
- event_manager_add (manager, contact, EMPATHY_EVENT_TYPE_PRESENCE,
+ event_manager_add (manager, NULL, contact, EMPATHY_EVENT_TYPE_PRESENCE,
EMPATHY_IMAGE_AVATAR_DEFAULT, header, NULL, NULL, NULL, NULL);
}
}
@@ -1072,7 +1081,7 @@ event_manager_presence_changed_cb (EmpathyContact *contact,
header = g_strdup_printf (_("%s is now online."),
empathy_contact_get_alias (contact));
- event_manager_add (manager, contact, EMPATHY_EVENT_TYPE_PRESENCE,
+ event_manager_add (manager, NULL, contact, EMPATHY_EVENT_TYPE_PRESENCE,
EMPATHY_IMAGE_AVATAR_DEFAULT, header, NULL, NULL, NULL, NULL);
}
}
diff --git a/src/empathy-event-manager.h b/src/empathy-event-manager.h
index 39aa0c979..0293a9c3f 100644
--- a/src/empathy-event-manager.h
+++ b/src/empathy-event-manager.h
@@ -58,6 +58,7 @@ typedef enum {
} EmpathyEventType;
typedef struct {
+ TpAccount *account;
EmpathyContact *contact;
EmpathyEventType type;
gchar *icon_name;