Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/EionRobb/pidgin-opensteamworks.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEion Robb <eion@robbmob.com>2015-08-27 09:45:48 +0300
committerEion Robb <eion@robbmob.com>2015-08-27 09:45:48 +0300
commitf9fd05fc608196eb4744b490b22be764b8b90799 (patch)
tree3afa3dc06c67a387f9860bf94e8e3e9d29a0dc93
parent8fbede83cf41817554f304ffff4634d7b6cd4799 (diff)
Fix silly mistake causing new messages not to be displayed
-rw-r--r--steam-mobile/libsteam.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/steam-mobile/libsteam.c b/steam-mobile/libsteam.c
index f2a4fa8..90764dd 100644
--- a/steam-mobile/libsteam.c
+++ b/steam-mobile/libsteam.c
@@ -556,7 +556,8 @@ steam_poll_cb(SteamAccount *sa, JsonObject *obj, gpointer user_data)
sa->message = MAX(sa->message, secure_message_id);
} else {
guint new_timestamp = (guint) json_object_get_int_member(message, "timestamp");
- if (new_timestamp > sa->last_message_timestamp)
+ time_t real_timestamp = local_timestamp - ((server_timestamp - new_timestamp) / 1000);
+ if (real_timestamp > sa->last_message_timestamp)
{
gchar *text, *html;
const gchar *from;
@@ -574,14 +575,14 @@ steam_poll_cb(SteamAccount *sa, JsonObject *obj, gpointer user_data)
{
conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, sa->account, from);
}
- purple_conversation_write(conv, from, html, PURPLE_MESSAGE_SEND, local_timestamp - ((server_timestamp - new_timestamp) / 1000));
+ purple_conversation_write(conv, from, html, PURPLE_MESSAGE_SEND, real_timestamp);
} else {
- serv_got_im(sa->pc, from, html, PURPLE_MESSAGE_RECV, local_timestamp - ((server_timestamp - new_timestamp) / 1000));
+ serv_got_im(sa->pc, from, html, PURPLE_MESSAGE_RECV, real_timestamp);
}
g_free(html);
g_free(text);
- sa->last_message_timestamp = new_timestamp;
+ sa->last_message_timestamp = real_timestamp;
}
}
} else if (g_str_equal(type, "personastate"))
@@ -891,7 +892,8 @@ steam_get_offline_history_cb(SteamAccount *sa, JsonObject *obj, gpointer user_da
serv_got_im(sa->pc, who, text, PURPLE_MESSAGE_RECV, timestamp);
}
- sa->last_message_timestamp = timestamp;
+ if (timestamp > sa->last_message_timestamp)
+ sa->last_message_timestamp = timestamp;
}
g_free(who);