TelepathyIM / telepathy-morse

Telegram connection manager for the Telepathy framework
GNU General Public License v2.0
61 stars 10 forks source link

[Feature request] Shown not online contacts as "away" instead of "offline" #18

Open ItachiSan opened 8 years ago

ItachiSan commented 8 years ago

As in title. I add the telepathy-morse account but clients are shown as offline in Empathy. I think it is better to mark the contacts as "away". Tell me what log I should provide and I will.

ItachiSan commented 8 years ago

Renamed the issue, as it is not a bug of the software, but more a change request.

Kaffeine commented 8 years ago

I don't think that this makes big sense in terms of message delivery:

1) If the contact is offline, then you don't expect a message to be received, but if it is "away", then you expect the message to be delivered, but not read yet. 2) I work on telepathy and use telegram only on desktop. So if I'm offline, then I'm effectively offline. 3) I would think on it once again, when we would be able to get contact device info. In this case I can imagine this as

UserInfo *info;
bool wasOnlineRecently = false;
if (info->wasOnline() == TelegramNamespace::ContactLastOnlineRecently) {
    wasOnlineRecently = true;
} else if (info->wasOnline() > ContactLastOnlineMask) {
    const quint64 ms = quint64(info->wasOnline()) * 1000;
    const QDateTime wasOnline = QDateTime::fromMSecsSinceEpoch(ms);
    const QDateTime currentDateTime = QDateTime::currentDateTime();
    if (wasOnline.secsTo(currentDateTime) < 2 * 60 * 60) {
        wasOnlineRecently = true;
    }
}

if (info->device() == "mobile" && wasOnlineRecently) {
    setContactStatus(info->id, Away);
} else {
    setContactStatus(info->id, Offline);
}

This way we would mark contact as "away" if it was online from a mobile device sometime recently or less, than two hours ago and we would still mark it "offline" otherwise.

It's not a question of coding, because it's a trivial thing to do, but I don't agree with the idea. I would accept it (with wasOnline check) as an account option, turned off by default. I would consider in implementing it myself, if there would be more votes, but I have more important things to do now.

TemeV commented 7 years ago

I have to say I agree with ItahiSan, because Telegram has a horrible definition for online and offline. For both mobile and desktop clients the user is shown "online" only when the window is active.

Also Telegram messages are not lost when the user is not around, unlike with IRC or XMPP. Thus marking the user "away" might be the correct way, because the user will get the message even if he is not "online". Something like "active" and "inactive" might be more descriptive, but I guess that's not really an option.

luizluca commented 5 years ago

Just like the "auto away" feature clients have, we could have an auto-state for telegram based on "last seen" . Something hard-coded or configurable like:

Offline only really happen when the user delete the account.

Kaffeine commented 5 years ago

A lot of contacts do not share their exact online time and the best detailing we usually have is "online", "recently online", "last seen within a week", "last seen within a month" and "offline".

"recently online" is a range from a few second to a few days.

I think that the problem is not the contact status, but the fact that most contact-lists show online contacts first. I hope to implement Dialogs and Room lists besides to the current Contact List API, so we'll have dialogs sorted by last message instead of contacts sorted by online. I don't have any dates yet; I have to finish some work on Telegram backend first and then we have to improve group chat support first (we have to bring it to the same level as contacts to make it possible to use both group chat and contact items in dialogs).