aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-message.c
diff options
context:
space:
mode:
Diffstat (limited to 'libempathy/empathy-message.c')
-rw-r--r--libempathy/empathy-message.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/libempathy/empathy-message.c b/libempathy/empathy-message.c
index 2090ae7c2..42e4a45a6 100644
--- a/libempathy/empathy-message.c
+++ b/libempathy/empathy-message.c
@@ -497,3 +497,24 @@ empathy_message_set_id (EmpathyMessage *message, guint id)
priv->id = id;
}
+
+gchar *
+empathy_message_get_unique_id (EmpathyMessage *message)
+{
+ EmpathyMessagePriv *priv = GET_PRIV (message);
+
+ return g_strdup_printf ("%d.%d", priv->id, g_str_hash (priv->body));
+}
+
+gboolean
+empathy_message_equal (EmpathyMessage *message1, EmpathyMessage *message2)
+{
+ EmpathyMessagePriv *priv1 = GET_PRIV (message1);
+ EmpathyMessagePriv *priv2 = GET_PRIV (message2);
+
+ if (priv1->id == priv2->id && g_str_hash (priv1->body) == g_str_hash (priv2->body)) {
+ return TRUE;
+ }
+
+ return FALSE;
+}