diff --git a/CHANGELOG.md b/CHANGELOG.md index dbb0c52a189..fb26b8ddf95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ All notable changes to this project will be documented in this file. - Require Nextcloud 33 / Hub 26 Winter - Enable notifications in group conversations by default for new instances [#16319](https://github.com/nextcloud/spreed/issues/16319) +- Bots: The `object.name` was set to an empty string for messages with attachments. This was fixed to be `'message'` as for normal messages without any attachments. ## 22.0.7 – 2025-12-17 ### Changed diff --git a/docs/bots.md b/docs/bots.md index 83d01b0d929..40143e48ca2 100644 --- a/docs/bots.md +++ b/docs/bots.md @@ -78,7 +78,7 @@ The content format follows the [Activity Streams 2.0 Vocabulary](https://www.w3. | actor.name | The display name of the attendee sending the message. | | actor.talkParticipantType | *Optional:* 🆕 Added in Talk 21. If applicable the attendee's [participant type](constants.md#participant-types) is provided. However this field can not be provided in some cases, e.g. bots. | | object.id | The message ID of the given message on the origin server. It can be used to react or reply to the given message. | -| object.name | For normal written messages `message`, otherwise one of the known [system message identifiers](chat.md#system-messages). | +| object.name | For normal written messages `message`, otherwise one of the known [system message identifiers](chat.md#system-messages). Due to a bug this was set to an empty string for messages with attachments until Nextcloud 33 with Talk 23. | | object.content | A JSON encoded dictionary with a `message` and `parameters` key. The message can include placeholders and the [Rich Object parameters](https://github.com/nextcloud/server/blob/master/lib/public/RichObjectStrings/Definitions.php) are rendered into it in the chat view. | | object.mediaType | `text/markdown` when the message should be interpreted as Markdown. Otherwise `text/plain`. | | object.inReplyTo | *Optional:* 🆕 Added in Talk 21. If applicable the parent message which was quoted in this message | @@ -432,3 +432,6 @@ When installing the bot specify `nextcloudapp://$APPID` as the bot URL, together - Added direct support for Nextcloud apps as bots. A new feature flag `events` which indicates that a bot will utilize the `OCA\Talk\Events\BotInvokeEvent` event listed in [PHP events](events.md#bot-invoke) rather than being invoked via a webhook. - Added new feature flag `reaction` which allows to get invoked for added and removed reactions - In hooks that are replies the new optional field `object.inReplyTo` contains the actor and content of the parent chat message + +### Nextcloud 33 / Talk 23 - February 2026 +- Due to a bug the `object.name` was set to an empty string for messages with attachments. This was fixed to be `'message'` as for normal messages without any attachments. diff --git a/lib/Service/BotService.php b/lib/Service/BotService.php index 912dc1aa1a6..fbe339a1962 100644 --- a/lib/Service/BotService.php +++ b/lib/Service/BotService.php @@ -164,7 +164,7 @@ public function afterSystemMessageSent(SystemMessageSentEvent $event, MessagePar $this->invokeBots($botServers, $event->getRoom(), $event->getComment(), [ 'type' => 'Activity', 'actor' => $this->activityPubHelper->generatePersonFromMessageActor($message), - 'object' => $this->activityPubHelper->generateNote($event->getComment(), $messageData, $message->getMessageRaw()), + 'object' => $this->activityPubHelper->generateNote($event->getComment(), $messageData, $message->getMessageRaw() ?: 'message'), 'target' => $this->activityPubHelper->generateCollectionFromRoom($event->getRoom()), ]); }