summaryrefslogtreecommitdiff
path: root/telepathy-logger/event.c
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.co.uk>2011-02-07 17:06:11 +0100
committerNicolas Dufresne <nicolas.dufresne@collabora.co.uk>2011-02-07 17:07:13 +0100
commit43968ccc7adffadb899700d0dd82bd0fba1167ad (patch)
tree1a999d06998e1d1916c5fa35c4a809ffbd66b6cb /telepathy-logger/event.c
parentf1e540486d8061d7c765528d5b016125b5919ffe (diff)
downloadtelepathy-logger-43968ccc7adffadb899700d0dd82bd0fba1167ad.tar.gz
Implement tpl_event_equal with log_id
Implement tpl_event_equal() using the log_id and make it public. The method is still overridable in case.
Diffstat (limited to 'telepathy-logger/event.c')
-rw-r--r--telepathy-logger/event.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/telepathy-logger/event.c b/telepathy-logger/event.c
index 48321f2..249fbe7 100644
--- a/telepathy-logger/event.c
+++ b/telepathy-logger/event.c
@@ -181,6 +181,16 @@ tpl_event_set_property (GObject *object,
};
}
+static gboolean
+tpl_event_equal_default (TplEvent *message1,
+ TplEvent *message2)
+{
+ g_return_val_if_fail (TPL_IS_EVENT (message1), FALSE);
+ g_return_val_if_fail (TPL_IS_EVENT (message2), FALSE);
+
+ return !tp_strdiff (message1->priv->log_id, message2->priv->log_id);
+}
+
static void
tpl_event_class_init (TplEventClass *klass)
@@ -194,7 +204,7 @@ tpl_event_class_init (TplEventClass *klass)
object_class->get_property = tpl_event_get_property;
object_class->set_property = tpl_event_set_property;
- klass->equal = NULL;
+ klass->equal = tpl_event_equal_default;
param_spec = g_param_spec_uint ("timestamp",
"Timestamp",
@@ -458,7 +468,7 @@ _tpl_event_set_channel_path (TplEvent *self,
}
/**
- * _tpl_event_equal:
+ * tpl_event_equal:
* @self: TplEvent subclass instance
* @data: an instance of the same TplEvent subclass of @self
*
@@ -468,7 +478,7 @@ _tpl_event_set_channel_path (TplEvent *self,
* data, %FALSE otherwise
*/
gboolean
-_tpl_event_equal (TplEvent *self,
+tpl_event_equal (TplEvent *self,
TplEvent *data)
{
g_return_val_if_fail (TPL_IS_EVENT (self), FALSE);