From ba94d54e8e3f0a152e52fc0b68fa86a5fc584c40 Mon Sep 17 00:00:00 2001 From: Antoine Rollin <66251236+antoinerollindev@users.noreply.github.com> Date: Tue, 5 Mar 2024 11:43:38 +0100 Subject: [PATCH] Add update message in OboMessageService (#797) This commit updates the OboMessageService so that a bot can update a message on behalf of someone (along with OBO message send and OBO message delete). --- .../core/service/message/MessageService.java | 2 ++ .../service/message/OboMessageService.java | 21 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/symphony-bdk-core/src/main/java/com/symphony/bdk/core/service/message/MessageService.java b/symphony-bdk-core/src/main/java/com/symphony/bdk/core/service/message/MessageService.java index 484f26d03..d478414a0 100644 --- a/symphony-bdk-core/src/main/java/com/symphony/bdk/core/service/message/MessageService.java +++ b/symphony-bdk-core/src/main/java/com/symphony/bdk/core/service/message/MessageService.java @@ -306,6 +306,7 @@ public List getAttachmentTypes() { * @return a {@link V4Message} object containing the details of the sent message * @see Create Update v4 */ + @Override @API(status = API.Status.EXPERIMENTAL) public V4Message update(@Nonnull V4Message messageToUpdate, @Nonnull Message content) { return this.update(messageToUpdate.getStream().getStreamId(), messageToUpdate.getMessageId(), content); @@ -320,6 +321,7 @@ public V4Message update(@Nonnull V4Message messageToUpdate, @Nonnull Message con * @return a {@link V4Message} object containing the details of the sent message * @see Create Update v4 */ + @Override @API(status = API.Status.EXPERIMENTAL) public V4Message update(@Nonnull String streamId, @Nonnull String messageId, @Nonnull Message content) { return this.executeAndRetry("update", messagesApi.getApiClient().getBasePath(), () -> { diff --git a/symphony-bdk-core/src/main/java/com/symphony/bdk/core/service/message/OboMessageService.java b/symphony-bdk-core/src/main/java/com/symphony/bdk/core/service/message/OboMessageService.java index 615070f3d..8476cebb0 100644 --- a/symphony-bdk-core/src/main/java/com/symphony/bdk/core/service/message/OboMessageService.java +++ b/symphony-bdk-core/src/main/java/com/symphony/bdk/core/service/message/OboMessageService.java @@ -68,6 +68,27 @@ public interface OboMessageService { */ V4Message send(@Nonnull String streamId, @Nonnull Message message); + /** + * Update an existing message. The existing message must be a valid social message, that has not been deleted. + * + * @param messageToUpdate the message to be updated + * @param content the update content (attachments are not supported yet) + * @return a {@link V4Message} object containing the details of the sent message + * @see Create Update v4 + */ + V4Message update(@Nonnull V4Message messageToUpdate, @Nonnull Message content); + + /** + * Update an existing message. The existing message must be a valid social message, that has not been deleted. + * + * @param streamId the ID of the stream where the message to be updated comes from + * @param messageId the ID of the message to be updated + * @param content the update content (attachments are not supported yet) + * @return a {@link V4Message} object containing the details of the sent message + * @see Create Update v4 + */ + V4Message update(@Nonnull String streamId, @Nonnull String messageId, @Nonnull Message content); + /** * Suppresses a users message based on the messageID pass in parameter. *