Skip to content

Commit 7881b62

Browse files
committed
Allow logs to be hidden from recent changes
1 parent 9f3aa5d commit 7881b62

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

Avatar_body.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static function getAvatar(\User $user, $res) {
5858

5959
public static function hasAvatar(\User $user) {
6060
global $wgDefaultAvatar;
61-
return self::getAvatar($user, 'original') !== $wgDefaultAvatar;
61+
return self::getAvatar($user, 'original') !== null;
6262
}
6363

6464
public static function deleteAvatar(\User $user) {
@@ -75,4 +75,4 @@ public static function deleteAvatar(\User $user) {
7575
return true;
7676
}
7777

78-
}
78+
}

SpecialUpload.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,13 @@ private function processUpload() {
9999

100100
$this->displayMessage($this->msg('avatar-saved'));
101101

102+
global $wgAvatarLogInRC;
103+
102104
$logEntry = new \ManualLogEntry('avatar', 'upload');
103105
$logEntry->setPerformer($this->getUser());
104106
$logEntry->setTarget($this->getUser()->getUserPage());
105107
$logId = $logEntry->insert();
106-
$logEntry->publish($logId, 'rcandudp');
108+
$logEntry->publish($logId, $wgAvatarLogInRC ? 'rcandudp' : 'udp');
107109

108110
return true;
109111
}

SpecialView.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,14 @@ public function execute($par) {
4040
// Delete avatar if the user exists
4141
if ($userExists) {
4242
if (Avatars::deleteAvatar($userObj)) {
43+
global $wgAvatarLogInRC;
44+
4345
$logEntry = new \ManualLogEntry('avatar', 'delete');
4446
$logEntry->setPerformer($this->getUser());
4547
$logEntry->setTarget($userObj->getUserPage());
4648
$logEntry->setComment($opt->getValue('reason'));
4749
$logId = $logEntry->insert();
48-
$logEntry->publish($logId, 'rcandudp');
50+
$logEntry->publish($logId, $wgAvatarLogInRC ? 'rcandudp' : 'udp');
4951
}
5052
}
5153
}
@@ -58,7 +60,7 @@ public function execute($par) {
5860

5961
if ($haveAvatar) {
6062
$html = \Xml::tags('img', array(
61-
'src' => Avatars::getLinkFor($user, 'original'),
63+
'src' => Avatars::getLinkFor($user, 'original') . '&nocache&ver=' . dechex(time()),
6264
'height' => 400,
6365
), '');
6466
$html = \Xml::tags('p', array(), $html);
@@ -133,4 +135,4 @@ private function showDeleteForm($user) {
133135

134136
$this->getOutput()->addHTML($html);
135137
}
136-
}
138+
}

extension.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@
8080
"DefaultAvatarRes": 128,
8181
"UseAvatar": true,
8282
"VersionAvatar": false,
83-
"AvatarServingMethod": "redirect"
83+
"AvatarServingMethod": "redirect",
84+
"AvatarLogInRC": true
8485
},
8586
"manifest_version": 1
8687
}

0 commit comments

Comments
 (0)