fix(talk): preset signaling mode for Talk v23.0.2+, remove unused initial state#1689
fix(talk): preset signaling mode for Talk v23.0.2+, remove unused initial state#1689ShGKme wants to merge 2 commits into
Conversation
| grid_videos_limit_enforced: capabilities?.spreed?.config?.call?.['grid-limit-enforced'] ?? false, | ||
| federation_enabled: capabilities?.spreed?.config?.federation?.enabled, | ||
| // default_permissions - MISSED (!) | ||
| default_permissions: capabilities?.spreed?.config?.permissions?.default ?? 502, // Attendee::PERMISSIONS_MAX_DEFAULT & ~Attendee::PERMISSIONS_LOBBY_IGNORE |
There was a problem hiding this comment.
Only with react-permission feature (34+, but then this config is also there), otherwise 246
| default_permissions: capabilities?.spreed?.config?.permissions?.default ?? 502, // Attendee::PERMISSIONS_MAX_DEFAULT & ~Attendee::PERMISSIONS_LOBBY_IGNORE | |
| default_permissions: capabilities?.spreed?.config?.permissions?.default ?? 246, // Attendee::PERMISSIONS_MAX_DEFAULT & ~Attendee::PERMISSIONS_LOBBY_IGNORE |
There was a problem hiding this comment.
502=111110110
246=011110110
Since it is a bitmap, doesn't it mean having an extra permission doesn't hurt in older versions and just unused?
There was a problem hiding this comment.
As mentioned, in the permissions editor we use this:
https://github.com/nextcloud/spreed/blob/cbe7046a20e9b5d1ed47d26bcdfe99b9def158dd/src/components/PermissionsEditor/PermissionsEditor.vue#L198-L210
Also the API will 400 on a request when you set 502 as permission, because it does not match the constraint int<0, 255>
There was a problem hiding this comment.
We can use capabilities?.spreed?.features?.includes('react-permission') maybe to define if bitmap change is known to server
There was a problem hiding this comment.
Since frontend doesn't use the initial state anymore, and there is fallback on frontend checking for react-permissions, we don't need this initial state on Talk Desktop.
There was a problem hiding this comment.
Reworked PR. All the removed from the frontend initial state is not needed on Talk Desktop at all (because it is not used anymore). Including the discussed default_permissions
To support old servers, a fallback is needed on the frontend side - in progress.
Removed in Talk 24 Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
0fa40ee to
c98ee5e
Compare
|
PR is reworked completely. See the new title and description. |
|
Ah no wait, initial state is still used at least here on stable33, so you can't compile it against this PR: rg -n '\bloadState\s*\(' --glob '*.{js,ts,vue}'
stores/settings.ts
36: const readStatusPrivacy = ref<PRIVACY_KEYS>(loadState('spreed', 'read_status_privacy', PRIVACY.PRIVATE))
37: const typingStatusPrivacy = ref<PRIVACY_KEYS>(loadState('spreed', 'typing_privacy', PRIVACY.PRIVATE))
52: const attachmentFolder = ref<string>(loadState('spreed', 'attachment_folder', ''))
53: const attachmentFolderFreeSpace = ref<number>(loadState('spreed', 'attachment_folder_free_space', 0))
stores/actor.ts
142: if (!loadState('spreed', 'circles_enabled', false)) {
stores/sounds.js
19: shouldPlaySounds = loadState('spreed', 'play_sounds', false)
24: shouldPlaySounds = loadState('spreed', 'play_sounds', false)
components/PermissionsEditor/PermissionsEditor.vue
170: return loadState(
'spreed',
'default_permissions',
PERMISSIONS.MAX_DEFAULT & ~PERMISSIONS.LOBBY_IGNORE,
)
components/LeftSidebar/LeftSidebar.vue
952: if (loadState('spreed', 'signaling_mode') !== 'internal') {
components/LeftSidebar/SearchConversationsResults/SearchConversationsResults.vue
39:const isCirclesEnabled = loadState('spreed', 'circles_enabled')
components/RightSidebar/Participants/ParticipantsSearchResults.vue
105:const isCirclesEnabled = loadState('spreed', 'circles_enabled')
components/CallView/Grid/VideosGrid.vue
187:const videosCap = parseInt(loadState('spreed', 'grid_videos_limit'), 10) || 0
188:const videosCapEnforced = loadState('spreed', 'grid_videos_limit_enforced') || false
components/ConversationSettings/ListableSettings.vue
72: isGuestsAccountsEnabled: loadState('spreed', 'guests_accounts_enabled'),
components/ConversationSettings/ConversationSettingsDialog.vue
151:const matterbridgeEnabled = loadState('spreed', 'enable_matterbridge') |
☑️ Resolves
call_enabled,federation_enabled,start_conversations,circles_enabled,guests_accounts_enabled,read_status_privacy,typing_privacy,attachment_folder,attachment_folder_free_spacegrid_videos_limit,grid_videos_limit_enforcedplay_soundssip_dialin_info,enable_matterbridgesignaling_modeinitial state