test web
This commit is contained in:
parent
ad8135990d
commit
ff2de35d28
|
@ -41,7 +41,8 @@ class MatrixEvent extends StrippedStateEvent {
|
|||
unsigned = json['unsigned'] != null
|
||||
? Map<String, dynamic>.from(json['unsigned'])
|
||||
: null;
|
||||
prevContent = json['prev_content'] != null
|
||||
prevContent =
|
||||
json.containsKey('prev_content') && json['prev_content'] != null
|
||||
? Map<String, dynamic>.from(json['prev_content'])
|
||||
: null;
|
||||
redacts = json['redacts'];
|
||||
|
|
|
@ -93,7 +93,9 @@ class Event extends MatrixEvent {
|
|||
// into the unsigned block
|
||||
this.prevContent = prevContent != null && prevContent.isNotEmpty
|
||||
? prevContent
|
||||
: (unsigned != null && unsigned['prev_content'] is Map
|
||||
: (unsigned != null &&
|
||||
unsigned.containsKey('prev_content') &&
|
||||
unsigned['prev_content'] is Map
|
||||
? unsigned['prev_content']
|
||||
: null);
|
||||
this.stateKey = stateKey;
|
||||
|
@ -481,7 +483,8 @@ class Event extends MatrixEvent {
|
|||
final targetName = stateKeyUser.calcDisplayname();
|
||||
// Has the membership changed?
|
||||
final newMembership = content['membership'] ?? '';
|
||||
final oldMembership = unsigned['prev_content'] is Map<String, dynamic>
|
||||
final oldMembership = unsigned.containsKey('prev_content') &&
|
||||
unsigned['prev_content'] is Map<String, dynamic>
|
||||
? unsigned['prev_content']['membership'] ?? ''
|
||||
: '';
|
||||
if (newMembership != oldMembership) {
|
||||
|
@ -518,12 +521,13 @@ class Event extends MatrixEvent {
|
|||
}
|
||||
} else if (newMembership == 'join') {
|
||||
final newAvatar = content['avatar_url'] ?? '';
|
||||
final oldAvatar = unsigned['prev_content'] is Map<String, dynamic>
|
||||
final oldAvatar = unsigned.containsKey('prev_content') &&
|
||||
unsigned['prev_content'] is Map<String, dynamic>
|
||||
? unsigned['prev_content']['avatar_url'] ?? ''
|
||||
: '';
|
||||
|
||||
final newDisplayname = content['displayname'] ?? '';
|
||||
final oldDisplayname =
|
||||
final oldDisplayname = unsigned.containsKey('prev_content') &&
|
||||
unsigned['prev_content'] is Map<String, dynamic>
|
||||
? unsigned['prev_content']['displayname'] ?? ''
|
||||
: '';
|
||||
|
|
Loading…
Reference in a new issue