Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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