mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Merge branch 'MDL-65616' of git://github.com/paulholden/moodle
This commit is contained in:
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
|
@ -1310,10 +1310,7 @@ function(
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We should show the contact request sent message if the user just sent
|
* 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
|
* a contact request to the other user
|
||||||
* conversation.
|
|
||||||
*
|
|
||||||
* The messages should be hidden when there are messages in the conversation.
|
|
||||||
*
|
*
|
||||||
* @param {Object} state The current state.
|
* @param {Object} state The current state.
|
||||||
* @param {Object} newState The new state.
|
* @param {Object} newState The new state.
|
||||||
|
@ -1331,18 +1328,14 @@ function(
|
||||||
});
|
});
|
||||||
var oldRequest = oldSentRequests.length > 0;
|
var oldRequest = oldSentRequests.length > 0;
|
||||||
var newRequest = newSentRequests.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;
|
return newOtherUser.fullname;
|
||||||
} else if (oldOtherUser && !oldOtherUser.iscontact && newRequest && newOtherUser.iscontact) {
|
} else if (oldOtherUser && !oldOtherUser.iscontact && newRequest && newOtherUser.iscontact) {
|
||||||
// Contact request accepted.
|
// Contact request accepted.
|
||||||
return false;
|
return false;
|
||||||
} else if (oldRequest && !newRequest) {
|
} else if (oldRequest && !newRequest) {
|
||||||
return false;
|
return false;
|
||||||
} else if (!hadMessages && hasMessages) {
|
|
||||||
return false;
|
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue