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) {
data = data.cloneIfNeeded();
data.isDirectMessage = invite.isDirectMessage;
}
if (data.dmUserId !== invite.inviter?.userId) {
data = data.cloneIfNeeded();
data.dmUserId = invite.inviter?.userId;
if (invite.isDirectMessage) {
data.dmUserId = invite.inviter?.userId;
} else {
data.dmUserId = null;
}
}
return data;
}