aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-contact-list.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2007-06-06 17:10:23 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2007-06-06 17:10:23 +0800
commit976d656a08ded1864324b6060ef035ffcb0b833b (patch)
treec852357f8832fc6acb3a355e2c9a3335195a3a09 /libempathy/empathy-contact-list.c
parentc982f4d2eb903359a5083e9466669413d5eaf938 (diff)
downloadgsoc2013-empathy-976d656a08ded1864324b6060ef035ffcb0b833b.tar
gsoc2013-empathy-976d656a08ded1864324b6060ef035ffcb0b833b.tar.gz
gsoc2013-empathy-976d656a08ded1864324b6060ef035ffcb0b833b.tar.bz2
gsoc2013-empathy-976d656a08ded1864324b6060ef035ffcb0b833b.tar.lz
gsoc2013-empathy-976d656a08ded1864324b6060ef035ffcb0b833b.tar.xz
gsoc2013-empathy-976d656a08ded1864324b6060ef035ffcb0b833b.tar.zst
gsoc2013-empathy-976d656a08ded1864324b6060ef035ffcb0b833b.zip
Add support for blinking when there is an event. Make use of EmpathyIdle
2007-06-06 Xavier Claessens <xclaesse@gmail.com> * libempathy-gtk/empathy-status-icon.c: Add support for blinking when there is an event. Make use of EmpathyIdle for presence handling. Add an event when a contact requets subscription. * libempathy-gtk/gossip-contact-list-store.c: * libempathy-gtk/gossip-contact-list-view.c: * libempathy/empathy-contact-manager.c: * libempathy/empathy-tp-contact-list.c: * libempathy/empathy-tp-chatroom.c: * libempathy/empathy-contact-list.c: * libempathy/empathy-contact-list.h: get_contacts() is renamed to get_members(). Adding a signal and a method for local-pending with contacts with the message. Rework completely the contact-list handling in EmpathyTpContactList to follow tp spec. * libempathy/empathy-idle.c: * libempathy/empathy-idle.h: Add properties for the state and the status message. EmpathyIdle is now a singleton to manager self presence. * TODO: Updated. svn path=/trunk/; revision=123
Diffstat (limited to 'libempathy/empathy-contact-list.c')
-rw-r--r--libempathy/empathy-contact-list.c58
1 files changed, 55 insertions, 3 deletions
diff --git a/libempathy/empathy-contact-list.c b/libempathy/empathy-contact-list.c
index b7d02010b..c55d0abf9 100644
--- a/libempathy/empathy-contact-list.c
+++ b/libempathy/empathy-contact-list.c
@@ -23,6 +23,7 @@
#include "config.h"
#include "empathy-contact-list.h"
+#include "empathy-marshal.h"
static void contact_list_base_init (gpointer klass);
@@ -70,10 +71,49 @@ contact_list_base_init (gpointer klass)
G_TYPE_NONE,
1, GOSSIP_TYPE_CONTACT);
+ g_signal_new ("local-pending",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL,
+ empathy_marshal_VOID__OBJECT_STRING,
+ G_TYPE_NONE,
+ 2, GOSSIP_TYPE_CONTACT, G_TYPE_STRING);
+
initialized = TRUE;
}
}
+EmpathyContactListInfo *
+empathy_contact_list_info_new (GossipContact *contact,
+ const gchar *message)
+{
+ EmpathyContactListInfo *info;
+
+ g_return_val_if_fail (GOSSIP_IS_CONTACT (contact), NULL);
+
+ info = g_slice_new0 (EmpathyContactListInfo);
+ info->contact = g_object_ref (contact);
+ info->message = g_strdup (message);
+
+ return info;
+}
+
+void
+empathy_contact_list_info_free (EmpathyContactListInfo *info)
+{
+ if (!info) {
+ return;
+ }
+
+ if (info->contact) {
+ g_object_unref (info->contact);
+ }
+ g_free (info->message);
+
+ g_slice_free (EmpathyContactListInfo, info);
+}
+
void
empathy_contact_list_setup (EmpathyContactList *list)
{
@@ -122,12 +162,24 @@ empathy_contact_list_remove (EmpathyContactList *list,
}
GList *
-empathy_contact_list_get_contacts (EmpathyContactList *list)
+empathy_contact_list_get_members (EmpathyContactList *list)
+{
+ g_return_val_if_fail (EMPATHY_IS_CONTACT_LIST (list), NULL);
+
+ if (EMPATHY_CONTACT_LIST_GET_IFACE (list)->get_members) {
+ return EMPATHY_CONTACT_LIST_GET_IFACE (list)->get_members (list);
+ }
+
+ return NULL;
+}
+
+GList *
+empathy_contact_list_get_local_pending (EmpathyContactList *list)
{
g_return_val_if_fail (EMPATHY_IS_CONTACT_LIST (list), NULL);
- if (EMPATHY_CONTACT_LIST_GET_IFACE (list)->get_contacts) {
- return EMPATHY_CONTACT_LIST_GET_IFACE (list)->get_contacts (list);
+ if (EMPATHY_CONTACT_LIST_GET_IFACE (list)->get_local_pending) {
+ return EMPATHY_CONTACT_LIST_GET_IFACE (list)->get_local_pending (list);
}
return NULL;