Skip to content

Commit ecf2c1c

Browse files
committed
Merge pull request #2431 from owlhooter/master
Add Anonymous check for blockfinder email
2 parents 9336608 + d1d392a commit ecf2c1c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

cronjobs/findblock.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,12 @@
157157
// Notify users
158158
$aAccounts = $notification->getNotificationAccountIdByType('new_block');
159159
if (is_array($aAccounts)) {
160-
161-
$finder = $user->getUserName($iAccountId);
160+
if ($user->getUserNameAnon($iAccountId) == 1) {
161+
$finder = "Anonymous";
162+
} else {
163+
$finder = $user->getUserName($iAccountId);
164+
}
165+
162166
foreach ($aAccounts as $aData) {
163167
$aMailData['height'] = $aBlock['height'];
164168
$aMailData['subject'] = 'New Block';

include/classes/user.class.php

+3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ private function getHash($string, $version=0, $pepper='') {
3131
public function getUserName($id) {
3232
return $this->getSingle($id, 'username', 'id');
3333
}
34+
public function getUserNameAnon($id) {
35+
return $this->getSingle($id, 'is_anonymous', 'id');
36+
}
3437
public function getUserNameByEmail($email) {
3538
return $this->getSingle($email, 'username', 'email', 's');
3639
}

0 commit comments

Comments
 (0)