diff options
author | Xavier Claessens <xclaesse@gmail.com> | 2007-07-20 23:26:30 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2007-07-20 23:26:30 +0800 |
commit | 73a749cafbd78b45494aa5eba645ef2fe9c4e21a (patch) | |
tree | e6e17735f1c117203bf934ede853927a05201f92 /libempathy/empathy-tp-contact-list.c | |
parent | f2e322a3395fc21c533833cd5b9fffb0cc677e3f (diff) | |
download | gsoc2013-empathy-73a749cafbd78b45494aa5eba645ef2fe9c4e21a.tar gsoc2013-empathy-73a749cafbd78b45494aa5eba645ef2fe9c4e21a.tar.gz gsoc2013-empathy-73a749cafbd78b45494aa5eba645ef2fe9c4e21a.tar.bz2 gsoc2013-empathy-73a749cafbd78b45494aa5eba645ef2fe9c4e21a.tar.lz gsoc2013-empathy-73a749cafbd78b45494aa5eba645ef2fe9c4e21a.tar.xz gsoc2013-empathy-73a749cafbd78b45494aa5eba645ef2fe9c4e21a.tar.zst gsoc2013-empathy-73a749cafbd78b45494aa5eba645ef2fe9c4e21a.zip |
Initial room list support. It does not works yet.
2007-07-20 Xavier Claessens <xclaesse@gmail.com>
* libempathy/Makefile.am:
* libempathy/empathy-tp-roomlist.h:
* libempathy/empathy-tp-roomlist.c:
* libempathy-gtk/empathy-chatrooms-window.c:
* libempathy-gtk/empathy-new-chatroom-dialog.c: Initial room list
support. It does not works yet.
* libempathy-gtk/empathy-account-widget-generic.c: Add support for all
types of integer and float. Fixes bug #457740 (Jamey Hicks).
* libempathy/empathy-tp-chat.c:
* libempathy-gtk/empathy-chat.c: If there is an error sending a message,
show an error message to the user.
* libempathy-gtk/empathy-accounts-dialog.c: Fix a leak, profile should
be unrefed after mc_account_get_profile.
* libempathy/empathy-utils.c:
* libempathy/empathy-utils.h:
* libempathy/empathy-tp-chatroom.c:
* libempathy/empathy-tp-group.h:
* libempathy/empathy-tp-group.c:
* src/empathy.c: Rename empathy_get_channel_id() to
empathy_inspect_channel(). We now have empathy_inspect_handle().
* po/POTFILES.in:
* libempathy/empathy-tp-contact-list.c: Set all contacts from salut
protocol to the "Local Network" group.
* libempathy/empathy-idle.c: Fix NetworkManager support.
* libempathy/empathy-chatroom.h: Fix indentation.
* libempathy-gtk/empathy-status-icon.c:
* libempathy-gtk/empathy-ui-utils.c:
* libempathy-gtk/empathy-ui-utils.h:
- Iconify main window to the status icon like in rhythmbox.
Fixes bug #458106 (Jaap A. Haitsma).
- Rounded avatars. Fixes bug #457992 (Raphael Slinckx)
* Makefile.am: Fix distcheck for gtkdoc (Vincent Untz)
* data/empathy.desktop.in.in: Change application description
(Jaap A. Haitsma).
svn path=/trunk/; revision=190
Diffstat (limited to 'libempathy/empathy-tp-contact-list.c')
-rw-r--r-- | libempathy/empathy-tp-contact-list.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/libempathy/empathy-tp-contact-list.c b/libempathy/empathy-tp-contact-list.c index 4dedb4fef..8ecf564e3 100644 --- a/libempathy/empathy-tp-contact-list.c +++ b/libempathy/empathy-tp-contact-list.c @@ -24,6 +24,7 @@ #include <config.h> #include <string.h> +#include <glib/gi18n.h> #include <libtelepathy/tp-helpers.h> #include <libtelepathy/tp-conn.h> @@ -51,6 +52,7 @@ struct _EmpathyTpContactListPriv { MissionControl *mc; EmpathyContact *user_contact; gboolean setup; + const gchar *protocol_group; EmpathyTpGroup *publish; EmpathyTpGroup *subscribe; @@ -322,6 +324,8 @@ empathy_tp_contact_list_new (McAccount *account) EmpathyTpContactListPriv *priv; EmpathyTpContactList *list; MissionControl *mc; + McProfile *profile; + const gchar *protocol_name; guint handle; GError *error = NULL; @@ -341,6 +345,16 @@ empathy_tp_contact_list_new (McAccount *account) priv->account = g_object_ref (account); priv->mc = mc; + /* Check for protocols that does not support contact groups. We can + * put all contacts into a special group in that case. + * FIXME: Default group should be an information in the profile */ + profile = mc_account_get_profile (account); + protocol_name = mc_profile_get_protocol_name (profile); + if (strcmp (protocol_name, "salut") == 0) { + priv->protocol_group = _("Local Network"); + } + g_object_unref (profile); + g_signal_connect (priv->tp_conn, "destroy", G_CALLBACK (tp_contact_list_destroy_cb), list); @@ -704,7 +718,7 @@ empathy_tp_contact_list_get_from_handles (EmpathyTpContactList *list, /* Create contact objects */ for (i = 0, id = handles_names; *id && i < new_handles->len; id++, i++) { EmpathyContact *contact; - guint handle; + guint handle; handle = g_array_index (new_handles, guint, i); contact = g_object_new (EMPATHY_TYPE_CONTACT, @@ -713,6 +727,10 @@ empathy_tp_contact_list_get_from_handles (EmpathyTpContactList *list, "handle", handle, NULL); + if (priv->protocol_group) { + empathy_contact_add_group (contact, priv->protocol_group); + } + if (!priv->presence_iface) { EmpathyPresence *presence; @@ -960,7 +978,7 @@ tp_contact_list_newchannel_cb (DBusGProxy *proxy, if (handle_type == TP_HANDLE_TYPE_LIST) { TpContactListType list_type; - group = empathy_tp_group_new (new_chan, priv->tp_conn); + group = empathy_tp_group_new (priv->account, new_chan); list_type = tp_contact_list_get_type (list, group); if (list_type == TP_CONTACT_LIST_TYPE_UNKNOWN) { @@ -1058,7 +1076,7 @@ tp_contact_list_newchannel_cb (DBusGProxy *proxy, return; } - group = empathy_tp_group_new (new_chan, priv->tp_conn); + group = empathy_tp_group_new (priv->account, new_chan); empathy_debug (DEBUG_DOMAIN, "New server-side group channel: %s", empathy_tp_group_get_name (group)); @@ -1472,7 +1490,7 @@ tp_contact_list_get_group (EmpathyTpContactList *list, list, NULL); - group = empathy_tp_group_new (group_channel, priv->tp_conn); + group = empathy_tp_group_new (priv->account, group_channel); g_hash_table_insert (priv->groups, group_object_path, group); g_signal_connect (group, "members-added", G_CALLBACK (tp_contact_list_group_members_added_cb), |