2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-02 15:35:51 +00:00

pts handled for channels now

This commit is contained in:
John Preston
2015-09-13 11:41:27 +03:00
parent e41e68b8b3
commit ae6bc3852a
17 changed files with 570 additions and 184 deletions

View File

@@ -597,22 +597,8 @@ inline bool isImportantChannelMessage(int32 flags) {
}
HistoryItem *Histories::addToBack(const MTPmessage &msg, int msgState) {
PeerId from_id = 0, to_id = 0;
int32 flags = 0;
switch (msg.type()) {
case mtpc_message:
from_id = msg.c_message().has_from_id() ? peerFromUser(msg.c_message().vfrom_id) : 0;
to_id = peerFromMTP(msg.c_message().vto_id);
flags = msg.c_message().vflags.v;
break;
case mtpc_messageService:
from_id = msg.c_messageService().has_from_id() ? peerFromUser(msg.c_messageService().vfrom_id) : 0;
to_id = peerFromMTP(msg.c_messageService().vto_id);
flags = msg.c_messageService().vflags.v;
break;
}
PeerId peer = (from_id && peerToUser(to_id) == MTP::authedId()) ? from_id : to_id;
PeerId peer = peerFromMessage(msg, &flags);
if (!peer) return 0;
iterator h = find(peer);
@@ -1477,6 +1463,10 @@ void History::getReadyFor(MsgId msgId) {
}
}
void History::setNotLoadedAtBottom() {
newLoaded = false;
}
namespace {
uint32 _dialogsPosToTopShift = 0x80000000UL;
}