mirror of
https://github.com/openvk/openvk
synced 2024-12-23 09:01:15 +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
|
@ -96,6 +96,13 @@ final class MessengerPresenter extends OpenVKPresenter
|
||||||
|
|
||||||
$legacy = $this->queryParam("version") < 3;
|
$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) {
|
$this->signaler->listen(function($event, $eId) use ($id) {
|
||||||
exit(json_encode([
|
exit(json_encode([
|
||||||
"ts" => time(),
|
"ts" => time(),
|
||||||
|
@ -103,7 +110,7 @@ final class MessengerPresenter extends OpenVKPresenter
|
||||||
$event->getVKAPISummary($id),
|
$event->getVKAPISummary($id),
|
||||||
],
|
],
|
||||||
]));
|
]));
|
||||||
}, $id);
|
}, $id, $time);
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderApiGetMessages(int $sel, int $lastMsg): void
|
function renderApiGetMessages(int $sel, int $lastMsg): void
|
||||||
|
|
Loading…
Reference in a new issue