[Telepathy-commits] [telepathy-gabble/master] Add basic support for Group properties to MUC channel
Simon McVittie
simon.mcvittie at collabora.co.uk
Tue Aug 19 10:52:55 PDT 2008
20080526113850-53eee-44e4f7459e3b458bc91c9bf3ee9833bd1fa2a972.gz
---
src/gabble-muc-channel.c | 12 ++++++++++++
src/gabble-muc-channel.h | 2 ++
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/src/gabble-muc-channel.c b/src/gabble-muc-channel.c
index 3b6b185..8ef3a30 100644
--- a/src/gabble-muc-channel.c
+++ b/src/gabble-muc-channel.c
@@ -55,6 +55,8 @@ static void chat_state_iface_init (gpointer, gpointer);
G_DEFINE_TYPE_WITH_CODE (GabbleMucChannel, gabble_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_SVC_PROPERTIES_INTERFACE,
@@ -291,6 +293,7 @@ gabble_muc_channel_constructor (GType type, guint n_props,
/* set initial group flags */
tp_group_mixin_change_flags (obj,
+ TP_CHANNEL_GROUP_FLAG_PROPERTIES |
TP_CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES |
TP_CHANNEL_GROUP_FLAG_HANDLE_OWNERS_NOT_AVAILABLE |
TP_CHANNEL_GROUP_FLAG_CAN_ADD,
@@ -798,6 +801,10 @@ gabble_muc_channel_class_init (GabbleMucChannelClass *gabble_muc_channel_class)
{
GObjectClass *object_class = G_OBJECT_CLASS (gabble_muc_channel_class);
GParamSpec *param_spec;
+ static TpDBusPropertiesMixinIfaceImpl interfaces[] = {
+ { NULL /* initialized with tp_group_mixin_init_dbus_properties () */ },
+ { NULL }
+ };
g_type_class_add_private (gabble_muc_channel_class,
sizeof (GabbleMucChannelPrivate));
@@ -901,6 +908,11 @@ gabble_muc_channel_class_init (GabbleMucChannelClass *gabble_muc_channel_class)
tp_text_mixin_class_init (object_class,
G_STRUCT_OFFSET (GabbleMucChannelClass, text_class));
+
+ gabble_muc_channel_class->dbus_props_class.interfaces = interfaces;
+ tp_group_mixin_init_dbus_properties (interfaces + 0);
+ tp_dbus_properties_mixin_class_init (object_class,
+ G_STRUCT_OFFSET (GabbleMucChannelClass, dbus_props_class));
}
static void clear_join_timer (GabbleMucChannel *chan);
diff --git a/src/gabble-muc-channel.h b/src/gabble-muc-channel.h
index 73ec2f2..7ef05b6 100644
--- a/src/gabble-muc-channel.h
+++ b/src/gabble-muc-channel.h
@@ -24,6 +24,7 @@
#include <glib-object.h>
+#include <telepathy-glib/dbus-properties-mixin.h>
#include <telepathy-glib/group-mixin.h>
#include <telepathy-glib/properties-mixin.h>
@@ -48,6 +49,7 @@ struct _GabbleMucChannelClass {
TpGroupMixinClass group_class;
TpPropertiesMixinClass properties_class;
GabbleTextMixinClass text_class;
+ TpDBusPropertiesMixinClass dbus_props_class;
};
struct _GabbleMucChannel {
--
1.5.6.3
More information about the Telepathy-commits
mailing list