From 8e31432ac69ece3c1f8e2ee97ac56450ce35ec2c Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 2 Apr 2026 17:30:07 +0200 Subject: [PATCH] feat(talk): Allow to create conversations that are meetings Signed-off-by: Joas Schilling --- lib/private/Talk/ConversationOptions.php | 23 ++++++++++++--- lib/public/Talk/IConversationOptions.php | 36 ++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 4 deletions(-) diff --git a/lib/private/Talk/ConversationOptions.php b/lib/private/Talk/ConversationOptions.php index f167fa6d164c7..f237491f355be 100644 --- a/lib/private/Talk/ConversationOptions.php +++ b/lib/private/Talk/ConversationOptions.php @@ -12,10 +12,11 @@ use OCP\Talk\IConversationOptions; class ConversationOptions implements IConversationOptions { - private bool $isPublic; - - private function __construct(bool $isPublic) { - $this->isPublic = $isPublic; + private function __construct( + private bool $isPublic, + private ?\DateTimeInterface $meetingStartDate = null, + private ?\DateTimeInterface $meetingEndDate = null, + ) { } public static function default(): self { @@ -30,4 +31,18 @@ public function setPublic(bool $isPublic = true): IConversationOptions { public function isPublic(): bool { return $this->isPublic; } + + public function setMeetingDate(\DateTimeInterface $meetingStartDate, \DateTimeInterface $meetingEndDate): IConversationOptions { + $this->meetingStartDate = $meetingStartDate; + $this->meetingEndDate = $meetingEndDate; + return $this; + } + + public function getMeetingStartDate(): ?\DateTimeInterface { + return $this->meetingStartDate; + } + + public function getMeetingEndDate(): ?\DateTimeInterface { + return $this->meetingEndDate; + } } diff --git a/lib/public/Talk/IConversationOptions.php b/lib/public/Talk/IConversationOptions.php index 9433bad989354..36a86c4c213b5 100644 --- a/lib/public/Talk/IConversationOptions.php +++ b/lib/public/Talk/IConversationOptions.php @@ -30,4 +30,40 @@ public function isPublic(): bool; * @since 24.0.0 */ public function setPublic(bool $isPublic = true): self; + + /** + * Date of the meeting if the conversation is tied to a single meeting event + * + * This will be used by the Talk backend to expire the conversation after a + * reasonable amount of time after the meeting unless the conversation is + * being reused. + * + * @param \DateTimeInterface $meetingStartDate + * @param \DateTimeInterface $meetingEndDate + * @return $this + * @since 34.0.0 + * @since 33.0.3 + * @since 32.0.9 + */ + public function setMeetingDate(\DateTimeInterface $meetingStartDate, \DateTimeInterface $meetingEndDate): self; + + /** + * Start date of the meeting + * + * @return ?\DateTimeInterface + * @since 34.0.0 + * @since 33.0.3 + * @since 32.0.9 + */ + public function getMeetingStartDate(): ?\DateTimeInterface; + + /** + * End date of the meeting + * + * @return ?\DateTimeInterface + * @since 34.0.0 + * @since 33.0.3 + * @since 32.0.9 + */ + public function getMeetingEndDate(): ?\DateTimeInterface; }