Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong timestamp for online notification #41

Open
asemarafa opened this issue May 9, 2021 · 1 comment
Open

Wrong timestamp for online notification #41

asemarafa opened this issue May 9, 2021 · 1 comment

Comments

@asemarafa
Copy link

asemarafa commented May 9, 2021

The issue is reported in the main repo
vysheng#614

The notification for "user is online" has a timestamp that is ahead by 5 minutes

I created a lazy patch to fix it for my build since i didnt have the time to dig deeper why the S->when is populated incorrectly when S->online is true

--- interface.c.orig    2021-05-09 14:06:17.928110162 +0200
+++ interface.c 2021-05-09 13:53:56.123997492 +0200
@@ -2740,7 +2740,7 @@
   assert(!enable_json); //calling functions print_user_info_gw() and user_status_upd() already check.
   if (S->online > 0) {
     mprintf (ev, "online (was online ");
-    print_date_full (ev, S->when);
+    print_date_full (ev, S->when - 300);
     mprintf (ev, ")");
   } else {
     if (S->online == 0) {
@ic-scm
Copy link

ic-scm commented May 9, 2021

The online timestamp that is 5 minutes ahead is a normal thing sent by the Telegram server, as far as I know Telegram's online statuses simply work by setting the last seen time ahead of the current time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants