2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

improved libappindicator load, making user online for some time after incoming msg

This commit is contained in:
John Preston
2015-01-23 12:48:21 +03:00
parent 12f6b340e5
commit b688a2e518
4 changed files with 60 additions and 87 deletions

View File

@@ -1182,26 +1182,6 @@ HistoryItem *Histories::addToBack(const MTPmessage &msg, int msgState) {
return h.value()->addToBack(msg, msgState > 0);
}
/*
HistoryItem *Histories::addToBack(const MTPgeoChatMessage &msg, bool newMsg) {
PeerId peer = 0;
switch (msg.type()) {
case mtpc_geoChatMessage:
peer = App::peerFromChat(msg.c_geoChatMessage().vchat_id);
break;
case mtpc_geoChatMessageService:
peer = App::peerFromChat(msg.c_geoChatMessageService().vchat_id);
break;
}
if (!peer) return 0;
iterator h = find(peer);
if (h == end()) {
h = insert(peer, new History(peer));
}
return h.value()->addToBack(msg, newMsg);
}/**/
HistoryItem *History::createItem(HistoryBlock *block, const MTPmessage &msg, bool newMsg, bool returnExisting) {
HistoryItem *result = 0;
@@ -1423,6 +1403,9 @@ void History::newItemAdded(HistoryItem *item) {
App::checkImageCacheSize();
if (item->from()) {
unregTyping(item->from());
if (item->from()->onlineTill < 0) {
item->from()->onlineTill = -unixtime() - HiddenIsOnlineAfterMessage;
}
}
if (item->out()) {
if (unreadBar) unreadBar->destroy();