Skip to content

Commit

Permalink
Merge pull request #8351 from MissAllSunday/allow-showing-avatars-fro…
Browse files Browse the repository at this point in the history
…m-hooks
  • Loading branch information
Sesquipedalian authored Dec 4, 2024
2 parents 1468660 + 26dc7f4 commit 6952673
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions Sources/Profile-View.php
Original file line number Diff line number Diff line change
Expand Up @@ -459,13 +459,22 @@ function ($format) use ($scripturl)
else
unset($alerts[$id_alert]['visible']);

// For developer convenience.
$alert = &$alerts[$id_alert];

// If we loaded the sender's profile, we may as well use it.
$sender_id = !empty($alert['sender_id']) ? $alert['sender_id'] : 0;
if (isset($user_profile[$sender_id]))
$alert['sender_name'] = $user_profile[$sender_id]['real_name'];

// If requested, include the sender's avatar data.
if ($with_avatar && !empty($senders[$sender_id]))
$alert['sender'] = $senders[$sender_id];

// Did a mod already take care of this one?
if (!empty($alerts[$id_alert]['text']))
continue;

// For developer convenience.
$alert = &$alerts[$id_alert];

// The info in extra might outdated if the topic was moved, the message's subject was changed, etc.
if (!empty($alert['content_data']))
{
Expand Down Expand Up @@ -519,15 +528,6 @@ function ($format) use ($scripturl)
$alert['extra']['user_name'] = $user_profile[$alert['extra']['user_id']]['real_name'];
}

// If we loaded the sender's profile, we may as well use it.
$sender_id = !empty($alert['sender_id']) ? $alert['sender_id'] : 0;
if (isset($user_profile[$sender_id]))
$alert['sender_name'] = $user_profile[$sender_id]['real_name'];

// If requested, include the sender's avatar data.
if ($with_avatar && !empty($senders[$sender_id]))
$alert['sender'] = $senders[$sender_id];

// Next, build the message strings.
foreach ($formats as $msg_type => $format_info)
{
Expand Down

0 comments on commit 6952673

Please sign in to comment.