@@ -24,29 +24,11 @@ class ChatCreateOrEditRoomDialog extends StatefulWidget
2424 const ChatCreateOrEditRoomDialog ({
2525 super .key,
2626 this .room,
27- this .groupName,
28- this .joinedUsers,
29- this .initialState,
30- this .visibility,
31- this .historyVisibility,
32- this .groupCall,
33- this .powerLevelContentOverride,
34- this .federated,
35- this .encrypted,
3627 this .space = false ,
3728 });
3829
3930 final Room ? room;
4031 final bool space;
41- final String ? groupName;
42- final List <User >? joinedUsers;
43- final List <StateEvent >? initialState;
44- final Visibility ? visibility;
45- final HistoryVisibility ? historyVisibility;
46- final bool ? groupCall;
47- final Map <String , dynamic >? powerLevelContentOverride;
48- final bool ? federated;
49- final bool ? encrypted;
5032
5133 @override
5234 State <ChatCreateOrEditRoomDialog > createState () =>
@@ -72,21 +54,22 @@ class _ChatCreateOrEditRoomDialogState
7254 @override
7355 void initState () {
7456 super .initState ();
75- _groupName = widget.room? .name ?? widget.groupName ;
57+ _groupName = widget.room? .name;
7658 _isSpace = widget.room? .isSpace ?? widget.space;
7759 _topic = widget.room? .topic;
7860 _existingGroup = widget.room != null ;
7961
80- _enableEncryption = widget.room? .encrypted ?? widget.encrypted ?? false ;
81- _federated = widget.room? .isFederated ?? widget.federated ?? true ;
82- _groupCall = widget.room? .hasActiveGroupCall ?? widget.groupCall ?? false ;
62+ _enableEncryption = widget.room? .encrypted ?? false ;
63+ _federated = widget.room? .isFederated ?? true ;
64+ _groupCall = widget.room? .hasActiveGroupCall ?? false ;
8365 _groupNameController = TextEditingController (text: _groupName);
8466 _groupTopicController = TextEditingController (text: _topic);
8567 _visibility = (widget.room? .joinRules == JoinRules .public
8668 ? Visibility .public
8769 : Visibility .private);
88- _profiles = (widget.room? .getParticipants () ?? widget.joinedUsers)
89- ? .where (
70+ _profiles = widget.room
71+ ? .getParticipants ()
72+ .where (
9073 (e) {
9174 final id = e.id.split (':' ).firstOrNull? .replaceAll ('@' , '' );
9275
@@ -262,9 +245,7 @@ class _ChatCreateOrEditRoomDialogState
262245 ),
263246 trailing: CommonSwitch (
264247 value: _enableEncryption,
265- onChanged: _enableEncryption ||
266- widget.encrypted == true ||
267- widget.room? .encrypted == true ||
248+ onChanged: widget.room? .encrypted == true ||
268249 widget.room? .canChangeStateEvent (EventTypes .Encryption ) ==
269250 false
270251 ? null
@@ -277,7 +258,7 @@ class _ChatCreateOrEditRoomDialogState
277258 },
278259 ),
279260 title: Text (l10n.encrypted),
280- subtitle: widget.encrypted == true || widget. room? .encrypted == true
261+ subtitle: widget.room? .encrypted == true
281262 ? null
282263 : (Text (l10n.enableEncryptionWarning)),
283264 ),
0 commit comments