MDL-65616 message: always notify user after sending contact request.

This commit is contained in:
Paul Holden 2021-02-15 22:27:19 +00:00
parent fc335f5ea0
commit 58501c742f
3 changed files with 4 additions and 11 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1310,10 +1310,7 @@ function(
/**
* We should show the contact request sent message if the user just sent
* a contact request to the other user and there are no messages in the
* conversation.
*
* The messages should be hidden when there are messages in the conversation.
* a contact request to the other user
*
* @param {Object} state The current state.
* @param {Object} newState The new state.
@ -1331,18 +1328,14 @@ function(
});
var oldRequest = oldSentRequests.length > 0;
var newRequest = newSentRequests.length > 0;
var hadMessages = state.messages.length > 0;
var hasMessages = state.messages.length > 0;
if (!oldRequest && newRequest && !newOtherUser.iscontact && !hasMessages) {
if (!oldRequest && newRequest && !newOtherUser.iscontact) {
return newOtherUser.fullname;
} else if (oldOtherUser && !oldOtherUser.iscontact && newRequest && newOtherUser.iscontact) {
// Contact request accepted.
return false;
} else if (oldRequest && !newRequest) {
return false;
} else if (!hadMessages && hasMessages) {
return false;
} else {
return null;
}