Skip to content

Commit f1a9172

Browse files
gnpricechrisbobbe
authored andcommitted
api: Drop isOwner, isAdmin, isGuest from User class
These are obsoleted by [User.role] (which dates to Zulip 4.0). We never looked at these fields, but had a latent bug because we weren't keeping them up to date on RealmUserUpdateEvent. To fix the bug, just stop having the fields around at all. (Later if we find we want booleans with these handy names, we can always add getters that just inspect [User.role].)
1 parent 911396e commit f1a9172

File tree

4 files changed

+3
-18
lines changed

4 files changed

+3
-18
lines changed

lib/api/model/model.dart

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,9 @@ class User {
194194
String fullName;
195195
String dateJoined;
196196
bool isActive; // Really sometimes absent in /register, but we normalize that away; see [InitialSnapshot.realmUsers].
197-
bool isOwner;
198-
bool isAdmin;
199-
bool isGuest;
197+
// bool isOwner; // obsoleted by [role]; ignore
198+
// bool isAdmin; // obsoleted by [role]; ignore
199+
// bool isGuest; // obsoleted by [role]; ignore
200200
bool? isBillingAdmin; // TODO(server-5)
201201
bool isBot;
202202
int? botType; // TODO enum
@@ -240,9 +240,6 @@ class User {
240240
required this.fullName,
241241
required this.dateJoined,
242242
required this.isActive,
243-
required this.isOwner,
244-
required this.isAdmin,
245-
required this.isGuest,
246243
required this.isBillingAdmin,
247244
required this.isBot,
248245
required this.botType,

lib/api/model/model.g.dart

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/api/model/model_checks.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ extension UserChecks on Subject<User> {
88
Subject<String> get fullName => has((x) => x.fullName, 'fullName');
99
Subject<String> get dateJoined => has((x) => x.dateJoined, 'dateJoined');
1010
Subject<bool> get isActive => has((x) => x.isActive, 'isActive');
11-
Subject<bool> get isOwner => has((x) => x.isOwner, 'isOwner');
12-
Subject<bool> get isAdmin => has((x) => x.isAdmin, 'isAdmin');
13-
Subject<bool> get isGuest => has((x) => x.isGuest, 'isGuest');
1411
Subject<bool?> get isBillingAdmin => has((x) => x.isBillingAdmin, 'isBillingAdmin');
1512
Subject<bool> get isBot => has((x) => x.isBot, 'isBot');
1613
Subject<int?> get botType => has((x) => x.botType, 'botType');

test/example_data.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,6 @@ User user({
9494
fullName: fullName ?? 'A user', // TODO generate example names
9595
dateJoined: '2023-04-28',
9696
isActive: isActive ?? true,
97-
isOwner: false,
98-
isAdmin: false,
99-
isGuest: false,
10097
isBillingAdmin: false,
10198
isBot: isBot ?? false,
10299
botType: null,

0 commit comments

Comments
 (0)