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
4 changes: 4 additions & 0 deletions lib/Federation/CloudFederationProviderTalk.php
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,10 @@ private function messagePosted(int $remoteAttendeeId, array $notification): arra
return [];
}

$this->logger->debug('Setting unread info for local federated user ' . $invite->getUserId() . ' in ' . $room->getToken() . ' to ' . json_encode($notification['unreadInfo']), [
'app' => 'spreed-federation',
]);

$this->participantService->updateUnreadInfoForProxyParticipant(
$participant,
$notification['unreadInfo']['unreadMessages'],
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,9 @@ private function assertRooms($rooms, TableNode $formData, bool $shouldOrder = fa
if (isset($expectedRoom['lastMessage'])) {
$data['lastMessage'] = $room['lastMessage'] ? $room['lastMessage']['message'] : '';
}
if (isset($expectedRoom['lastReadMessage'])) {
$data['lastReadMessage'] = self::$messageIdToText[(int) $room['lastReadMessage']] ?? (!$room['lastReadMessage'] ? 'ZERO': 'UNKNOWN_MESSAGE');
}
if (isset($expectedRoom['unreadMessages'])) {
$data['unreadMessages'] = (int) $room['unreadMessages'];
}
Expand Down
20 changes: 10 additions & 10 deletions tests/integration/features/federation/chat.feature
Original file line number Diff line number Diff line change
Expand Up @@ -147,26 +147,26 @@ Feature: federation/chat
| id | name | type | remoteServer | remoteToken |
| room | room | 2 | LOCAL | room |
Then user "participant2" is participant of the following rooms (v4)
| id | type | unreadMessages | unreadMention | unreadMentionDirect |
| room | 2 | 0 | 0 | 0 |
| id | type | lastReadMessage | unreadMessages | unreadMention | unreadMentionDirect |
| room | 2 | UNKNOWN_MESSAGE | 0 | 0 | 0 |
And user "participant1" sends message "Message 1" to room "room" with 201
And user "participant1" sends message "Message 2" to room "room" with 201
When user "participant2" marks room "LOCAL::room" as unread with 200 (v1)
Then user "participant2" is participant of the following rooms (v4)
| id | type | unreadMessages | unreadMention | unreadMentionDirect |
| room | 2 | 1 | 0 | 0 |
| id | type | lastReadMessage | unreadMessages | unreadMention | unreadMentionDirect |
| room | 2 | Message 1 | 1 | 0 | 0 |
When user "participant2" reads message "NULL" in room "LOCAL::room" with 200 (v1)
Then user "participant2" is participant of the following rooms (v4)
| id | type | unreadMessages | unreadMention | unreadMentionDirect |
| room | 2 | 0 | 0 | 0 |
| id | type | lastReadMessage | unreadMessages | unreadMention | unreadMentionDirect |
| room | 2 | Message 2 | 0 | 0 | 0 |
When user "participant2" reads message "Message 1" in room "LOCAL::room" with 200 (v1)
Then user "participant2" is participant of the following rooms (v4)
| id | type | unreadMessages | unreadMention | unreadMentionDirect |
| room | 2 | 1 | 0 | 0 |
| id | type | lastReadMessage | unreadMessages | unreadMention | unreadMentionDirect |
| room | 2 | Message 1 | 1 | 0 | 0 |
When user "participant2" reads message "Message 2" in room "LOCAL::room" with 200 (v1)
Then user "participant2" is participant of the following rooms (v4)
| id | type | unreadMessages | unreadMention | unreadMentionDirect |
| room | 2 | 0 | 0 | 0 |
| id | type | lastReadMessage | unreadMessages | unreadMention | unreadMentionDirect |
| room | 2 | Message 2 | 0 | 0 | 0 |

Scenario: Error handling of chatting (posting a too long message)
Given the following "spreed" app config is set
Expand Down