summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlban Crequy <alban.crequy@collabora.co.uk>2008-08-22 12:05:32 +0100
committerAlban Crequy <alban.crequy@collabora.co.uk>2008-08-22 12:05:32 +0100
commitc87733695939a01290a72955196a552218b1465b (patch)
treebeac8cf75bfee95c1528e941d9bb238135b5646c
parenta1f29c082515ce22bd56dc859bb22a4f673f0cfe (diff)
parentac3cb0a0ac24e9931e710f3e1e28f34282f8377f (diff)
downloadtelepathy-salut-c87733695939a01290a72955196a552218b1465b.tar.gz
Merge commit 'origin/master' into tubes
Conflicts: src/salut-tubes-channel.c
-rw-r--r--Makefile.am5
-rw-r--r--NEWS14
-rw-r--r--README2
-rwxr-xr-x[-rw-r--r--]autogen.sh0
-rw-r--r--configure.ac4
-rw-r--r--data/.git-darcs-dir0
-rw-r--r--docs/.git-darcs-dir0
-rw-r--r--extensions/.git-darcs-dir0
-rw-r--r--lib/.git-darcs-dir0
-rw-r--r--lib/gibber/.git-darcs-dir0
-rw-r--r--lib/gibber/examples/.git-darcs-dir0
-rw-r--r--lib/gibber/gibber-bytestream-direct.c16
-rw-r--r--lib/gibber/libmd5-rfc/.git-darcs-dir0
-rw-r--r--m4/.git-darcs-dir0
-rw-r--r--rules/.git-darcs-dir0
-rw-r--r--src/.git-darcs-dir0
-rw-r--r--src/Makefile.am25
-rw-r--r--src/salut-connection.c186
-rw-r--r--src/salut-connection.h3
-rw-r--r--src/salut-contact-channel.c80
-rw-r--r--src/salut-contact-channel.h2
-rw-r--r--src/salut-im-channel.c124
-rw-r--r--src/salut-im-channel.h2
-rw-r--r--src/salut-muc-channel.c68
-rw-r--r--src/salut-muc-channel.h1
-rw-r--r--src/salut-roomlist-channel.c53
-rw-r--r--src/salut-roomlist-channel.h1
-rw-r--r--src/salut-tubes-channel.c70
-rw-r--r--src/salut-tubes-channel.h1
-rw-r--r--src/sha1/.git-darcs-dir0
-rw-r--r--tests/.git-darcs-dir0
-rw-r--r--tests/inputs/.git-darcs-dir0
-rwxr-xr-x[-rw-r--r--]tests/run-xmpp-connection-test.sh0
-rw-r--r--tools/.git-darcs-dir0
34 files changed, 549 insertions, 108 deletions
diff --git a/Makefile.am b/Makefile.am
index 9193be04..313cea8e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,7 +4,10 @@ SUBDIRS = tools extensions lib src data m4 tests docs
dist-hook:
chmod u+w ${distdir}/ChangeLog
- if test -d _darcs; then darcs changes >${distdir}/ChangeLog; fi
+ if test -d ${top_srcdir}/.git; then \
+ git log --stat > ${distdir}/ChangeLog || \
+ git log > ${distdir}/ChangeLog; \
+ fi
valgrind:
cd tests && $(MAKE) valgrind
diff --git a/NEWS b/NEWS
index 09392829..68c840e2 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,17 @@
+telepathy-salut 0.3.4 (2008-08-20)
+==================================
+The "a ball of hair" release.
+
+Requirements:
+
+* telepathy-glib >= 0.7.14
+
+Enhancements:
+
+* Implement the Contacts interface
+* Implement the SimplePresence interface
+* Implement spec 0.17.9 (Add various properties to all channels)
+
telepathy-salut 0.3.3 (2008-06-05)
==================================
This unstable release mainly brings an abstraction of the avahi layer making
diff --git a/README b/README
index 1749746b..2666f2f8 100644
--- a/README
+++ b/README
@@ -71,7 +71,7 @@ Hacking
=======
The current version of telepathy-salut is always available from:
- <http://darcs.collabora.co.uk/darcs/telepathy-salut/>
+ <http://git.collabora.co.uk/?p=telepathy-salut.git>
Proposed patches awaiting review can usually be found in Merge Monkey:
<http://monkey.collabora.co.uk/>
diff --git a/autogen.sh b/autogen.sh
index e2af44dc..e2af44dc 100644..100755
--- a/autogen.sh
+++ b/autogen.sh
diff --git a/configure.ac b/configure.ac
index bac4db7f..97bafe82 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,7 +9,7 @@ AC_PREREQ([2.59])
m4_define([salut_major_version], [0])
m4_define([salut_minor_version], [3])
-m4_define([salut_micro_version], [3])
+m4_define([salut_micro_version], [4])
m4_define([salut_nano_version], [1])
# Some magic
@@ -141,7 +141,7 @@ AC_SUBST(LIBXML2_CFLAGS)
AC_SUBST(LIBXML2_LIBS)
dnl Check for telepathy-glib
-PKG_CHECK_MODULES(TELEPATHY_GLIB, [telepathy-glib >= 0.7.13])
+PKG_CHECK_MODULES(TELEPATHY_GLIB, [telepathy-glib >= 0.7.14])
AC_SUBST(TELEPATHY_GLIB_CFLAGS)
AC_SUBST(TELEPATHY_GLIB_LIBS)
diff --git a/data/.git-darcs-dir b/data/.git-darcs-dir
deleted file mode 100644
index e69de29b..00000000
--- a/data/.git-darcs-dir
+++ /dev/null
diff --git a/docs/.git-darcs-dir b/docs/.git-darcs-dir
deleted file mode 100644
index e69de29b..00000000
--- a/docs/.git-darcs-dir
+++ /dev/null
diff --git a/extensions/.git-darcs-dir b/extensions/.git-darcs-dir
deleted file mode 100644
index e69de29b..00000000
--- a/extensions/.git-darcs-dir
+++ /dev/null
diff --git a/lib/.git-darcs-dir b/lib/.git-darcs-dir
deleted file mode 100644
index e69de29b..00000000
--- a/lib/.git-darcs-dir
+++ /dev/null
diff --git a/lib/gibber/.git-darcs-dir b/lib/gibber/.git-darcs-dir
deleted file mode 100644
index e69de29b..00000000
--- a/lib/gibber/.git-darcs-dir
+++ /dev/null
diff --git a/lib/gibber/examples/.git-darcs-dir b/lib/gibber/examples/.git-darcs-dir
deleted file mode 100644
index e69de29b..00000000
--- a/lib/gibber/examples/.git-darcs-dir
+++ /dev/null
diff --git a/lib/gibber/gibber-bytestream-direct.c b/lib/gibber/gibber-bytestream-direct.c
index 03bede7b..9b0422bb 100644
--- a/lib/gibber/gibber-bytestream-direct.c
+++ b/lib/gibber/gibber-bytestream-direct.c
@@ -144,9 +144,9 @@ gibber_bytestream_direct_finalize (GObject *object)
static void
gibber_bytestream_direct_get_property (GObject *object,
- guint property_id,
- GValue *value,
- GParamSpec *pspec)
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
{
GibberBytestreamDirect *self = GIBBER_BYTESTREAM_DIRECT (object);
GibberBytestreamDirectPrivate *priv = GIBBER_BYTESTREAM_DIRECT_GET_PRIVATE
@@ -185,9 +185,9 @@ gibber_bytestream_direct_get_property (GObject *object,
static void
gibber_bytestream_direct_set_property (GObject *object,
- guint property_id,
- const GValue *value,
- GParamSpec *pspec)
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
GibberBytestreamDirect *self = GIBBER_BYTESTREAM_DIRECT (object);
GibberBytestreamDirectPrivate *priv = GIBBER_BYTESTREAM_DIRECT_GET_PRIVATE
@@ -232,8 +232,8 @@ gibber_bytestream_direct_set_property (GObject *object,
static GObject *
gibber_bytestream_direct_constructor (GType type,
- guint n_props,
- GObjectConstructParam *props)
+ guint n_props,
+ GObjectConstructParam *props)
{
GObject *obj;
GibberBytestreamDirectPrivate *priv;
diff --git a/lib/gibber/libmd5-rfc/.git-darcs-dir b/lib/gibber/libmd5-rfc/.git-darcs-dir
deleted file mode 100644
index e69de29b..00000000
--- a/lib/gibber/libmd5-rfc/.git-darcs-dir
+++ /dev/null
diff --git a/m4/.git-darcs-dir b/m4/.git-darcs-dir
deleted file mode 100644
index e69de29b..00000000
--- a/m4/.git-darcs-dir
+++ /dev/null
diff --git a/rules/.git-darcs-dir b/rules/.git-darcs-dir
deleted file mode 100644
index e69de29b..00000000
--- a/rules/.git-darcs-dir
+++ /dev/null
diff --git a/src/.git-darcs-dir b/src/.git-darcs-dir
deleted file mode 100644
index e69de29b..00000000
--- a/src/.git-darcs-dir
+++ /dev/null
diff --git a/src/Makefile.am b/src/Makefile.am
index bf6aed1a..6a9689d5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -69,17 +69,6 @@ if ENABLE_DBUS_TUBES
salut-tubes-channel.c
endif
-if ENABLE_OLPC
- CORE_SOURCES += \
- salut-olpc-activity.h \
- salut-olpc-activity.c \
- salut-avahi-olpc-activity.h \
- salut-avahi-olpc-activity.c \
- salut-olpc-activity-manager.h \
- salut-olpc-activity-manager.c \
- salut-avahi-olpc-activity-manager.h \
- salut-avahi-olpc-activity-manager.c
-endif
AVAHI_BACKEND_SOURCES = \
salut-avahi-discovery-client.h \
@@ -95,6 +84,20 @@ AVAHI_BACKEND_SOURCES = \
salut-avahi-self.h \
salut-avahi-self.c
+if ENABLE_OLPC
+ CORE_SOURCES += \
+ salut-olpc-activity.h \
+ salut-olpc-activity.c \
+ salut-olpc-activity-manager.h \
+ salut-olpc-activity-manager.c
+
+ AVAHI_BACKEND_SOURCES += \
+ salut-avahi-olpc-activity-manager.h \
+ salut-avahi-olpc-activity-manager.c \
+ salut-avahi-olpc-activity.h \
+ salut-avahi-olpc-activity.c
+endif
+
DUMMY_BACKEND_SOURCES = \
salut-dummy-discovery-client.h \
salut-dummy-discovery-client.c
diff --git a/src/salut-connection.c b/src/salut-connection.c
index 6bc7b3e4..e000f139 100644
--- a/src/salut-connection.c
+++ b/src/salut-connection.c
@@ -104,6 +104,8 @@ G_DEFINE_TYPE_WITH_CODE(SalutConnection,
tp_presence_mixin_iface_init);
G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_DBUS_PROPERTIES,
tp_dbus_properties_mixin_iface_init);
+ G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACTS,
+ tp_contacts_mixin_iface_init);
G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CONNECTION_INTERFACE_SIMPLE_PRESENCE,
tp_presence_mixin_simple_presence_iface_init);
G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CONNECTION_INTERFACE_AVATARS,
@@ -234,6 +236,12 @@ salut_connection_shut_down (TpBaseConnection *self);
static gboolean
salut_connection_start_connecting (TpBaseConnection *self, GError **error);
+static void salut_connection_avatars_fill_contact_attributes (GObject *obj,
+ const GArray *contacts, GHashTable *attributes_hash);
+
+static void salut_connection_aliasing_fill_contact_attributes (GObject *obj,
+ const GArray *contacts, GHashTable *attributes_hash);
+
static void
salut_connection_init (SalutConnection *obj)
{
@@ -276,6 +284,20 @@ salut_connection_constructor (GType type,
obj = G_OBJECT_CLASS (salut_connection_parent_class)->
constructor (type, n_props, props);
+ tp_contacts_mixin_init (obj,
+ G_STRUCT_OFFSET (SalutConnection, contacts_mixin));
+
+ tp_base_connection_register_with_contacts_mixin (TP_BASE_CONNECTION (obj));
+ tp_presence_mixin_simple_presence_register_with_contacts_mixin (obj);
+
+ tp_contacts_mixin_add_contact_attributes_iface (obj,
+ TP_IFACE_CONNECTION_INTERFACE_AVATARS,
+ salut_connection_avatars_fill_contact_attributes);
+
+ tp_contacts_mixin_add_contact_attributes_iface (obj,
+ TP_IFACE_CONNECTION_INTERFACE_ALIASING,
+ salut_connection_aliasing_fill_contact_attributes);
+
return obj;
}
@@ -575,9 +597,10 @@ salut_connection_class_init (SalutConnectionClass *salut_connection_class)
GParamSpec *param_spec;
static const gchar *interfaces [] = {
TP_IFACE_CONNECTION_INTERFACE_ALIASING,
+ TP_IFACE_CONNECTION_INTERFACE_AVATARS,
+ TP_IFACE_CONNECTION_INTERFACE_CONTACTS,
TP_IFACE_CONNECTION_INTERFACE_PRESENCE,
TP_IFACE_CONNECTION_INTERFACE_SIMPLE_PRESENCE,
- TP_IFACE_CONNECTION_INTERFACE_AVATARS,
#ifdef ENABLE_OLPC
SALUT_IFACE_OLPC_BUDDY_INFO,
SALUT_IFACE_OLPC_ACTIVITY_PROPERTIES,
@@ -617,6 +640,9 @@ salut_connection_class_init (SalutConnectionClass *salut_connection_class)
tp_presence_mixin_simple_presence_init_dbus_properties (object_class);
+ tp_contacts_mixin_class_init (object_class,
+ G_STRUCT_OFFSET (SalutConnectionClass, contacts_mixin));
+
param_spec = g_param_spec_string ("nickname", "nickname",
"Nickname used in the published data", NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_BLURB);
@@ -1020,6 +1046,39 @@ salut_connection_get_alias_flags (TpSvcConnectionInterfaceAliasing *self,
0);
}
+static const gchar *
+salut_connection_get_alias (SalutConnection *self, TpHandle handle)
+{
+ SalutConnectionPrivate *priv = SALUT_CONNECTION_GET_PRIVATE (self);
+ TpBaseConnection *base = TP_BASE_CONNECTION (self);
+ TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (base,
+ TP_HANDLE_TYPE_CONTACT);
+ const gchar *alias;
+
+ if (handle == base->self_handle)
+ {
+ alias = salut_self_get_alias (priv->self);
+ }
+ else
+ {
+ SalutContact *contact;
+ contact = salut_contact_manager_get_contact (priv->contact_manager,
+ handle);
+
+ if (contact == NULL)
+ {
+ alias = tp_handle_inspect (contact_repo, handle);
+ }
+ else
+ {
+ alias = salut_contact_get_alias (contact);
+ g_object_unref (contact);
+ }
+ }
+
+ return alias;
+}
+
/**
* salut_connection_request_aliases
*
@@ -1032,7 +1091,6 @@ salut_connection_request_aliases (TpSvcConnectionInterfaceAliasing *iface,
const GArray *contacts, DBusGMethodInvocation *context)
{
SalutConnection *self = SALUT_CONNECTION (iface);
- SalutConnectionPrivate *priv = SALUT_CONNECTION_GET_PRIVATE (self);
TpBaseConnection *base = TP_BASE_CONNECTION (self);
int i;
const gchar **aliases;
@@ -1055,26 +1113,8 @@ salut_connection_request_aliases (TpSvcConnectionInterfaceAliasing *iface,
for (i = 0; i < contacts->len; i++)
{
TpHandle handle = g_array_index (contacts, TpHandle, i);
- SalutContact *contact;
- if (handle == TP_BASE_CONNECTION (self)->self_handle)
- {
- aliases[i] = salut_self_get_alias (priv->self);
- }
- else
- {
- contact = salut_contact_manager_get_contact (priv->contact_manager,
- handle);
- if (contact == NULL)
- {
- DEBUG ("RequestAliases called for offline contact");
- aliases[i] = "";
- }
- else
- {
- aliases[i] = salut_contact_get_alias (contact);
- g_object_unref (contact);
- }
- }
+
+ aliases[i] = salut_connection_get_alias (self, handle);
}
tp_svc_connection_interface_aliasing_return_from_request_aliases (context,
@@ -1085,6 +1125,59 @@ salut_connection_request_aliases (TpSvcConnectionInterfaceAliasing *iface,
}
static void
+salut_connection_get_aliases (TpSvcConnectionInterfaceAliasing *iface,
+ const GArray *contacts, DBusGMethodInvocation *context)
+{
+ SalutConnection *self = SALUT_CONNECTION (iface);
+ TpBaseConnection *base = TP_BASE_CONNECTION (self);
+ TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (base,
+ TP_HANDLE_TYPE_CONTACT);
+ guint i;
+ GError *error = NULL;
+ GHashTable *result = g_hash_table_new_full (g_direct_hash, g_direct_equal,
+ NULL, NULL);
+
+ if (!tp_handles_are_valid (contact_repo, contacts, FALSE, &error))
+ {
+ dbus_g_method_return_error (context, error);
+ g_error_free (error);
+ return;
+ }
+
+ for (i = 0; i < contacts->len; i++)
+ {
+ TpHandle handle = g_array_index (contacts, TpHandle, i);
+
+ g_hash_table_insert (result, GUINT_TO_POINTER (handle),
+ (gchar *) salut_connection_get_alias (self, handle));
+ }
+
+ tp_svc_connection_interface_aliasing_return_from_get_aliases (context,
+ result);
+
+ g_hash_table_destroy (result);
+}
+
+static void
+salut_connection_aliasing_fill_contact_attributes (GObject *obj,
+ const GArray *contacts, GHashTable *attributes_hash)
+{
+ SalutConnection *self = SALUT_CONNECTION (obj);
+ guint i;
+
+ for (i = 0; i < contacts->len; i++)
+ {
+ TpHandle handle = g_array_index (contacts, TpHandle, i);
+ GValue *val = tp_g_value_slice_new (G_TYPE_STRING);
+
+ g_value_set_string (val, salut_connection_get_alias (self, handle));
+
+ tp_contacts_mixin_set_contact_attribute (attributes_hash, handle,
+ TP_IFACE_CONNECTION_INTERFACE_ALIASING"/alias", val);
+ }
+}
+
+static void
salut_connection_set_aliases (TpSvcConnectionInterfaceAliasing *iface,
GHashTable *aliases, DBusGMethodInvocation *context)
{
@@ -1152,6 +1245,7 @@ salut_connection_aliasing_service_iface_init (gpointer g_iface,
(klass, salut_connection_##x)
IMPLEMENT (get_alias_flags);
IMPLEMENT (request_aliases);
+ IMPLEMENT (get_aliases);
IMPLEMENT (set_aliases);
#undef IMPLEMENT
}
@@ -1247,6 +1341,7 @@ salut_connection_get_avatar_tokens (TpSvcConnectionInterfaceAvatars *iface,
else
{
SalutContact *contact;
+
contact = salut_contact_manager_get_contact (priv->contact_manager,
handle);
if (contact != NULL)
@@ -1327,6 +1422,53 @@ salut_connection_get_known_avatar_tokens (
}
static void
+salut_connection_avatars_fill_contact_attributes (GObject *obj,
+ const GArray *contacts, GHashTable *attributes_hash)
+{
+ guint i;
+ SalutConnection *self = SALUT_CONNECTION (obj);
+ TpBaseConnection *base = TP_BASE_CONNECTION (self);
+ SalutConnectionPrivate *priv = SALUT_CONNECTION_GET_PRIVATE (self);
+
+ for (i = 0; i < contacts->len; i++)
+ {
+ TpHandle handle = g_array_index (contacts, TpHandle, i);
+ gchar *token = NULL;
+
+ if (base->self_handle == handle)
+ {
+ token = g_strdup (priv->self->avatar_token);
+ }
+ else
+ {
+ SalutContact *contact = salut_contact_manager_get_contact (
+ priv->contact_manager, handle);
+ if (contact != NULL)
+ {
+ if (contact->avatar_token != NULL)
+ token = g_strdup (contact->avatar_token);
+ else
+ /* We always know the tokens, if it's unset then it's "" */
+ token = g_strdup ("");
+
+ g_object_unref (contact);
+ }
+ }
+
+ if (token != NULL)
+ {
+ GValue *val = tp_g_value_slice_new (G_TYPE_STRING);
+
+ g_value_take_string (val, token);
+
+ tp_contacts_mixin_set_contact_attribute (attributes_hash, handle,
+ TP_IFACE_CONNECTION_INTERFACE_AVATARS"/token", val);
+ }
+ }
+}
+
+
+static void
_request_avatars_cb (SalutContact *contact, guint8 *avatar, gsize size,
gpointer user_data)
{
diff --git a/src/salut-connection.h b/src/salut-connection.h
index 8a2a7187..f581ea4d 100644
--- a/src/salut-connection.h
+++ b/src/salut-connection.h
@@ -28,6 +28,7 @@
#include <telepathy-glib/enums.h>
#include <telepathy-glib/base-connection.h>
+#include <telepathy-glib/contacts-mixin.h>
#include <telepathy-glib/dbus-properties-mixin.h>
#include <telepathy-glib/presence-mixin.h>
#include <telepathy-glib/svc-connection.h>
@@ -43,11 +44,13 @@ struct _SalutConnectionClass {
TpBaseConnectionClass parent_class;
TpDBusPropertiesMixinClass properties_mixin;
TpPresenceMixinClass presence_mixin;
+ TpContactsMixinClass contacts_mixin;
};
struct _SalutConnection {
TpBaseConnection parent;
TpPresenceMixin presence_mixin;
+ TpContactsMixin contacts_mixin;
/* Our name on the network */
gchar *name;
diff --git a/src/salut-contact-channel.c b/src/salut-contact-channel.c
index 852e7348..242a0fc3 100644
--- a/src/salut-contact-channel.c
+++ b/src/salut-contact-channel.c
@@ -1,7 +1,7 @@
/*
* salut-contact-channel.c - Source for SalutContactChannel
- * Copyright (C) 2005 Collabora Ltd.
- * Copyright (C) 2005 Nokia Corporation
+ * Copyright (C) 2005-2008 Collabora Ltd.
+ * Copyright (C) 2005-2008 Nokia Corporation
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -18,23 +18,27 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <dbus/dbus-glib.h>
+#include "salut-contact-channel.h"
+
#include <stdio.h>
#include <stdlib.h>
-#include "salut-connection.h"
-#include "salut-contact-channel.h"
-
-#include <telepathy-glib/dbus.h>
+#include <dbus/dbus-glib.h>
#include <telepathy-glib/channel-iface.h>
+#include <telepathy-glib/dbus.h>
#include <telepathy-glib/interfaces.h>
+#include <telepathy-glib/svc-generic.h>
#include <telepathy-glib/util.h>
+#include "salut-connection.h"
+
static void
channel_iface_init (gpointer g_iface, gpointer iface_data);
G_DEFINE_TYPE_WITH_CODE(SalutContactChannel, salut_contact_channel,
G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES,
+ tp_dbus_properties_mixin_iface_init);
G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_IFACE, NULL);
G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL, channel_iface_init);
G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_GROUP,
@@ -42,6 +46,11 @@ G_DEFINE_TYPE_WITH_CODE(SalutContactChannel, salut_contact_channel,
G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_TYPE_CONTACT_LIST, NULL);
)
+static const gchar *salut_contact_channel_interfaces[] = {
+ TP_IFACE_CHANNEL_INTERFACE_GROUP,
+ NULL
+};
+
/* properties */
enum
{
@@ -50,6 +59,8 @@ enum
PROP_HANDLE_TYPE,
PROP_HANDLE,
PROP_CONNECTION,
+ PROP_INTERFACES,
+ PROP_TARGET_ID,
LAST_PROPERTY
};
@@ -143,6 +154,17 @@ salut_contact_channel_get_property (GObject *object,
case PROP_CONNECTION:
g_value_set_object (value, priv->conn);
break;
+ case PROP_INTERFACES:
+ g_value_set_static_boxed (value, salut_contact_channel_interfaces);
+ break;
+ case PROP_TARGET_ID:
+ {
+ TpHandleRepoIface *repo = tp_base_connection_get_handles (
+ (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_LIST);
+
+ g_value_set_string (value, tp_handle_inspect (repo, priv->handle));
+ }
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -190,6 +212,22 @@ salut_contact_channel_set_property (GObject *object,
static void
salut_contact_channel_class_init (SalutContactChannelClass *salut_contact_channel_class)
{
+ static TpDBusPropertiesMixinPropImpl channel_props[] = {
+ { "TargetHandleType", "handle-type", NULL },
+ { "TargetHandle", "handle", NULL },
+ { "TargetID", "target-id", NULL },
+ { "ChannelType", "channel-type", NULL },
+ { "Interfaces", "interfaces", NULL },
+ { NULL }
+ };
+ static TpDBusPropertiesMixinIfaceImpl prop_interfaces[] = {
+ { TP_IFACE_CHANNEL,
+ tp_dbus_properties_mixin_getter_gobject_properties,
+ NULL,
+ channel_props,
+ },
+ { NULL }
+ };
GObjectClass *object_class = G_OBJECT_CLASS (salut_contact_channel_class);
GParamSpec *param_spec;
@@ -209,10 +247,18 @@ salut_contact_channel_class_init (SalutContactChannelClass *salut_contact_channe
SALUT_TYPE_CONNECTION,
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_READWRITE |
+ G_PARAM_STATIC_NAME |
G_PARAM_STATIC_NICK |
G_PARAM_STATIC_BLURB);
g_object_class_install_property (object_class, PROP_CONNECTION, param_spec);
+ param_spec = g_param_spec_boxed ("interfaces", "Extra D-Bus interfaces",
+ "Additional Channel.Interface.* interfaces",
+ G_TYPE_STRV,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_STATIC_NAME);
+ g_object_class_install_property (object_class, PROP_INTERFACES, param_spec);
+
g_object_class_override_property (object_class, PROP_OBJECT_PATH,
"object-path");
g_object_class_override_property (object_class, PROP_CHANNEL_TYPE,
@@ -221,9 +267,21 @@ salut_contact_channel_class_init (SalutContactChannelClass *salut_contact_channe
"handle-type");
g_object_class_override_property (object_class, PROP_HANDLE, "handle");
+ param_spec = g_param_spec_string ("target-id", "Target JID",
+ "The string obtained by inspecting this channel's handle",
+ NULL,
+ G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK |
+ G_PARAM_STATIC_BLURB);
+ g_object_class_install_property (object_class, PROP_TARGET_ID, param_spec);
+
+ salut_contact_channel_class->dbus_props_class.interfaces = prop_interfaces;
+ tp_dbus_properties_mixin_class_init (object_class,
+ G_STRUCT_OFFSET (SalutContactChannelClass, dbus_props_class));
+
tp_group_mixin_class_init (object_class,
G_STRUCT_OFFSET (SalutContactChannelClass, group_class),
NULL, NULL);
+ tp_group_mixin_init_dbus_properties (object_class);
}
void
@@ -324,10 +382,10 @@ salut_contact_channel_get_handle (TpSvcChannel *iface,
*/
static void
salut_contact_channel_get_interfaces (TpSvcChannel *iface,
- DBusGMethodInvocation *context) {
- const char *interfaces[] = { TP_IFACE_CHANNEL_INTERFACE_GROUP, NULL };
-
- tp_svc_channel_return_from_get_interfaces (context, interfaces);
+ DBusGMethodInvocation *context)
+{
+ tp_svc_channel_return_from_get_interfaces (context,
+ salut_contact_channel_interfaces);
}
diff --git a/src/salut-contact-channel.h b/src/salut-contact-channel.h
index 443ef0ca..2563d8b3 100644
--- a/src/salut-contact-channel.h
+++ b/src/salut-contact-channel.h
@@ -31,7 +31,9 @@ typedef struct _SalutContactChannelClass SalutContactChannelClass;
struct _SalutContactChannelClass {
GObjectClass parent_class;
+
TpGroupMixinClass group_class;
+ TpDBusPropertiesMixinClass dbus_props_class;
};
struct _SalutContactChannel {
diff --git a/src/salut-im-channel.c b/src/salut-im-channel.c
index e4406001..1f6e484b 100644
--- a/src/salut-im-channel.c
+++ b/src/salut-im-channel.c
@@ -1,6 +1,6 @@
/*
* salut-im-channel.c - Source for SalutImChannel
- * Copyright (C) 2005-2007 Collabora Ltd.
+ * Copyright (C) 2005-2008 Collabora Ltd.
* @author: Sjoerd Simons <sjoerd@luon.net>
*
* This library is free software; you can redistribute it and/or
@@ -18,62 +18,61 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <dbus/dbus-glib.h>
+#include "salut-im-channel.h"
+
+#include <errno.h>
+#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <errno.h>
#include <string.h>
+#include <sys/socket.h>
-#define DEBUG_FLAG DEBUG_IM
-#include "debug.h"
-
-#include "salut-im-channel.h"
-#include "signals-marshal.h"
-
-#include "salut-connection.h"
-#include "salut-contact.h"
-#include "text-helper.h"
-#include "salut-xmpp-connection-manager.h"
+#include <dbus/dbus-glib.h>
+#include <telepathy-glib/channel-iface.h>
+#include <telepathy-glib/dbus.h>
+#include <telepathy-glib/interfaces.h>
+#include <telepathy-glib/svc-generic.h>
+#include <telepathy-glib/text-mixin.h>
#include <gibber/gibber-linklocal-transport.h>
+#include <gibber/gibber-namespaces.h>
#include <gibber/gibber-xmpp-connection.h>
#include <gibber/gibber-xmpp-stanza.h>
-#include <gibber/gibber-namespaces.h>
-#include <telepathy-glib/text-mixin.h>
-#include <telepathy-glib/channel-iface.h>
-#include <telepathy-glib/interfaces.h>
-#include <telepathy-glib/dbus.h>
+#define DEBUG_FLAG DEBUG_IM
+#include "debug.h"
+#include "salut-connection.h"
+#include "salut-contact.h"
+#include "salut-xmpp-connection-manager.h"
+#include "signals-marshal.h"
+#include "text-helper.h"
-static void
-channel_iface_init (gpointer g_iface, gpointer iface_data);
-static void
-text_iface_init (gpointer g_iface, gpointer iface_data);
+static void channel_iface_init (gpointer g_iface, gpointer iface_data);
+static void text_iface_init (gpointer g_iface, gpointer iface_data);
-static void
-xmpp_connection_manager_new_connection_cb (SalutXmppConnectionManager *mgr,
- GibberXmppConnection *conn,
- SalutContact *contact,
- gpointer user_data);
+static void xmpp_connection_manager_new_connection_cb (
+ SalutXmppConnectionManager *mgr, GibberXmppConnection *conn,
+ SalutContact *contact, gpointer user_data);
-static void
-_setup_connection (SalutImChannel *self);
+static void _setup_connection (SalutImChannel *self);
G_DEFINE_TYPE_WITH_CODE (SalutImChannel, salut_im_channel, G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES,
+ tp_dbus_properties_mixin_iface_init);
G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL, channel_iface_init);
G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_IFACE, NULL);
G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_TYPE_TEXT, text_iface_init);
);
-static gboolean
-message_stanza_filter (SalutXmppConnectionManager *mgr,
+static const gchar *salut_im_channel_interfaces[] = {
+ NULL
+};
+
+static gboolean message_stanza_filter (SalutXmppConnectionManager *mgr,
GibberXmppConnection *conn, GibberXmppStanza *stanza,
SalutContact *contact, gpointer user_data);
-static void
-message_stanza_callback (SalutXmppConnectionManager *mgr,
+static void message_stanza_callback (SalutXmppConnectionManager *mgr,
GibberXmppConnection *conn, GibberXmppStanza *stanza,
SalutContact *contact, gpointer user_data);
@@ -96,6 +95,8 @@ enum
PROP_CONTACT,
PROP_CONNECTION,
PROP_XMPP_CONNECTION_MANAGER,
+ PROP_INTERFACES,
+ PROP_TARGET_ID,
LAST_PROPERTY
};
@@ -231,6 +232,17 @@ salut_im_channel_get_property (GObject *object,
case PROP_XMPP_CONNECTION_MANAGER:
g_value_set_object (value, priv->xmpp_connection_manager);
break;
+ case PROP_INTERFACES:
+ g_value_set_static_boxed (value, salut_im_channel_interfaces);
+ break;
+ case PROP_TARGET_ID:
+ {
+ TpHandleRepoIface *repo = tp_base_connection_get_handles (
+ (TpBaseConnection *) priv->connection, TP_HANDLE_TYPE_CONTACT);
+
+ g_value_set_string (value, tp_handle_inspect (repo, priv->handle));
+ }
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -335,6 +347,22 @@ salut_im_channel_class_init (SalutImChannelClass *salut_im_channel_class)
{
GObjectClass *object_class = G_OBJECT_CLASS (salut_im_channel_class);
GParamSpec *param_spec;
+ static TpDBusPropertiesMixinPropImpl channel_props[] = {
+ { "TargetHandleType", "handle-type", NULL },
+ { "TargetHandle", "handle", NULL },
+ { "TargetID", "target-id", NULL },
+ { "ChannelType", "channel-type", NULL },
+ { "Interfaces", "interfaces", NULL },
+ { NULL }
+ };
+ static TpDBusPropertiesMixinIfaceImpl prop_interfaces[] = {
+ { TP_IFACE_CHANNEL,
+ tp_dbus_properties_mixin_getter_gobject_properties,
+ NULL,
+ channel_props,
+ },
+ { NULL }
+ };
g_type_class_add_private (salut_im_channel_class,
sizeof (SalutImChannelPrivate));
@@ -354,6 +382,13 @@ salut_im_channel_class_init (SalutImChannelClass *salut_im_channel_class)
"handle-type");
g_object_class_override_property (object_class, PROP_HANDLE, "handle");
+ param_spec = g_param_spec_string ("target-id", "Target JID",
+ "The string obtained by inspecting this channel's handle",
+ NULL,
+ G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK |
+ G_PARAM_STATIC_BLURB);
+ g_object_class_install_property (object_class, PROP_TARGET_ID, param_spec);
+
param_spec = g_param_spec_object (
"contact",
"SalutContact object",
@@ -361,6 +396,7 @@ salut_im_channel_class_init (SalutImChannelClass *salut_im_channel_class)
SALUT_TYPE_CONTACT,
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_READWRITE |
+ G_PARAM_STATIC_NAME |
G_PARAM_STATIC_NICK |
G_PARAM_STATIC_BLURB);
g_object_class_install_property (object_class, PROP_CONTACT, param_spec);
@@ -372,6 +408,7 @@ salut_im_channel_class_init (SalutImChannelClass *salut_im_channel_class)
SALUT_TYPE_CONNECTION,
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_READWRITE |
+ G_PARAM_STATIC_NAME |
G_PARAM_STATIC_NICK |
G_PARAM_STATIC_BLURB);
g_object_class_install_property (object_class, PROP_CONNECTION, param_spec);
@@ -383,13 +420,25 @@ salut_im_channel_class_init (SalutImChannelClass *salut_im_channel_class)
SALUT_TYPE_XMPP_CONNECTION_MANAGER,
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_READWRITE |
+ G_PARAM_STATIC_NAME |
G_PARAM_STATIC_NICK |
G_PARAM_STATIC_BLURB);
g_object_class_install_property (object_class, PROP_XMPP_CONNECTION_MANAGER,
param_spec);
+ param_spec = g_param_spec_boxed ("interfaces", "Extra D-Bus interfaces",
+ "Additional Channel.Interface.* interfaces",
+ G_TYPE_STRV,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_STATIC_NAME);
+ g_object_class_install_property (object_class, PROP_INTERFACES, param_spec);
+
tp_text_mixin_class_init (object_class,
G_STRUCT_OFFSET (SalutImChannelClass, text_class));
+
+ salut_im_channel_class->dbus_props_class.interfaces = prop_interfaces;
+ tp_dbus_properties_mixin_class_init (object_class,
+ G_STRUCT_OFFSET (SalutImChannelClass, dbus_props_class));
}
void
@@ -921,9 +970,8 @@ static void
salut_im_channel_get_interfaces (TpSvcChannel *iface,
DBusGMethodInvocation *context)
{
- const char *interfaces[] = { NULL };
-
- tp_svc_channel_return_from_get_interfaces (context, interfaces);
+ tp_svc_channel_return_from_get_interfaces (context,
+ salut_im_channel_interfaces);
}
static void
diff --git a/src/salut-im-channel.h b/src/salut-im-channel.h
index d9def50d..425bb6b6 100644
--- a/src/salut-im-channel.h
+++ b/src/salut-im-channel.h
@@ -33,7 +33,9 @@ typedef struct _SalutImChannelClass SalutImChannelClass;
struct _SalutImChannelClass {
GObjectClass parent_class;
+
TpTextMixinClass text_class;
+ TpDBusPropertiesMixinClass dbus_props_class;
};
struct _SalutImChannel {
diff --git a/src/salut-muc-channel.c b/src/salut-muc-channel.c
index 08984c9c..68b18c85 100644
--- a/src/salut-muc-channel.c
+++ b/src/salut-muc-channel.c
@@ -37,6 +37,7 @@
#include <telepathy-glib/channel-iface.h>
#include <telepathy-glib/interfaces.h>
+#include <telepathy-glib/svc-generic.h>
#include <telepathy-glib/dbus.h>
#include <telepathy-glib/errors.h>
#include <telepathy-glib/util.h>
@@ -54,6 +55,8 @@ static void channel_iface_init (gpointer g_iface, gpointer iface_data);
static void text_iface_init (gpointer g_iface, gpointer iface_data);
G_DEFINE_TYPE_WITH_CODE(SalutMucChannel, salut_muc_channel, G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES,
+ tp_dbus_properties_mixin_iface_init);
G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CHANNEL, channel_iface_init);
G_IMPLEMENT_INTERFACE(TP_TYPE_CHANNEL_IFACE, NULL);
G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_GROUP,
@@ -61,6 +64,11 @@ G_DEFINE_TYPE_WITH_CODE(SalutMucChannel, salut_muc_channel, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CHANNEL_TYPE_TEXT, text_iface_init);
)
+static const char *salut_muc_channel_interfaces[] = {
+ TP_IFACE_CHANNEL_INTERFACE_GROUP,
+ NULL
+};
+
/* signal enum */
enum
{
@@ -83,6 +91,8 @@ enum
PROP_NAME,
PROP_CREATOR,
PROP_XMPP_CONNECTION_MANAGER,
+ PROP_INTERFACES,
+ PROP_TARGET_ID,
LAST_PROPERTY
};
@@ -94,7 +104,6 @@ struct _SalutMucChannelPrivate
gboolean dispose_has_run;
gchar *object_path;
TpHandle handle;
- SalutConnection *connection;
SalutSelf *self;
SalutXmppConnectionManager *xmpp_connection_manager;
GibberMucConnection *muc_connection;
@@ -161,6 +170,17 @@ salut_muc_channel_get_property (GObject *object,
case PROP_XMPP_CONNECTION_MANAGER:
g_value_set_object (value, priv->xmpp_connection_manager);
break;
+ case PROP_INTERFACES:
+ g_value_set_static_boxed (value, salut_muc_channel_interfaces);
+ break;
+ case PROP_TARGET_ID:
+ {
+ TpHandleRepoIface *repo = tp_base_connection_get_handles (
+ (TpBaseConnection *) chan->connection, TP_HANDLE_TYPE_ROOM);
+
+ g_value_set_string (value, tp_handle_inspect (repo, priv->handle));
+ }
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -663,8 +683,25 @@ static void
salut_muc_channel_class_init (SalutMucChannelClass *salut_muc_channel_class) {
GObjectClass *object_class = G_OBJECT_CLASS (salut_muc_channel_class);
GParamSpec *param_spec;
-
- g_type_class_add_private (salut_muc_channel_class, sizeof (SalutMucChannelPrivate));
+ static TpDBusPropertiesMixinPropImpl channel_props[] = {
+ { "TargetHandleType", "handle-type", NULL },
+ { "TargetHandle", "handle", NULL },
+ { "TargetID", "target-id", NULL },
+ { "ChannelType", "channel-type", NULL },
+ { "Interfaces", "interfaces", NULL },
+ { NULL }
+ };
+ static TpDBusPropertiesMixinIfaceImpl prop_interfaces[] = {
+ { TP_IFACE_CHANNEL,
+ tp_dbus_properties_mixin_getter_gobject_properties,
+ NULL,
+ channel_props,
+ },
+ { NULL }
+ };
+
+ g_type_class_add_private (salut_muc_channel_class,
+ sizeof (SalutMucChannelPrivate));
object_class->dispose = salut_muc_channel_dispose;
object_class->finalize = salut_muc_channel_finalize;
@@ -681,6 +718,13 @@ salut_muc_channel_class_init (SalutMucChannelClass *salut_muc_channel_class) {
"handle-type");
g_object_class_override_property (object_class, PROP_HANDLE, "handle");
+ param_spec = g_param_spec_string ("target-id", "Target JID",
+ "The string obtained by inspecting this channel's handle",
+ NULL,
+ G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK |
+ G_PARAM_STATIC_BLURB);
+ g_object_class_install_property (object_class, PROP_TARGET_ID, param_spec);
+
param_spec = g_param_spec_string ("name",
"Name of the muc group",
"The name of the muc group",
@@ -738,6 +782,14 @@ salut_muc_channel_class_init (SalutMucChannelClass *salut_muc_channel_class) {
g_object_class_install_property (object_class,
PROP_CREATOR, param_spec);
+ param_spec = g_param_spec_boxed ("interfaces", "Extra D-Bus interfaces",
+ "Additional Channel.Interface.* interfaces",
+ G_TYPE_STRV,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_STATIC_NAME);
+ g_object_class_install_property (object_class, PROP_INTERFACES, param_spec);
+
+
signals[READY] = g_signal_new (
"ready",
G_OBJECT_CLASS_TYPE (salut_muc_channel_class),
@@ -756,12 +808,17 @@ salut_muc_channel_class_init (SalutMucChannelClass *salut_muc_channel_class) {
g_cclosure_marshal_VOID__POINTER,
G_TYPE_NONE, 1, G_TYPE_POINTER);
+ salut_muc_channel_class->dbus_props_class.interfaces = prop_interfaces;
+ tp_dbus_properties_mixin_class_init (object_class,
+ G_STRUCT_OFFSET (SalutMucChannelClass, dbus_props_class));
+
tp_text_mixin_class_init (object_class,
G_STRUCT_OFFSET(SalutMucChannelClass, text_class));
tp_group_mixin_class_init (object_class,
G_STRUCT_OFFSET(SalutMucChannelClass, group_class),
salut_muc_channel_add_member, NULL);
+ tp_group_mixin_init_dbus_properties (object_class);
}
void
@@ -1135,9 +1192,8 @@ static void
salut_muc_channel_get_interfaces (TpSvcChannel *iface,
DBusGMethodInvocation *context)
{
- const char *interfaces[] = { TP_IFACE_CHANNEL_INTERFACE_GROUP, NULL };
-
- tp_svc_channel_return_from_get_interfaces (context, interfaces);
+ tp_svc_channel_return_from_get_interfaces (context,
+ salut_muc_channel_interfaces);
}
diff --git a/src/salut-muc-channel.h b/src/salut-muc-channel.h
index 451efe10..72b27df6 100644
--- a/src/salut-muc-channel.h
+++ b/src/salut-muc-channel.h
@@ -40,6 +40,7 @@ struct _SalutMucChannelClass {
GObjectClass parent_class;
TpGroupMixinClass group_class;
TpTextMixinClass text_class;
+ TpDBusPropertiesMixinClass dbus_props_class;
/* Virtual method */
gboolean (*publish_service) (SalutMucChannel *self,
diff --git a/src/salut-roomlist-channel.c b/src/salut-roomlist-channel.c
index 7c3cb9dd..e0c14322 100644
--- a/src/salut-roomlist-channel.c
+++ b/src/salut-roomlist-channel.c
@@ -30,6 +30,7 @@
#include <telepathy-glib/interfaces.h>
#include <telepathy-glib/channel-iface.h>
#include <telepathy-glib/svc-channel.h>
+#include <telepathy-glib/svc-generic.h>
#define DEBUG_FLAG DEBUG_ROOMLIST
#include "debug.h"
@@ -45,12 +46,16 @@ static void roomlist_iface_init (gpointer, gpointer);
G_DEFINE_TYPE_WITH_CODE (SalutRoomlistChannel, salut_roomlist_channel,
G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES,
+ tp_dbus_properties_mixin_iface_init);
G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL, channel_iface_init);
G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_TYPE_ROOM_LIST,
roomlist_iface_init);
G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_IFACE, NULL)
);
+static const char *salut_roomlist_channel_interfaces[] = { NULL };
+
/* properties */
enum
{
@@ -59,6 +64,8 @@ enum
PROP_HANDLE_TYPE,
PROP_HANDLE,
PROP_CONNECTION,
+ PROP_INTERFACES,
+ PROP_TARGET_ID,
LAST_PROPERTY
};
@@ -135,6 +142,12 @@ salut_roomlist_channel_get_property (GObject *object,
case PROP_CONNECTION:
g_value_set_object (value, priv->connection);
break;
+ case PROP_INTERFACES:
+ g_value_set_static_boxed (value, salut_roomlist_channel_interfaces);
+ break;
+ case PROP_TARGET_ID:
+ g_value_set_static_string (value, "");
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -193,6 +206,22 @@ salut_roomlist_channel_class_init (
{
GObjectClass *object_class = G_OBJECT_CLASS (salut_roomlist_channel_class);
GParamSpec *param_spec;
+ static TpDBusPropertiesMixinPropImpl channel_props[] = {
+ { "TargetHandleType", "handle-type", NULL },
+ { "TargetHandle", "handle", NULL },
+ { "TargetID", "target-id", NULL },
+ { "ChannelType", "channel-type", NULL },
+ { "Interfaces", "interfaces", NULL },
+ { NULL }
+ };
+ static TpDBusPropertiesMixinIfaceImpl prop_interfaces[] = {
+ { TP_IFACE_CHANNEL,
+ tp_dbus_properties_mixin_getter_gobject_properties,
+ NULL,
+ channel_props,
+ },
+ { NULL }
+ };
g_type_class_add_private (salut_roomlist_channel_class,
sizeof (SalutRoomlistChannelPrivate));
@@ -214,6 +243,20 @@ salut_roomlist_channel_class_init (
g_object_class_override_property (object_class, PROP_HANDLE,
"handle");
+ param_spec = g_param_spec_boxed ("interfaces", "Extra D-Bus interfaces",
+ "Additional Channel.Interface.* interfaces",
+ G_TYPE_STRV,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_STATIC_NAME);
+ g_object_class_install_property (object_class, PROP_INTERFACES, param_spec);
+
+ param_spec = g_param_spec_string ("target-id", "Target JID",
+ "The string obtained by inspecting this channel's handle",
+ NULL,
+ G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK |
+ G_PARAM_STATIC_BLURB);
+ g_object_class_install_property (object_class, PROP_TARGET_ID, param_spec);
+
param_spec = g_param_spec_object ("connection", "SalutConnection object",
"Salut connection object that owns this "
"room list channel object.",
@@ -223,6 +266,11 @@ salut_roomlist_channel_class_init (
G_PARAM_STATIC_NICK |
G_PARAM_STATIC_BLURB);
g_object_class_install_property (object_class, PROP_CONNECTION, param_spec);
+
+ salut_roomlist_channel_class->dbus_props_class.interfaces = prop_interfaces;
+ tp_dbus_properties_mixin_class_init (object_class,
+ G_STRUCT_OFFSET (SalutRoomlistChannelClass, dbus_props_class));
+
}
static void
@@ -455,9 +503,8 @@ static void
salut_roomlist_channel_get_interfaces (TpSvcChannel *iface,
DBusGMethodInvocation *context)
{
- const char *interfaces[] = { NULL };
-
- tp_svc_channel_return_from_get_interfaces (context, interfaces);
+ tp_svc_channel_return_from_get_interfaces (context,
+ salut_roomlist_channel_interfaces);
}
diff --git a/src/salut-roomlist-channel.h b/src/salut-roomlist-channel.h
index 99f9be99..ae916142 100644
--- a/src/salut-roomlist-channel.h
+++ b/src/salut-roomlist-channel.h
@@ -31,6 +31,7 @@ typedef struct _SalutRoomlistChannelClass SalutRoomlistChannelClass;
struct _SalutRoomlistChannelClass {
GObjectClass parent_class;
+ TpDBusPropertiesMixinClass dbus_props_class;
};
struct _SalutRoomlistChannel {
diff --git a/src/salut-tubes-channel.c b/src/salut-tubes-channel.c
index bdd4be2c..9aac0d1a 100644
--- a/src/salut-tubes-channel.c
+++ b/src/salut-tubes-channel.c
@@ -31,6 +31,7 @@
#include <telepathy-glib/interfaces.h>
#include <telepathy-glib/dbus.h>
#include <telepathy-glib/svc-channel.h>
+#include <telepathy-glib/svc-generic.h>
#include <gibber/gibber-muc-connection.h>
#include <gibber/gibber-bytestream-muc.h>
@@ -71,6 +72,8 @@ static void
tubes_iface_init (gpointer g_iface, gpointer iface_data);
G_DEFINE_TYPE_WITH_CODE (SalutTubesChannel, salut_tubes_channel, G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES,
+ tp_dbus_properties_mixin_iface_init);
G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL, channel_iface_init);
G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_TYPE_TUBES, tubes_iface_init);
G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_GROUP,
@@ -109,6 +112,14 @@ typedef enum
} ChannelState;
/* properties */
+static const char *salut_tubes_channel_interfaces[] = {
+ TP_IFACE_CHANNEL_INTERFACE_GROUP,
+ /* If more interfaces are added, either keep Group as the first, or change
+ * the implementations of salut_tubes_channel_get_interfaces () and
+ * salut_tubes_channel_get_property () too */
+ NULL
+};
+
enum
{
PROP_OBJECT_PATH = 1,
@@ -117,6 +128,8 @@ enum
PROP_HANDLE,
PROP_CONNECTION,
PROP_MUC,
+ PROP_INTERFACES,
+ PROP_TARGET_ID,
/* only for 1-1 tubes */
PROP_CONTACT,
@@ -282,6 +295,19 @@ salut_tubes_channel_get_property (GObject *object,
break;
case PROP_XMPP_CONNECTION_MANAGER:
g_value_set_object (value, priv->xmpp_connection_manager);
+ case PROP_INTERFACES:
+ if (chan->muc)
+ g_value_set_static_boxed (value, salut_tubes_channel_interfaces);
+ else
+ g_value_set_static_boxed (value, salut_tubes_channel_interfaces + 1);
+ break;
+ case PROP_TARGET_ID:
+ {
+ TpHandleRepoIface *repo = tp_base_connection_get_handles (
+ (TpBaseConnection *) priv->conn, priv->handle_type);
+
+ g_value_set_string (value, tp_handle_inspect (repo, priv->handle));
+ }
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -2202,6 +2228,22 @@ salut_tubes_channel_class_init (
{
GObjectClass *object_class = G_OBJECT_CLASS (salut_tubes_channel_class);
GParamSpec *param_spec;
+ static TpDBusPropertiesMixinPropImpl channel_props[] = {
+ { "TargetHandleType", "handle-type", NULL },
+ { "TargetHandle", "handle", NULL },
+ { "TargetID", "target-id", NULL },
+ { "ChannelType", "channel-type", NULL },
+ { "Interfaces", "interfaces", NULL },
+ { NULL }
+ };
+ static TpDBusPropertiesMixinIfaceImpl prop_interfaces[] = {
+ { TP_IFACE_CHANNEL,
+ tp_dbus_properties_mixin_getter_gobject_properties,
+ NULL,
+ channel_props,
+ },
+ { NULL }
+ };
g_type_class_add_private (salut_tubes_channel_class,
sizeof (SalutTubesChannelPrivate));
@@ -2222,6 +2264,13 @@ salut_tubes_channel_class_init (
"handle-type");
g_object_class_override_property (object_class, PROP_HANDLE, "handle");
+ param_spec = g_param_spec_string ("target-id", "Target JID",
+ "The string obtained by inspecting this channel's handle",
+ NULL,
+ G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK |
+ G_PARAM_STATIC_BLURB);
+ g_object_class_install_property (object_class, PROP_TARGET_ID, param_spec);
+
param_spec = g_param_spec_object (
"connection",
"SalutConnection object",
@@ -2269,6 +2318,18 @@ salut_tubes_channel_class_init (
G_PARAM_STATIC_BLURB);
g_object_class_install_property (object_class, PROP_XMPP_CONNECTION_MANAGER,
param_spec);
+ param_spec = g_param_spec_boxed ("interfaces", "Extra D-Bus interfaces",
+ "Additional Channel.Interface.* interfaces",
+ G_TYPE_STRV,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_STATIC_NAME);
+ g_object_class_install_property (object_class, PROP_INTERFACES, param_spec);
+
+ salut_tubes_channel_class->dbus_props_class.interfaces = prop_interfaces;
+ tp_dbus_properties_mixin_class_init (object_class,
+ G_STRUCT_OFFSET (SalutTubesChannelClass, dbus_props_class));
+
+ tp_external_group_mixin_init_dbus_properties (object_class);
}
void
@@ -2443,19 +2504,18 @@ static void
salut_tubes_channel_get_interfaces (TpSvcChannel *iface,
DBusGMethodInvocation *context)
{
- const char *interfaces[] = {
- TP_IFACE_CHANNEL_INTERFACE_GROUP,
- NULL };
SalutTubesChannel *self = SALUT_TUBES_CHANNEL (iface);
if (self->muc)
{
- tp_svc_channel_return_from_get_interfaces (context, interfaces);
+ tp_svc_channel_return_from_get_interfaces (context,
+ salut_tubes_channel_interfaces);
}
else
{
/* only show the NULL */
- tp_svc_channel_return_from_get_interfaces (context, interfaces + 1);
+ tp_svc_channel_return_from_get_interfaces (context,
+ salut_tubes_channel_interfaces + 1);
}
}
diff --git a/src/salut-tubes-channel.h b/src/salut-tubes-channel.h
index 493c093b..4119d201 100644
--- a/src/salut-tubes-channel.h
+++ b/src/salut-tubes-channel.h
@@ -34,6 +34,7 @@ typedef struct _SalutTubesChannelClass SalutTubesChannelClass;
struct _SalutTubesChannelClass {
GObjectClass parent_class;
+ TpDBusPropertiesMixinClass dbus_props_class;
};
struct _SalutTubesChannel {
diff --git a/src/sha1/.git-darcs-dir b/src/sha1/.git-darcs-dir
deleted file mode 100644
index e69de29b..00000000
--- a/src/sha1/.git-darcs-dir
+++ /dev/null
diff --git a/tests/.git-darcs-dir b/tests/.git-darcs-dir
deleted file mode 100644
index e69de29b..00000000
--- a/tests/.git-darcs-dir
+++ /dev/null
diff --git a/tests/inputs/.git-darcs-dir b/tests/inputs/.git-darcs-dir
deleted file mode 100644
index e69de29b..00000000
--- a/tests/inputs/.git-darcs-dir
+++ /dev/null
diff --git a/tests/run-xmpp-connection-test.sh b/tests/run-xmpp-connection-test.sh
index e2337abc..e2337abc 100644..100755
--- a/tests/run-xmpp-connection-test.sh
+++ b/tests/run-xmpp-connection-test.sh
diff --git a/tools/.git-darcs-dir b/tools/.git-darcs-dir
deleted file mode 100644
index e69de29b..00000000
--- a/tools/.git-darcs-dir
+++ /dev/null