Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
commit
de727b37a8
1 changed files with 4 additions and 3 deletions
|
@ -27,10 +27,11 @@ function memberEventDiff(ev) {
|
||||||
const content = ev.getContent();
|
const content = ev.getContent();
|
||||||
const prevContent = ev.getPrevContent();
|
const prevContent = ev.getPrevContent();
|
||||||
|
|
||||||
diff.isJoin = content.membership === 'join' && prevContent.membership !== 'ban';
|
const isMembershipChanged = content.membership !== prevContent.membership;
|
||||||
diff.isPart = content.membership === 'leave' && ev.getStateKey() === ev.getSender();
|
diff.isJoin = isMembershipChanged && content.membership === 'join';
|
||||||
|
diff.isPart = isMembershipChanged && content.membership === 'leave' && ev.getStateKey() === ev.getSender();
|
||||||
|
|
||||||
const isJoinToJoin = content.membership === prevContent.membership && content.membership === 'join';
|
const isJoinToJoin = !isMembershipChanged && content.membership === 'join';
|
||||||
diff.isDisplaynameChange = isJoinToJoin && content.displayname !== prevContent.displayname;
|
diff.isDisplaynameChange = isJoinToJoin && content.displayname !== prevContent.displayname;
|
||||||
diff.isAvatarChange = isJoinToJoin && content.avatar_url !== prevContent.avatar_url;
|
diff.isAvatarChange = isJoinToJoin && content.avatar_url !== prevContent.avatar_url;
|
||||||
return diff;
|
return diff;
|
||||||
|
|
Loading…
Reference in a new issue