empathy r2598 - trunk/libempathy
- From: xclaesse svn gnome org
- To: svn-commits-list gnome org
- Subject: empathy r2598 - trunk/libempathy
- Date: Fri, 6 Mar 2009 11:52:24 +0000 (UTC)
Author: xclaesse
Date: Fri Mar 6 11:52:24 2009
New Revision: 2598
URL: http://svn.gnome.org/viewvc/empathy?rev=2598&view=rev
Log:
Added empathy_message_get_unique_id & empathy_message_equal.
Signed-off-by: Jonny Lamb <jonny lamb collabora co uk>
Modified:
trunk/libempathy/empathy-message.c
trunk/libempathy/empathy-message.h
Modified: trunk/libempathy/empathy-message.c
==============================================================================
--- trunk/libempathy/empathy-message.c (original)
+++ trunk/libempathy/empathy-message.c Fri Mar 6 11:52:24 2009
@@ -497,3 +497,24 @@
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;
+}
Modified: trunk/libempathy/empathy-message.h
==============================================================================
--- trunk/libempathy/empathy-message.h (original)
+++ trunk/libempathy/empathy-message.h Fri Mar 6 11:52:24 2009
@@ -75,6 +75,10 @@
guint empathy_message_get_id (EmpathyMessage *message);
void empathy_message_set_id (EmpathyMessage *message, guint id);
+gchar * empathy_message_get_unique_id (EmpathyMessage *message);
+
+gboolean empathy_message_equal (EmpathyMessage *message1, EmpathyMessage *message2);
+
G_END_DECLS
#endif /* __EMPATHY_MESSAGE_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]