Skip to content

Commit

Permalink
Add support for guest accounts on BreezeQuery::loadMinimalData()
Browse files Browse the repository at this point in the history
Signed-off-by: Suki <[email protected]>
  • Loading branch information
MissAllSunday committed Mar 23, 2014
1 parent 1b17d89 commit 90d8331
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/Breeze/BreezeLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ protected function logStatus($entry)
$loadedUsers = $this->_query->loadMinimalData(array_unique(array($entry['content']['owner_id'], $entry['content']['poster_id'],)));

//Posting on your own wall?
$own = $entry['content']['owner_id'] == $entry['content']['poster_id'];
$own = ($entry['content']['owner_id'] == $entry['content']['poster_id']);

// Get the right text string
$gender = !empty($loadedUsers[$entry['content']['poster_id']]['gender']) ? $loadedUsers[$entry['content']['poster_id']]['gender'] : '0';
Expand Down
13 changes: 13 additions & 0 deletions Sources/Breeze/BreezeQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -1472,6 +1472,19 @@ public function loadMinimalData($users)
}
}

// Any guest accounts?
foreach ($users as $u)
if (!isset($returnData[$u]))
$returnData[$u] = array(
'username' => $txt['guest_title'],
'name' => $txt['guest_title'],
'id' => 0,
'href' => '',
'link' => $txt['guest_title'],
'gender' => 0,
'guest' => true,
);

return $returnData;
}

Expand Down

0 comments on commit 90d8331

Please sign in to comment.