mirror of
https://github.com/openvk/openvk
synced 2024-12-22 16:42:32 +03:00
Longpoll: Add wait parameter as in original VK
This commit is contained in:
parent
697a365205
commit
b38f4f2346
1 changed files with 8 additions and 1 deletions
|
@ -95,6 +95,13 @@ final class MessengerPresenter extends OpenVKPresenter
|
|||
}
|
||||
|
||||
$legacy = $this->queryParam("version") < 3;
|
||||
|
||||
$time = intval($this->queryParam("wait"));
|
||||
|
||||
if($time > 60)
|
||||
$time = 60;
|
||||
elseif($time == 0)
|
||||
$time = 25; // default
|
||||
|
||||
$this->signaler->listen(function($event, $eId) use ($id) {
|
||||
exit(json_encode([
|
||||
|
@ -103,7 +110,7 @@ final class MessengerPresenter extends OpenVKPresenter
|
|||
$event->getVKAPISummary($id),
|
||||
],
|
||||
]));
|
||||
}, $id);
|
||||
}, $id, $time);
|
||||
}
|
||||
|
||||
function renderApiGetMessages(int $sel, int $lastMsg): void
|
||||
|
|
Loading…
Reference in a new issue