Skip to content

Commit 8c50537

Browse files
sm-sayedignprice
authored andcommitted
api: Add isActive to RealmUserUpdateEvent
This case was new in feature level 222 (server-8). This will become handy in the next commit(s) where we want to change the UI based on `User.isActive` when having a DM conversation.
1 parent c6abaf9 commit 8c50537

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

lib/api/model/events.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ class RealmUserUpdateEvent extends RealmUserEvent {
286286

287287
@JsonKey(readValue: _readFromPerson) final RealmUserUpdateCustomProfileField? customProfileField;
288288
@JsonKey(readValue: _readFromPerson) final String? newEmail;
289+
@JsonKey(readValue: _readFromPerson) final bool? isActive;
289290

290291
static Object? _readFromPerson(Map<dynamic, dynamic> json, String key) {
291292
return (json['person'] as Map<String, dynamic>)[key];
@@ -319,6 +320,7 @@ class RealmUserUpdateEvent extends RealmUserEvent {
319320
this.deliveryEmail,
320321
this.customProfileField,
321322
this.newEmail,
323+
this.isActive,
322324
});
323325

324326
factory RealmUserUpdateEvent.fromJson(Map<String, dynamic> json) =>

lib/api/model/events.g.dart

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

lib/model/store.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,7 @@ class PerAccountStore extends ChangeNotifier with ChannelStore, MessageStore {
461461
if (event.isBillingAdmin != null) user.isBillingAdmin = event.isBillingAdmin!;
462462
if (event.deliveryEmail != null) user.deliveryEmail = event.deliveryEmail!.value;
463463
if (event.newEmail != null) user.email = event.newEmail!;
464+
if (event.isActive != null) user.isActive = event.isActive!;
464465
if (event.customProfileField != null) {
465466
final profileData = (user.profileData ??= {});
466467
final update = event.customProfileField!;

0 commit comments

Comments
 (0)