Minor fixes
This commit is contained in:
parent
d42f677884
commit
81302f05fd
@ -136,7 +136,7 @@ class FeedLoop extends ResumableSignalLoop
|
|||||||
$this->updater->setLimit($this->state->pts() + $result);
|
$this->updater->setLimit($this->state->pts() + $result);
|
||||||
yield $this->updater->resume();
|
yield $this->updater->resume();
|
||||||
$updates = array_merge($this->incomingUpdates, $updates);
|
$updates = array_merge($this->incomingUpdates, $updates);
|
||||||
$this->incomingUpdates = null;
|
$this->incomingUpdates = [];
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (isset($update['message']['id'], $update['message']['to_id']) && !in_array($update['_'], ['updateEditMessage', 'updateEditChannelMessage'])) {
|
if (isset($update['message']['id'], $update['message']['to_id']) && !in_array($update['_'], ['updateEditMessage', 'updateEditChannelMessage'])) {
|
||||||
|
@ -140,11 +140,11 @@ class SeqLoop extends ResumableSignalLoop
|
|||||||
}
|
}
|
||||||
public function save($updates)
|
public function save($updates)
|
||||||
{
|
{
|
||||||
$this->pendingWakeups = array_merge($this->pendingWakeups, yield $this->feeder->feed($updates['updates']));
|
$this->pendingWakeups += yield $this->feeder->feed($updates['updates']);
|
||||||
}
|
}
|
||||||
public function addPendingWakeups($wakeups)
|
public function addPendingWakeups($wakeups)
|
||||||
{
|
{
|
||||||
$this->pendingWakeups = array_merge($wakeups, $this->pendingWakeups);
|
$this->pendingWakeups += $wakeups;
|
||||||
}
|
}
|
||||||
public function has_all_auth()
|
public function has_all_auth()
|
||||||
{
|
{
|
||||||
|
@ -98,7 +98,7 @@ class UpdateLoop extends ResumableSignalLoop
|
|||||||
$difference['pts'] = $state->pts() + 1;
|
$difference['pts'] = $state->pts() + 1;
|
||||||
}
|
}
|
||||||
$state->update($difference);
|
$state->update($difference);
|
||||||
$result = array_merge($result, yield $feeder->feed($difference['other_updates']));
|
$result += yield $feeder->feed($difference['other_updates']);
|
||||||
|
|
||||||
$feeder->saveMessages($difference['new_messages']);
|
$feeder->saveMessages($difference['new_messages']);
|
||||||
if (!$difference['final']) {
|
if (!$difference['final']) {
|
||||||
@ -134,8 +134,8 @@ class UpdateLoop extends ResumableSignalLoop
|
|||||||
foreach ($difference['new_encrypted_messages'] as &$encrypted) {
|
foreach ($difference['new_encrypted_messages'] as &$encrypted) {
|
||||||
$encrypted = ['_' => 'updateNewEncryptedMessage', 'message' => $encrypted];
|
$encrypted = ['_' => 'updateNewEncryptedMessage', 'message' => $encrypted];
|
||||||
}
|
}
|
||||||
$result = array_merge($result, yield $feeder->feed($difference['other_updates']));
|
$result += yield $feeder->feed($difference['other_updates']);
|
||||||
$result = array_merge($result, yield $feeder->feed($difference['new_encrypted_messages']));
|
$result += yield $feeder->feed($difference['new_encrypted_messages']);
|
||||||
$feeder->saveMessages($difference['new_messages']);
|
$feeder->saveMessages($difference['new_messages']);
|
||||||
$state->update($difference['state']);
|
$state->update($difference['state']);
|
||||||
unset($difference);
|
unset($difference);
|
||||||
@ -144,8 +144,8 @@ class UpdateLoop extends ResumableSignalLoop
|
|||||||
foreach ($difference['new_encrypted_messages'] as &$encrypted) {
|
foreach ($difference['new_encrypted_messages'] as &$encrypted) {
|
||||||
$encrypted = ['_' => 'updateNewEncryptedMessage', 'message' => $encrypted];
|
$encrypted = ['_' => 'updateNewEncryptedMessage', 'message' => $encrypted];
|
||||||
}
|
}
|
||||||
$result = array_merge($result, yield $feeder->feed($difference['other_updates']));
|
$result += yield $feeder->feed($difference['other_updates']);
|
||||||
$result = array_merge($result, yield $feeder->feed($difference['new_encrypted_messages']));
|
$result += yield $feeder->feed($difference['new_encrypted_messages']);
|
||||||
$feeder->saveMessages($difference['new_messages']);
|
$feeder->saveMessages($difference['new_messages']);
|
||||||
$state->update($difference['intermediate_state']);
|
$state->update($difference['intermediate_state']);
|
||||||
if ($difference['intermediate_state']['pts'] >= $toPts) {
|
if ($difference['intermediate_state']['pts'] >= $toPts) {
|
||||||
|
@ -580,7 +580,7 @@ trait ResponseHandler
|
|||||||
$update['_'] === 'updateEditMessage' || $update['_'] === 'updateDeleteMessages' ||
|
$update['_'] === 'updateEditMessage' || $update['_'] === 'updateDeleteMessages' ||
|
||||||
$update['_'] === 'updateReadHistoryInbox' || $update['_'] === 'updateReadHistoryOutbox' ||
|
$update['_'] === 'updateReadHistoryInbox' || $update['_'] === 'updateReadHistoryOutbox' ||
|
||||||
$update['_'] === 'updateWebPage' || $update['_'] === 'updateMessageID') {
|
$update['_'] === 'updateWebPage' || $update['_'] === 'updateMessageID') {
|
||||||
$result[yield $this->feeder[false]->feedSingle($update)] = true;
|
$result[yield $this->feeders[false]->feedSingle($update)] = true;
|
||||||
unset($updates['updates'][$key]);
|
unset($updates['updates'][$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -596,7 +596,7 @@ trait ResponseHandler
|
|||||||
$this->seqUpdater->resume();
|
$this->seqUpdater->resume();
|
||||||
break;
|
break;
|
||||||
case 'updateShort':
|
case 'updateShort':
|
||||||
$this->feeders[yield $this->feeder[false]->feedSingle($update)]->resume();
|
$this->feeders[yield $this->feeders[false]->feedSingle($updates['update'])]->resume();
|
||||||
break;
|
break;
|
||||||
case 'updateShortMessage':
|
case 'updateShortMessage':
|
||||||
case 'updateShortChatMessage':
|
case 'updateShortChatMessage':
|
||||||
|
Loading…
Reference in New Issue
Block a user