-
Notifications
You must be signed in to change notification settings - Fork 448
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(federation): Start using metaData for notifications
Signed-off-by: Joas Schilling <[email protected]>
- Loading branch information
1 parent
43f0b4c
commit e38d282
Showing
6 changed files
with
61 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
declare(strict_types=1); | ||
|
||
/** | ||
* @copyright Copyright (c) 2022 Joas Schilling <[email protected]> | ||
* @copyright Copyright (c) 2024 Joas Schilling <[email protected]> | ||
* | ||
* @author Joas Schilling <[email protected]> | ||
* | ||
|
@@ -54,10 +54,17 @@ | |
* @method string|null getMessage() | ||
* @method void setMessageParameters(?string $messageParameters) | ||
* @method string|null getMessageParameters() | ||
* @method void setCreationDatetime(?\DateTimeImmutable $creationDatetime) | ||
* @method \DateTimeImmutable|null getCreationDatetime() | ||
* @method void setMetaData(?string $metaData) | ||
* @method string|null getMetaData() | ||
* | ||
* @psalm-import-type TalkRoomProxyMessage from ResponseDefinitions | ||
*/ | ||
class ProxyCacheMessages extends Entity implements \JsonSerializable { | ||
class ProxyCacheMessage extends Entity implements \JsonSerializable { | ||
public const METADATA_REPLYTO_TYPE = 'replyToActorType'; | ||
public const METADATA_REPLYTO_ID = 'replyToActorId'; | ||
|
||
|
||
protected string $localToken = ''; | ||
protected string $remoteServerUrl = ''; | ||
|
@@ -71,6 +78,8 @@ class ProxyCacheMessages extends Entity implements \JsonSerializable { | |
protected ?\DateTimeImmutable $expirationDatetime = null; | ||
protected ?string $message = null; | ||
protected ?string $messageParameters = null; | ||
protected ?\DateTimeImmutable $creationDatetime = null; | ||
protected ?string $metaData = null; | ||
|
||
public function __construct() { | ||
$this->addType('localToken', 'string'); | ||
|
@@ -85,16 +94,18 @@ public function __construct() { | |
$this->addType('expirationDatetime', 'datetime'); | ||
$this->addType('message', 'string'); | ||
$this->addType('messageParameters', 'string'); | ||
// Reply author | ||
// Silent | ||
// Creation date | ||
// Verb?! | ||
$this->addType('creationDatetime', 'datetime'); | ||
$this->addType('metaData', 'string'); | ||
} | ||
|
||
public function getParsedMessageParameters(): array { | ||
return json_decode($this->getMessageParameters() ?? '[]', true); | ||
} | ||
|
||
public function getParsedMetaData(): array { | ||
return json_decode($this->getMetaData() ?? '[]', true); | ||
} | ||
|
||
/** | ||
* @return TalkRoomProxyMessage | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters