feat(threads): Expose the topmost parent id for all messages

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2025-06-25 16:15:36 +02:00
parent 27d8be28f9
commit 47cb43bf68
No known key found for this signature in database
GPG key ID: F72FA5B49FFA96B0
2 changed files with 3 additions and 1 deletions

View file

@ -210,6 +210,7 @@ class Message {
'reactions' => $reactions,
'expirationTimestamp' => $expireDate ? $expireDate->getTimestamp() : 0,
'markdown' => $this->getMessageType() === ChatManager::VERB_SYSTEM ? false : true,
'threadId' => (int)$this->getComment()->getTopmostParentId(),
];
if ($this->lastEditActorType && $this->lastEditActorId && $this->lastEditTimestamp) {
@ -223,7 +224,7 @@ class Message {
$data['deleted'] = true;
}
$metaData = $this->comment->getMetaData() ?? [];
$metaData = $this->getComment()->getMetaData() ?? [];
if (!empty($metaData[self::METADATA_SILENT])) {
$data[self::METADATA_SILENT] = true;
}

View file

@ -118,6 +118,7 @@ namespace OCA\Talk;
* lastEditActorType?: string,
* lastEditTimestamp?: int,
* silent?: bool,
* threadId?: int,
* }
*
* @psalm-type TalkChatProxyMessage = TalkBaseMessage