Browse Source

Return isCustomAvatar=true when the name of room start with an emoji

Signed-off-by: Vitor Mattos <vitor@php.rio>
pull/9423/head
Vitor Mattos 2 years ago
parent
commit
0ce23663e3
  1. 2
      lib/Service/RoomFormatter.php
  2. 26
      tests/integration/features/conversation/avatar.feature

2
lib/Service/RoomFormatter.php

@ -136,7 +136,7 @@ class RoomFormatter {
'callFlag' => Participant::FLAG_DISCONNECTED,
'messageExpiration' => 0,
'avatarVersion' => $this->avatarService->getAvatarVersion($room),
'isCustomAvatar' => $room->getAvatar() ? true : false,
'isCustomAvatar' => $this->avatarService->isCustomAvatar($room),
'breakoutRoomMode' => BreakoutRoom::MODE_NOT_CONFIGURED,
'breakoutRoomStatus' => BreakoutRoom::STATUS_STOPPED,
];

26
tests/integration/features/conversation/avatar.feature

@ -62,6 +62,32 @@ Feature: conversation/avatar
| avatarVersion | NOT_EMPTY |
| isCustomAvatar | 0 |
Scenario: Conversation that the name start with emoji need to have custom avatar
Given user "participant1" creates room "room1" (v4)
| roomType | 3 |
| roomName | room1 |
And user "participant1" gets room "room1" with 200 (v4)
| avatarVersion | NOT_EMPTY |
| isCustomAvatar | 0 |
| displayName | room1 |
And user "participant1" renames room "room1" to "room2" with 200 (v4)
And user "participant1" gets room "room1" with 200 (v4)
| avatarVersion | NOT_EMPTY |
| isCustomAvatar | 0 |
| displayName | room2 |
Then the room "room1" has an avatar with 200
And user "participant1" renames room "room1" to "💙room2" with 200 (v4)
And user "participant1" gets room "room1" with 200 (v4)
| avatarVersion | NOT_EMPTY |
| isCustomAvatar | 1 |
| displayName | 💙room2 |
Then the room "room1" has an avatar with 200
And user "participant1" renames room "room1" to "room1" with 200 (v4)
And user "participant1" gets room "room1" with 200 (v4)
| avatarVersion | NOT_EMPTY |
| isCustomAvatar | 0 |
| displayName | room1 |
Scenario: User should receive the room avatar when see a rich object at media tab
Given user "participant1" creates room "public room" (v4)
| roomType | 3 |

Loading…
Cancel
Save