Skip to content

Commit

Permalink
fixup!
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim Sukharev <[email protected]>
  • Loading branch information
Antreesy committed Feb 28, 2025
1 parent 38830fb commit c6fef38
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 22 deletions.
24 changes: 13 additions & 11 deletions lib/Service/RoomFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,17 +274,6 @@ public function formatRoomV4(
}
}

if ($room->getLobbyState() === Webinary::LOBBY_NON_MODERATORS &&
!$currentParticipant->hasModeratorPermissions() &&
!($currentParticipant->getPermissions() & Attendee::PERMISSIONS_LOBBY_IGNORE)) {
// No participants and chat messages for users in the lobby.
$roomData['hasCall'] = false;
$roomData['canLeaveConversation'] = true;
return $roomData;
}

$roomData['canStartCall'] = $currentParticipant->canStartCall($this->serverConfig);

$currentUser = null;
if ($attendee->getActorType() === Attendee::ACTOR_USERS) {
$currentUser = $this->userManager->get($attendee->getActorId());
Expand Down Expand Up @@ -356,6 +345,19 @@ public function formatRoomV4(
$roomData['remoteToken'] = $room->getRemoteToken();
}

if ($room->getLobbyState() === Webinary::LOBBY_NON_MODERATORS &&
!$currentParticipant->hasModeratorPermissions() &&
!($currentParticipant->getPermissions() & Attendee::PERMISSIONS_LOBBY_IGNORE)) {
// No participants and chat messages for users in the lobby.
$roomData['hasCall'] = false;
$roomData['unreadMessages'] = 0;
$roomData['unreadMention'] = false;
$roomData['unreadMentionDirect'] = false;
return $roomData;
}

$roomData['canStartCall'] = $currentParticipant->canStartCall($this->serverConfig);

// FIXME This should not be done, but currently all the clients use it to get the avatar of the user …
if ($room->getType() === Room::TYPE_ONE_TO_ONE) {
$participants = json_decode($room->getName(), true);
Expand Down
16 changes: 5 additions & 11 deletions src/components/LeftSidebar/LeftSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ import SearchBox from '../UIShared/SearchBox.vue'
import TransitionWrapper from '../UIShared/TransitionWrapper.vue'

import { useArrowNavigation } from '../../composables/useArrowNavigation.js'
import { ATTENDEE, AVATAR, CONVERSATION, WEBINAR } from '../../constants.ts'
import { ATTENDEE, AVATAR, CONVERSATION } from '../../constants.ts'
import BrowserStorage from '../../services/BrowserStorage.js'
import { getTalkConfig, hasTalkFeature } from '../../services/CapabilitiesManager.ts'
import {
Expand Down Expand Up @@ -893,16 +893,10 @@ export default {
*/
async handleShouldRefreshConversations(options) {
if (options?.token && options?.properties) {
if (this.$store.getters.isInLobby && options.properties.lobbyState === WEBINAR.LOBBY.NONE) {
// If the lobby enabled, non-moderators do not have access to messages
// On disabling, should fetch complete room object to set up chat context
await this.$store.dispatch('fetchConversation', { token: options.token })
} else {
await this.$store.dispatch('setConversationProperties', {
token: options.token,
properties: options.properties,
})
}
await this.$store.dispatch('setConversationProperties', {
token: options.token,
properties: options.properties,
})
}

if (this.isCurrentTabLeader) {
Expand Down

0 comments on commit c6fef38

Please sign in to comment.