aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2007-12-21 00:39:49 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2007-12-21 00:39:49 +0800
commit63e82d2437ba18c31876defafb691422862fc91b (patch)
treebccd4385c38e6d7b2345a944b2d797cf0eaaeddf /libempathy
parent94d5a22a766d6ad184a1ea9ae6468a875e847312 (diff)
downloadgsoc2013-empathy-63e82d2437ba18c31876defafb691422862fc91b.tar
gsoc2013-empathy-63e82d2437ba18c31876defafb691422862fc91b.tar.gz
gsoc2013-empathy-63e82d2437ba18c31876defafb691422862fc91b.tar.bz2
gsoc2013-empathy-63e82d2437ba18c31876defafb691422862fc91b.tar.lz
gsoc2013-empathy-63e82d2437ba18c31876defafb691422862fc91b.tar.xz
gsoc2013-empathy-63e82d2437ba18c31876defafb691422862fc91b.tar.zst
gsoc2013-empathy-63e82d2437ba18c31876defafb691422862fc91b.zip
New chat theme engine imported from Gossip (Daniel Gryniewicz, Xavier Claessens).
svn path=/trunk/; revision=494
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-marshal.list1
-rw-r--r--libempathy/empathy-message.c20
-rw-r--r--libempathy/empathy-message.h2
3 files changed, 23 insertions, 0 deletions
diff --git a/libempathy/empathy-marshal.list b/libempathy/empathy-marshal.list
index 383bfbbed..1a79b058a 100644
--- a/libempathy/empathy-marshal.list
+++ b/libempathy/empathy-marshal.list
@@ -1,3 +1,4 @@
+VOID:VOID
VOID:OBJECT,UINT
VOID:OBJECT,BOOLEAN
VOID:OBJECT,POINTER
diff --git a/libempathy/empathy-message.c b/libempathy/empathy-message.c
index 5c2028bd0..2d3fd69e4 100644
--- a/libempathy/empathy-message.c
+++ b/libempathy/empathy-message.c
@@ -417,6 +417,26 @@ empathy_message_set_timestamp (EmpathyMessage *message,
g_object_notify (G_OBJECT (message), "timestamp");
}
+GDate *
+empathy_message_get_date_and_time (EmpathyMessage *message, time_t *timestamp)
+{
+ GDate *date;
+
+ *timestamp = 0;
+ if (message) {
+ *timestamp = empathy_message_get_timestamp (message);
+ }
+
+ if (timestamp <= 0) {
+ *timestamp = empathy_time_get_current ();
+ }
+
+ date = g_date_new ();
+ g_date_set_time (date, *timestamp);
+
+ return date;
+}
+
EmpathyMessageType
empathy_message_type_from_str (const gchar *type_str)
{
diff --git a/libempathy/empathy-message.h b/libempathy/empathy-message.h
index af19d364c..668b33311 100644
--- a/libempathy/empathy-message.h
+++ b/libempathy/empathy-message.h
@@ -75,6 +75,8 @@ void empathy_message_set_body (EmpathyMessage *message,
time_t empathy_message_get_timestamp (EmpathyMessage *message);
void empathy_message_set_timestamp (EmpathyMessage *message,
time_t timestamp);
+GDate * empathy_message_get_date_and_time (EmpathyMessage *message,
+ time_t *timestamp);
EmpathyMessageType empathy_message_type_from_str (const gchar *type_str);
const gchar * empathy_message_type_to_str (EmpathyMessageType type);