[empathy] empathy-message: add message flags



commit 8d1543fd36e67823e390477548dfa43f86afa2e2
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Tue Dec 1 17:03:51 2009 +0000

    empathy-message: add message flags

 libempathy/empathy-message.c |   35 +++++++++++++++++++++++++++++++++++
 libempathy/empathy-message.h |    4 ++++
 2 files changed, 39 insertions(+), 0 deletions(-)
---
diff --git a/libempathy/empathy-message.c b/libempathy/empathy-message.c
index 705bd22..bab2865 100644
--- a/libempathy/empathy-message.c
+++ b/libempathy/empathy-message.c
@@ -42,6 +42,7 @@ typedef struct {
 	gboolean                  is_backlog;
 	guint                     id;
 	gboolean                  incoming;
+	TpChannelTextMessageFlags flags;
 } EmpathyMessagePriv;
 
 static void empathy_message_finalize   (GObject            *object);
@@ -65,6 +66,7 @@ enum {
 	PROP_TIMESTAMP,
 	PROP_IS_BACKLOG,
 	PROP_INCOMING,
+	PROP_FLAGS,
 };
 
 static void
@@ -133,6 +135,14 @@ empathy_message_class_init (EmpathyMessageClass *class)
 							       FALSE,
 							       G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
+	g_object_class_install_property (object_class,
+					 PROP_FLAGS,
+					 g_param_spec_uint ("flags",
+							       "Flags",
+							       "The TpChannelTextMessageFlags of this message",
+							       0, G_MAXUINT, 0,
+							       G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
 	g_type_class_add_private (object_class, sizeof (EmpathyMessagePriv));
 
 }
@@ -581,3 +591,28 @@ empathy_message_equal (EmpathyMessage *message1, EmpathyMessage *message2)
 
 	return FALSE;
 }
+
+TpChannelTextMessageFlags
+empathy_message_get_flags (EmpathyMessage *self)
+{
+	EmpathyMessagePriv *priv = GET_PRIV (self);
+
+	g_return_val_if_fail (EMPATHY_IS_MESSAGE (self), 0);
+
+	return priv->flags;
+}
+
+void
+empathy_message_set_flags        (EmpathyMessage           *self,
+				TpChannelTextMessageFlags flags)
+{
+	EmpathyMessagePriv *priv;
+
+	g_return_if_fail (EMPATHY_IS_MESSAGE (self));
+
+	priv = GET_PRIV (self);
+
+	priv->flags = flags;
+
+	g_object_notify (G_OBJECT (self), "flags");
+}
diff --git a/libempathy/empathy-message.h b/libempathy/empathy-message.h
index 09175e6..5128693 100644
--- a/libempathy/empathy-message.h
+++ b/libempathy/empathy-message.h
@@ -84,6 +84,10 @@ void                     empathy_message_set_id (EmpathyMessage *message, guint
 
 gboolean                 empathy_message_equal (EmpathyMessage *message1, EmpathyMessage *message2);
 
+TpChannelTextMessageFlags empathy_message_get_flags        (EmpathyMessage           *message);
+void                      empathy_message_set_flags        (EmpathyMessage           *message,
+							    TpChannelTextMessageFlags flags);
+
 G_END_DECLS
 
 #endif /* __EMPATHY_MESSAGE_H__ */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]