Skip to content

Commit 6952673

Browse files
Merge pull request #8351 from MissAllSunday/allow-showing-avatars-from-hooks
2 parents 1468660 + 26dc7f4 commit 6952673

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

Sources/Profile-View.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -459,13 +459,22 @@ function ($format) use ($scripturl)
459459
else
460460
unset($alerts[$id_alert]['visible']);
461461

462+
// For developer convenience.
463+
$alert = &$alerts[$id_alert];
464+
465+
// If we loaded the sender's profile, we may as well use it.
466+
$sender_id = !empty($alert['sender_id']) ? $alert['sender_id'] : 0;
467+
if (isset($user_profile[$sender_id]))
468+
$alert['sender_name'] = $user_profile[$sender_id]['real_name'];
469+
470+
// If requested, include the sender's avatar data.
471+
if ($with_avatar && !empty($senders[$sender_id]))
472+
$alert['sender'] = $senders[$sender_id];
473+
462474
// Did a mod already take care of this one?
463475
if (!empty($alerts[$id_alert]['text']))
464476
continue;
465477

466-
// For developer convenience.
467-
$alert = &$alerts[$id_alert];
468-
469478
// The info in extra might outdated if the topic was moved, the message's subject was changed, etc.
470479
if (!empty($alert['content_data']))
471480
{
@@ -519,15 +528,6 @@ function ($format) use ($scripturl)
519528
$alert['extra']['user_name'] = $user_profile[$alert['extra']['user_id']]['real_name'];
520529
}
521530

522-
// If we loaded the sender's profile, we may as well use it.
523-
$sender_id = !empty($alert['sender_id']) ? $alert['sender_id'] : 0;
524-
if (isset($user_profile[$sender_id]))
525-
$alert['sender_name'] = $user_profile[$sender_id]['real_name'];
526-
527-
// If requested, include the sender's avatar data.
528-
if ($with_avatar && !empty($senders[$sender_id]))
529-
$alert['sender'] = $senders[$sender_id];
530-
531531
// Next, build the message strings.
532532
foreach ($formats as $msg_type => $format_info)
533533
{

0 commit comments

Comments
 (0)