changeset 32734:b01a41253fb6

Gadu-Gadu: Show local time for incoming messages. Fixes #4579
author tomkiewicz@cpw.pidgin.im
date Sat, 08 Oct 2011 21:23:26 +0000
parents 485692373850
children 309b2362c7d8
files ChangeLog libpurple/protocols/gg/gg.c
diffstat 2 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Oct 08 19:18:58 2011 +0000
+++ b/ChangeLog	Sat Oct 08 21:23:26 2011 +0000
@@ -9,6 +9,7 @@
 	Gadu-Gadu:
 	* Possibility to require encryption. Also, using encryption when
 	  available is default option now. (Tomasz Wasilczyk)
+	* Show local time for incoming messages. (Tomasz Wasilczyk) (#4579)
 
 	MXit:
 	* Remove all reference to Hidden Number.
--- a/libpurple/protocols/gg/gg.c	Sat Oct 08 19:18:58 2011 +0000
+++ b/libpurple/protocols/gg/gg.c	Sat Oct 08 21:23:26 2011 +0000
@@ -1444,6 +1444,7 @@
 	gchar *from;
 	gchar *msg;
 	gchar *tmp;
+	time_t mtime;
 
 	if (ev->event.msg.message == NULL)
 	{
@@ -1572,8 +1573,13 @@
 			from, msg, ev->event.msg.msgclass,
 			ev->event.msg.recipients_count);
 
+	if (ev->event.msg.msgclass & GG_CLASS_QUEUED)
+		mtime = ev->event.msg.time;
+	else
+		mtime = time(NULL);
+
 	if (ev->event.msg.recipients_count == 0) {
-		serv_got_im(gc, from, msg, 0, ev->event.msg.time);
+		serv_got_im(gc, from, msg, 0, mtime);
 	} else {
 		const char *chat_name;
 		int chat_id;
@@ -1599,7 +1605,7 @@
 
 		buddy_name = ggp_buddy_get_name(gc, ev->event.msg.sender);
 		serv_got_chat_in(gc, chat_id, buddy_name,
-				 PURPLE_MESSAGE_RECV, msg, ev->event.msg.time);
+				 PURPLE_MESSAGE_RECV, msg, mtime);
 		g_free(buddy_name);
 	}
 	g_free(msg);