Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions docs/conversation.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,10 @@
| `objectId` | string | v1 | | See [Object types](constants.md#object-types) documentation for explanation |
| `breakoutRoomMode` | string | v4 | | Breakout room configuration mode (see [constants list](constants.md#breakout-room-modes)) (only available with `breakout-rooms-v1` capability) |
| `breakoutRoomStatus` | string | v4 | | Breakout room status (see [constants list](constants.md#breakout-room-status)) (only available with `breakout-rooms-v1` capability) |
| `status` | string | v4 | | Optional: Only available for one-to-one conversations and when `includeStatus=true` is set |
| `statusIcon` | string | v4 | | Optional: Only available for one-to-one conversations and when `includeStatus=true` is set |
| `statusMessage` | string | v4 | | Optional: Only available for one-to-one conversations and when `includeStatus=true` is set |
| `status` | string | v4 | | Optional: Only available for one-to-one conversations, when `includeStatus=true` is set and the user has a status |
| `statusIcon` | ?string | v4 | | Optional: Only available for one-to-one conversations, when `includeStatus=true` is set and the user has a status, can still be null even with a status |
| `statusMessage` | ?string | v4 | | Optional: Only available for one-to-one conversations, when `includeStatus=true` is set and the user has a status, can still be null even with a status |
| `statusClearAt` | ?int | v4 | | Optional: Only available for one-to-one conversations, when `includeStatus=true` is set and the user has a status, can still be null even with a status |
| `participants` | array | v1 | v2 | **Removed** |
| `guestList` | string | v1 | v2 | **Removed** |
| `avatarVersion` | string | v4 | | Version of conversation avatar used to easier expiration of the avatar in case a moderator updates it, since the avatar endpoint should be cached for 24 hours. |
Expand Down
3 changes: 2 additions & 1 deletion lib/Controller/RoomController.php
Original file line number Diff line number Diff line change
Expand Up @@ -868,10 +868,11 @@ protected function formatParticipantList(array $participants, bool $includeStatu
}

if (isset($statuses[$userId])) {
$clearAt = $statuses[$userId]->getClearAt();
$result['status'] = $statuses[$userId]->getStatus();
$result['statusIcon'] = $statuses[$userId]->getIcon();
$result['statusMessage'] = $statuses[$userId]->getMessage();
$result['statusClearAt'] = $statuses[$userId]->getClearAt();
$result['statusClearAt'] = $clearAt ? $clearAt->getTimestamp() : null;
} elseif (isset($headers['X-Nextcloud-Has-User-Statuses'])) {
$result['status'] = IUserStatus::OFFLINE;
$result['statusIcon'] = null;
Expand Down
3 changes: 2 additions & 1 deletion lib/Service/RoomFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,11 @@ public function formatRoomV4(
}

if (isset($statuses[$participant])) {
$clearAt = $statuses[$participant]->getClearAt();
$roomData['status'] = $statuses[$participant]->getStatus();
$roomData['statusIcon'] = $statuses[$participant]->getIcon();
$roomData['statusMessage'] = $statuses[$participant]->getMessage();
$roomData['statusClearAt'] = $statuses[$participant]->getClearAt();
$roomData['statusClearAt'] = $clearAt ? $clearAt->getTimestamp() : null;
} elseif (!empty($statuses)) {
$roomData['status'] = IUserStatus::OFFLINE;
$roomData['statusIcon'] = null;
Expand Down
11 changes: 11 additions & 0 deletions src/store/conversationsStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import Vue from 'vue'

import { getCurrentUser } from '@nextcloud/auth'
import { showInfo, showSuccess, TOAST_PERMANENT_TIMEOUT } from '@nextcloud/dialogs'
import { emit } from '@nextcloud/event-bus'

import {
CALL,
Expand Down Expand Up @@ -207,6 +208,16 @@ const actions = {
addConversation(context, conversation) {
context.commit('addConversation', conversation)

if (conversation.type === CONVERSATION.TYPE.ONE_TO_ONE && conversation.status) {
emit('user_status:status.updated', {
status: conversation.status,
message: conversation.statusMessage,
icon: conversation.statusIcon,
clearAt: conversation.statusClearAt,
userId: conversation.name,
})
}

let currentUser = {
uid: context.getters.getUserId(),
displayName: context.getters.getDisplayName(),
Expand Down