mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +00:00
chore: refactor adapter
This commit is contained in:
parent
55e7633bd1
commit
0ddcb9b14c
1 changed files with 15 additions and 27 deletions
|
|
@ -82,33 +82,21 @@ class Realtime extends Event
|
||||||
bucket: $bucket,
|
bucket: $bucket,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!empty($this->getTargets())) {
|
$projectIds = !empty($this->getTargets())
|
||||||
foreach ($this->getTargets() as $targetProjectId) {
|
? $this->getTargets()
|
||||||
RealtimeAdapter::send(
|
: [$target['projectId'] ?? $this->getProject()->getId()];
|
||||||
projectId: $targetProjectId,
|
|
||||||
payload: $this->getRealtimePayload(),
|
RealtimeAdapter::send(
|
||||||
events: $allEvents,
|
projectId: $projectIds,
|
||||||
channels: $target['channels'],
|
payload: $this->getRealtimePayload(),
|
||||||
roles: $target['roles'],
|
events: $allEvents,
|
||||||
options: [
|
channels: $target['channels'],
|
||||||
'permissionsChanged' => $target['permissionsChanged'],
|
roles: $target['roles'],
|
||||||
'userId' => $this->getParam('userId')
|
options: [
|
||||||
]
|
'permissionsChanged' => $target['permissionsChanged'],
|
||||||
);
|
'userId' => $this->getParam('userId')
|
||||||
}
|
]
|
||||||
} else {
|
);
|
||||||
RealtimeAdapter::send(
|
|
||||||
projectId: $target['projectId'] ?? $this->getProject()->getId(),
|
|
||||||
payload: $this->getRealtimePayload(),
|
|
||||||
events: $allEvents,
|
|
||||||
channels: $target['channels'],
|
|
||||||
roles: $target['roles'],
|
|
||||||
options: [
|
|
||||||
'permissionsChanged' => $target['permissionsChanged'],
|
|
||||||
'userId' => $this->getParam('userId')
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue