Gadu-Gadu: Show local time for incoming messages. Fixes #4579

Sat, 08 Oct 2011 21:23:26 +0000

author
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
date
Sat, 08 Oct 2011 21:23:26 +0000
changeset 32645
262c9ba5fe13
parent 32644
55962377a6a8
child 32646
d1e3538b0c5f

Gadu-Gadu: Show local time for incoming messages. Fixes #4579

ChangeLog file | annotate | diff | comparison | revisions
libpurple/protocols/gg/gg.c file | annotate | diff | comparison | revisions
--- 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);

mercurial