1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
BaseCollabSource.php
См. документацию.
1<?php
2
4
7use Bitrix\Im\V2\Recent\Initializer\StageType;
8
9abstract class BaseCollabSource extends BaseSource
10{
11 public function __construct(int $targetId, ?int $sourceId, Stage $stage)
12 {
13 parent::__construct($targetId, $sourceId, $stage);
14 if ($this->stage::getType() === StageType::Target)
15 {
16 $this->stage->setGapTime(Stage::MIN_GAP_TIME);
17 }
18 }
19
20 public function setIsFirstInit(bool $flag): static
21 {
22 if ($flag && $this->stage::getType() === StageType::Target)
23 {
24 // We set the time gap to 60 seconds here to account for the initial loading of the "recent".
25 // When a guest joins a collab, their join message might be sent to the collab chat
26 // before the "recent" is fully initialized. This increased gap ensures proper order.
27 $this->stage->setGapTime(Stage::GAP_TIME);
28 }
29
30 return parent::setIsFirstInit($flag);
31 }
32
33 protected function isResultAffectedByStage(): bool
34 {
35 return true;
36 }
37}
__construct(int $targetId, ?int $sourceId, Stage $stage)
Определения BaseCollabSource.php:11
const MIN_GAP_TIME
Определения Stage.php:8