2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-02 15:45:12 +00:00

messages and comments almost done in channels, sending broadcast toggle done, short poll + updates handle

This commit is contained in:
John Preston
2015-09-20 11:55:41 +03:00
parent 56a63a5b10
commit ac971dafe7
26 changed files with 616 additions and 402 deletions

View File

@@ -382,11 +382,27 @@ uint64 PtsWaiter::ptsKey(PtsSkippedQueue queue) {
return _queue.insert(uint64(uint32(_last)) << 32 | uint64(uint32(_count)), queue).key();
}
void PtsWaiter::applySkippedUpdates(ChannelData *channel) {
if (!App::main()) return;
App::main()->ptsWaiterStartTimerFor(channel, -1);
void PtsWaiter::setWaitingForSkipped(ChannelData *channel, bool waiting) {
_waitingForSkipped = waiting;
checkForWaiting(channel);
}
void PtsWaiter::setWaitingForShortPoll(ChannelData *channel, bool waiting) {
_waitingForShortPoll = waiting;
checkForWaiting(channel);
}
void PtsWaiter::checkForWaiting(ChannelData *channel) {
if (!_waitingForSkipped && !_waitingForShortPoll && App::main()) {
App::main()->ptsWaiterStartTimerFor(channel, -1);
}
}
void PtsWaiter::applySkippedUpdates(ChannelData *channel) {
setWaitingForSkipped(channel, false);
if (!App::main() || _queue.isEmpty()) return;
if (_queue.isEmpty()) return;
++_applySkippedLevel;
for (QMap<uint64, PtsSkippedQueue>::const_iterator i = _queue.cbegin(), e = _queue.cend(); i != e; ++i) {
switch (i.value()) {