aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-tp-group.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2007-07-20 23:26:30 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2007-07-20 23:26:30 +0800
commit73a749cafbd78b45494aa5eba645ef2fe9c4e21a (patch)
treee6e17735f1c117203bf934ede853927a05201f92 /libempathy/empathy-tp-group.c
parentf2e322a3395fc21c533833cd5b9fffb0cc677e3f (diff)
downloadgsoc2013-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-group.c')
-rw-r--r--libempathy/empathy-tp-group.c53
1 files changed, 9 insertions, 44 deletions
diff --git a/libempathy/empathy-tp-group.c b/libempathy/empathy-tp-group.c
index 65e52f091..b86a00e28 100644
--- a/libempathy/empathy-tp-group.c
+++ b/libempathy/empathy-tp-group.c
@@ -28,6 +28,7 @@
#include "empathy-debug.h"
#include "empathy-tp-group.h"
+#include "empathy-utils.h"
#include "empathy-marshal.h"
#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
@@ -36,8 +37,8 @@
#define DEBUG_DOMAIN "TpGroup"
struct _EmpathyTpGroupPriv {
+ McAccount *account;
DBusGProxy *group_iface;
- TpConn *tp_conn;
TpChan *tp_chan;
gchar *group_name;
};
@@ -141,8 +142,8 @@ tp_group_finalize (GObject *object)
g_object_unref (priv->group_iface);
}
- if (priv->tp_conn) {
- g_object_unref (priv->tp_conn);
+ if (priv->account) {
+ g_object_unref (priv->account);
}
if (priv->tp_chan) {
@@ -155,15 +156,15 @@ tp_group_finalize (GObject *object)
}
EmpathyTpGroup *
-empathy_tp_group_new (TpChan *tp_chan,
- TpConn *tp_conn)
+empathy_tp_group_new (McAccount *account,
+ TpChan *tp_chan)
{
EmpathyTpGroup *group;
EmpathyTpGroupPriv *priv;
DBusGProxy *group_iface;
g_return_val_if_fail (TELEPATHY_IS_CHAN (tp_chan), NULL);
- g_return_val_if_fail (TELEPATHY_IS_CONN (tp_conn), NULL);
+ g_return_val_if_fail (MC_IS_ACCOUNT (account), NULL);
group_iface = tp_chan_get_interface (tp_chan,
TELEPATHY_CHAN_IFACE_GROUP_QUARK);
@@ -172,7 +173,7 @@ empathy_tp_group_new (TpChan *tp_chan,
group = g_object_new (EMPATHY_TYPE_TP_GROUP, NULL);
priv = GET_PRIV (group);
- priv->tp_conn = g_object_ref (tp_conn);
+ priv->account = g_object_ref (account);
priv->tp_chan = g_object_ref (tp_chan);
priv->group_iface = g_object_ref (group_iface);
@@ -393,11 +394,9 @@ tp_group_destroy_cb (DBusGProxy *proxy,
priv = GET_PRIV (group);
g_object_unref (priv->group_iface);
- g_object_unref (priv->tp_conn);
g_object_unref (priv->tp_chan);
priv->group_iface = NULL;
priv->tp_chan = NULL;
- priv->tp_conn = NULL;
}
static void
@@ -437,12 +436,6 @@ tp_group_members_changed_cb (DBusGProxy *group_iface,
const gchar *
empathy_tp_group_get_name (EmpathyTpGroup *group)
{
- TelepathyHandleType handle_type;
- guint channel_handle;
- GArray *group_handles;
- gchar **group_names;
- GError *error = NULL;
-
EmpathyTpGroupPriv *priv;
g_return_val_if_fail (EMPATHY_IS_TP_GROUP (group), NULL);
@@ -454,35 +447,7 @@ empathy_tp_group_get_name (EmpathyTpGroup *group)
return priv->group_name;
}
- if (!tp_chan_get_handle (DBUS_G_PROXY (priv->tp_chan),
- &handle_type,
- &channel_handle,
- &error)) {
- empathy_debug (DEBUG_DOMAIN,
- "Couldn't retreive channel handle for group: %s",
- error ? error->message : "No error given");
- g_clear_error (&error);
- return NULL;
- }
-
- group_handles = g_array_new (FALSE, FALSE, sizeof (guint));
- g_array_append_val (group_handles, channel_handle);
- if (!tp_conn_inspect_handles (DBUS_G_PROXY (priv->tp_conn),
- handle_type,
- group_handles,
- &group_names,
- &error)) {
- empathy_debug (DEBUG_DOMAIN,
- "Couldn't get group name: %s",
- error ? error->message : "No error given");
- g_clear_error (&error);
- g_array_free (group_handles, TRUE);
- return NULL;
- }
-
- priv->group_name = *group_names;
- g_array_free (group_handles, TRUE);
- g_free (group_names);
+ priv->group_name = empathy_inspect_channel (priv->account, priv->tp_chan);
return priv->group_name;
}