Merge branch 'MDL-65616' of git://github.com/paulholden/moodle

This commit is contained in:
Sara Arjona 2021-04-08 17:45:41 +02:00
commit fc59c4773e
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;
}