mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-65616 message: always notify user after sending contact request.
This commit is contained in:
parent
fc335f5ea0
commit
58501c742f
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
|
||||
* 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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user