MDL-63303 message: fix bugs in message drawer part 4
* Add clarification to delete messages lang strings * Stop message polling when sending a message to fix UI bug * Publish update last message event when polling finds more messages * Remove logged in user from group conversation participants list * Use user object to fetch user preferences to reduce DB calls * Remove animated slide transitions because the browser breaks when showing some conversations
This commit is contained in:
@@ -1797,7 +1797,7 @@ class api {
|
||||
* @return int The default messaging preference.
|
||||
*/
|
||||
public static function get_user_privacy_messaging_preference(int $userid) : int {
|
||||
global $CFG;
|
||||
global $CFG, $USER;
|
||||
|
||||
// When $CFG->messagingallusers is enabled, default value for the messaging preference will be "Anyone on the site";
|
||||
// otherwise, the default value will be "My contacts and anyone in my courses".
|
||||
@@ -1806,7 +1806,12 @@ class api {
|
||||
} else {
|
||||
$defaultprefvalue = self::MESSAGE_PRIVACY_SITE;
|
||||
}
|
||||
$privacypreference = get_user_preferences('message_blocknoncontacts', $defaultprefvalue, $userid);
|
||||
if ($userid == $USER->id) {
|
||||
$user = $USER;
|
||||
} else {
|
||||
$user = $userid;
|
||||
}
|
||||
$privacypreference = get_user_preferences('message_blocknoncontacts', $defaultprefvalue, $user);
|
||||
|
||||
// When the $CFG->messagingallusers privacy setting is disabled, MESSAGE_PRIVACY_SITE is
|
||||
// also disabled, so it has to be replaced to MESSAGE_PRIVACY_COURSEMEMBER.
|
||||
|
||||
Reference in New Issue
Block a user