libpurple/conversationtypes.c

changeset 35265
77664079d0f0
parent 35176
b0659f31989d
child 35460
96946e21fce5
child 37016
48f85579cc4c
--- a/libpurple/conversationtypes.c	Mon Jan 20 07:39:26 2014 +0530
+++ b/libpurple/conversationtypes.c	Mon Jan 20 00:02:17 2014 -0800
@@ -809,6 +809,14 @@
 	if (purple_chat_conversation_is_ignored_user(PURPLE_CHAT_CONVERSATION(conv), who))
 		return;
 
+	if (mtime < 0) {
+		purple_debug_error("conversation",
+				"purple_conv_chat_write ignoring negative timestamp\n");
+		/* TODO: Would be more appropriate to use a value that indicates
+		   that the timestamp is unknown, and surface that in the UI. */
+		mtime = time(NULL);
+	}
+
 	if (!(flags & PURPLE_MESSAGE_WHISPER)) {
 		const char *str;
 

mercurial