--- a/libpurple/server.c Thu Jan 16 13:02:42 2014 +0100 +++ b/libpurple/server.c Sat Jan 18 09:01:20 2014 -0800 @@ -567,6 +567,14 @@ account = purple_connection_get_account(gc); + if (mtime < 0) { + purple_debug_error("server", + "serv_got_im 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); + } + /* * XXX: Should we be setting this here, or relying on prpls to set it? */ @@ -905,6 +913,14 @@ g_return_if_fail(who != NULL); g_return_if_fail(message != NULL); + if (mtime < 0) { + purple_debug_error("server", + "serv_got_chat_in 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); + } + for (bcs = g->buddy_chats; bcs != NULL; bcs = bcs->next) { conv = (PurpleConversation *)bcs->data;