skype4pidgin icon indicating copy to clipboard operation
skype4pidgin copied to clipboard

Offline messages are lost until you receive at least one message

Open himselfv opened this issue 7 years ago • 0 comments

Skypeweb queries offline messages like this:

void
skype_web_get_offline_history(SkypeWebAccount *sa)
{
	skypeweb_get_all_conversations_since(sa, purple_account_get_int(sa->account, "last_message_timestamp", ((gint) time(NULL))));
}

If there's no last_message_timestamp then no offline history will be loaded because it is queried against the current time.

last_message_timestamp is set only when receiving a message. Therefore until you receive at least one message online, it won't be set => no offline history will be queried => no offline messages will be parsed => it still won't be set.

There's a couple of improvements which I'd like to suggest:

  1. Store last_message_timestamp = now() after querying offline history which returns no messages (or after any history query, whatever). Or maybe last_message_timestamp = now() - some_interval(), if there's a window in the past where the messages may yet appear (I'm not sure how it is with Skype). Anyway, store something in last_message_timestamp so that next time we actually request some history.

  2. By default, query some last few days of history instead of just "present time" (maybe make this configurable). Maybe something like time(NULL) - 86400?

    Otherwise there's this weird situation where you log out of Skype for PC, log in to skype4pidging for the first time, and inbetween someone sends you a message. This message is obviously new; no client has seen it. Yet it won't be shown.

    It would be even better if there was some flag in Skype protocol which said "these messages are really new, not just new to you, but never even delivered", in which case

  3. It would be nice to query any undelivered message in addition to purely "offline history". So that if you login for the first time, you query and get all messages for the past day AND any undelivered messages from even before that. (I'm not sure if this is possible. web.skype.com seems to have an idea of what messages have been seen before though, even if the cookies are cleared)

himselfv avatar Jan 23 '18 10:01 himselfv