don't set dmUserId when not a DM

This commit is contained in:
Bruno Windels 2021-05-05 17:11:53 +02:00
parent 7defd4a02b
commit 45837f7377

View file

@ -183,10 +183,11 @@ function applyInvite(data, invite) {
if (data.isDirectMessage !== invite.isDirectMessage) { if (data.isDirectMessage !== invite.isDirectMessage) {
data = data.cloneIfNeeded(); data = data.cloneIfNeeded();
data.isDirectMessage = invite.isDirectMessage; data.isDirectMessage = invite.isDirectMessage;
} if (invite.isDirectMessage) {
if (data.dmUserId !== invite.inviter?.userId) { data.dmUserId = invite.inviter?.userId;
data = data.cloneIfNeeded(); } else {
data.dmUserId = invite.inviter?.userId; data.dmUserId = null;
}
} }
return data; return data;
} }