mirror of
https://github.com/danog/MadelineProto.git
synced 2024-11-27 10:34:38 +01:00
Merge branch 'master' of https://github.com/danog/Madelineproto
This commit is contained in:
commit
13edc2e289
@ -68,7 +68,7 @@ class TLConstructor extends \Volatile
|
|||||||
if (isset($this->by_predicate_and_layer[$predicate.$alayer])) {
|
if (isset($this->by_predicate_and_layer[$predicate.$alayer])) {
|
||||||
$chosenid = $this->by_predicate_and_layer[$predicate.$alayer];
|
$chosenid = $this->by_predicate_and_layer[$predicate.$alayer];
|
||||||
}
|
}
|
||||||
} else if (!isset($chosenid)) {
|
} elseif (!isset($chosenid)) {
|
||||||
$chosenid = $this->by_predicate_and_layer[$predicate.$alayer];
|
$chosenid = $this->by_predicate_and_layer[$predicate.$alayer];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,9 +22,15 @@ trait DialogHandler
|
|||||||
$this->updates_state['sync_loading'] = true;
|
$this->updates_state['sync_loading'] = true;
|
||||||
$res = ['dialogs' => [0], 'count' => 1];
|
$res = ['dialogs' => [0], 'count' => 1];
|
||||||
$datacenter = $this->datacenter->curdc;
|
$datacenter = $this->datacenter->curdc;
|
||||||
|
$peers = [];
|
||||||
while ($this->dialog_params['count'] < $res['count']) {
|
while ($this->dialog_params['count'] < $res['count']) {
|
||||||
\danog\MadelineProto\Logger::log(['Getting dialogs...']);
|
\danog\MadelineProto\Logger::log(['Getting dialogs...']);
|
||||||
$res = $this->method_call('messages.getDialogs', $this->dialog_params, ['datacenter' => $datacenter, 'FloodWaitLimit' => 100]);
|
$res = $this->method_call('messages.getDialogs', $this->dialog_params, ['datacenter' => $datacenter, 'FloodWaitLimit' => 100]);
|
||||||
|
foreach ($res['dialogs'] as $dialog) {
|
||||||
|
if (!in_array($dialog['peer'], $peers)) {
|
||||||
|
$peers[] = $dialog['peer'];
|
||||||
|
}
|
||||||
|
}
|
||||||
$this->dialog_params['count'] += count($res['dialogs']);
|
$this->dialog_params['count'] += count($res['dialogs']);
|
||||||
$this->dialog_params['offset_date'] = end($res['messages'])['date'];
|
$this->dialog_params['offset_date'] = end($res['messages'])['date'];
|
||||||
$this->dialog_params['offset_peer'] = end($res['dialogs'])['peer'];
|
$this->dialog_params['offset_peer'] = end($res['dialogs'])['peer'];
|
||||||
@ -35,5 +41,7 @@ trait DialogHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->updates_state['sync_loading'] = false;
|
$this->updates_state['sync_loading'] = false;
|
||||||
|
|
||||||
|
return $peers;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user