mirror of
https://github.com/nextcloud/spreed.git
synced 2025-12-18 05:20:50 +01:00
feat(archive): Finalize archived conversation behaviour
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
7d241273c4
commit
d046ef01ef
9 changed files with 31 additions and 15 deletions
|
|
@ -157,7 +157,7 @@
|
|||
* `edit-messages-note-to-self` - Messages in note-to-self conversations can be edited indefinitely
|
||||
|
||||
## 20.1
|
||||
* `archived-conversations` (local) - Conversations can be marked as archived which will hide them from the conversation list by default
|
||||
* `archived-conversations-v2` (local) - Conversations can be marked as archived which will hide them from the conversation list by default
|
||||
* `talk-polls-drafts` - Whether moderators can store and retrieve poll drafts
|
||||
* `download-call-participants` - Whether the endpoints for moderators to download the call participants is available
|
||||
* `chat-summary-api` (local) - Whether the endpoint to get summarized chat messages in a conversation is available
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@
|
|||
| `callRecording` | int | v4 | | Type of call recording (see [Constants - Call recording status](constants.md#call-recording-status)) (only available with `recording-v1` capability) |
|
||||
| `recordingConsent` | int | v4 | | Whether recording consent is required before joining a call (Only 0 and 1 will be returned, see [constants list](constants.md#recording-consent-required)) (only available with `recording-consent` capability) |
|
||||
| `mentionPermissions` | int | v4 | | Whether all participants can mention using `@all` or only moderators (see [constants list](constants.md#mention-permissions)) (only available with `mention-permissions` capability) |
|
||||
| `isArchived` | bool | v4 | | Flag if the conversation is archived by the user (only available with `archived-conversations` capability) | |
|
||||
| `isArchived` | bool | v4 | | Flag if the conversation is archived by the user (only available with `archived-conversations-v2` capability) | |
|
||||
|
||||
## Creating a new conversation
|
||||
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ class Capabilities implements IPublicCapability {
|
|||
'chat-reference-id',
|
||||
'mention-permissions',
|
||||
'edit-messages-note-to-self',
|
||||
'archived-conversations',
|
||||
'archived-conversations-v2',
|
||||
'talk-polls-drafts',
|
||||
'download-call-participants',
|
||||
];
|
||||
|
|
@ -126,7 +126,7 @@ class Capabilities implements IPublicCapability {
|
|||
'avatar',
|
||||
'remind-me-later',
|
||||
'note-to-self',
|
||||
'archived-conversations',
|
||||
'archived-conversations-v2',
|
||||
'chat-summary-api',
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ class Notifier {
|
|||
}
|
||||
|
||||
foreach ($usersToNotify as $mentionedUser) {
|
||||
if ($this->shouldMentionedUserBeNotified($mentionedUser['id'], $comment, $chat, $mentionedUser['attendee'] ?? null, $mentionedUser['reason'])) {
|
||||
if ($this->shouldMentionedUserBeNotified($mentionedUser['id'], $comment, $chat, $mentionedUser['attendee'] ?? null)) {
|
||||
if (!$silent) {
|
||||
$notification->setUser($mentionedUser['id']);
|
||||
if (isset($mentionedUser['reason'])) {
|
||||
|
|
@ -209,7 +209,7 @@ class Notifier {
|
|||
];
|
||||
}
|
||||
|
||||
if (!$this->shouldMentionedUserBeNotified($replyTo->getActorId(), $comment, $chat, null, 'reply')) {
|
||||
if (!$this->shouldMentionedUserBeNotified($replyTo->getActorId(), $comment, $chat)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
|
@ -565,7 +565,7 @@ class Notifier {
|
|||
* 3. The user must be a participant of the room
|
||||
* 4. The user must not be active in the room
|
||||
*/
|
||||
protected function shouldMentionedUserBeNotified(string $userId, IComment $comment, Room $room, ?Attendee $attendee, string $reason): bool {
|
||||
protected function shouldMentionedUserBeNotified(string $userId, IComment $comment, Room $room, ?Attendee $attendee = null): bool {
|
||||
if ($comment->getActorType() === Attendee::ACTOR_USERS && $userId === $comment->getActorId()) {
|
||||
// Do not notify the user if they mentioned themselves
|
||||
return false;
|
||||
|
|
@ -583,10 +583,6 @@ class Notifier {
|
|||
$participant = new Participant($room, $attendee, null);
|
||||
}
|
||||
|
||||
if ($reason === 'all' && $attendee->isArchived()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($room->getLobbyState() !== Webinary::LOBBY_NONE &&
|
||||
!($participant->getPermissions() & Attendee::PERMISSIONS_LOBBY_IGNORE)) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -1557,6 +1557,8 @@ class RoomController extends AEnvironmentAwareController {
|
|||
/**
|
||||
* Archive a conversation
|
||||
*
|
||||
* Required capability: `archived-conversations-v2`
|
||||
*
|
||||
* @return DataResponse<Http::STATUS_OK, TalkRoom, array{}>
|
||||
*
|
||||
* 200: Conversation was archived
|
||||
|
|
@ -1572,6 +1574,8 @@ class RoomController extends AEnvironmentAwareController {
|
|||
/**
|
||||
* Unarchive a conversation
|
||||
*
|
||||
* Required capability: `archived-conversations-v2`
|
||||
*
|
||||
* @return DataResponse<Http::STATUS_OK, TalkRoom, array{}>
|
||||
*
|
||||
* 200: Conversation was unarchived
|
||||
|
|
|
|||
|
|
@ -16362,6 +16362,7 @@
|
|||
"post": {
|
||||
"operationId": "room-archive-conversation",
|
||||
"summary": "Archive a conversation",
|
||||
"description": "Required capability: `archived-conversations-v2`",
|
||||
"tags": [
|
||||
"room"
|
||||
],
|
||||
|
|
@ -16442,6 +16443,7 @@
|
|||
"delete": {
|
||||
"operationId": "room-unarchive-conversation",
|
||||
"summary": "Unarchive a conversation",
|
||||
"description": "Required capability: `archived-conversations-v2`",
|
||||
"tags": [
|
||||
"room"
|
||||
],
|
||||
|
|
|
|||
|
|
@ -16496,6 +16496,7 @@
|
|||
"post": {
|
||||
"operationId": "room-archive-conversation",
|
||||
"summary": "Archive a conversation",
|
||||
"description": "Required capability: `archived-conversations-v2`",
|
||||
"tags": [
|
||||
"room"
|
||||
],
|
||||
|
|
@ -16576,6 +16577,7 @@
|
|||
"delete": {
|
||||
"operationId": "room-unarchive-conversation",
|
||||
"summary": "Unarchive a conversation",
|
||||
"description": "Required capability: `archived-conversations-v2`",
|
||||
"tags": [
|
||||
"room"
|
||||
],
|
||||
|
|
|
|||
|
|
@ -1291,9 +1291,15 @@ export type paths = {
|
|||
};
|
||||
get?: never;
|
||||
put?: never;
|
||||
/** Archive a conversation */
|
||||
/**
|
||||
* Archive a conversation
|
||||
* @description Required capability: `archived-conversations-v2`
|
||||
*/
|
||||
post: operations["room-archive-conversation"];
|
||||
/** Unarchive a conversation */
|
||||
/**
|
||||
* Unarchive a conversation
|
||||
* @description Required capability: `archived-conversations-v2`
|
||||
*/
|
||||
delete: operations["room-unarchive-conversation"];
|
||||
options?: never;
|
||||
head?: never;
|
||||
|
|
|
|||
|
|
@ -1293,9 +1293,15 @@ export type paths = {
|
|||
};
|
||||
get?: never;
|
||||
put?: never;
|
||||
/** Archive a conversation */
|
||||
/**
|
||||
* Archive a conversation
|
||||
* @description Required capability: `archived-conversations-v2`
|
||||
*/
|
||||
post: operations["room-archive-conversation"];
|
||||
/** Unarchive a conversation */
|
||||
/**
|
||||
* Unarchive a conversation
|
||||
* @description Required capability: `archived-conversations-v2`
|
||||
*/
|
||||
delete: operations["room-unarchive-conversation"];
|
||||
options?: never;
|
||||
head?: never;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue