Skip to content

Commit

Permalink
Merge pull request #7881 from Sesquipedalian/misc_notification_fixes
Browse files Browse the repository at this point in the history
Misc notification fixes
  • Loading branch information
Sesquipedalian authored Nov 13, 2023
2 parents 1423041 + 09e2ac1 commit 99b5e15
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Sources/Actions/Notify.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public function execute(): void
public static function getNotifyPrefs($members, $prefs = '', $process_default = false)
{
// We want this as an array whether it is or not.
$members = is_array($members) ? $members : (array) $members;
$members = array_map('intval', (array) $members);

if (!empty($prefs))
$prefs = is_array($prefs) ? $prefs : (array) $prefs;
Expand Down
2 changes: 0 additions & 2 deletions Sources/Actions/Profile/ShowAlerts.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ class ShowAlerts implements ActionInterface
*/
public function execute(): void
{
require_once(Config::$sourcedir . '/Actions/Profile/Modify.php');

// Are we opening a specific alert? (i.e.: ?action=profile;area=showalerts;alert=12345)
if (!empty($_REQUEST['alert']))
{
Expand Down
2 changes: 1 addition & 1 deletion Sources/Alert.php
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ public static function createBatch(array $props_batch = array()): array
$possible_topics = array();

// First, weed out any alerts that wouldn't be visible.
foreach ($props_batch as $props)
foreach ($props_batch as &$props)
{
$members[] = $props['id_member'];

Expand Down
4 changes: 2 additions & 2 deletions Sources/tasks/EventNew_Notify.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function execute()

// Don't alert the event creator
if (!empty($this->_details['sender_id']))
$members = array_diff($members, array($this->_details['sender_id']));
$members = array_diff($members, $this->_details['sender_id']);

// Having successfully figured this out, now let's get the preferences of everyone.
$prefs = Notify::getNotifyPrefs($members, 'event_new', true);
Expand Down Expand Up @@ -85,7 +85,7 @@ public function execute()
'content_id' => $this->_details['event_id'],
'content_action' => empty($this->_details['sender_id']) ? 'new_guest' : 'new',
'is_read' => 0,
'extra' => Db::$db->smcFunc['json_encode'](
'extra' => Utils::jsonEncode(
array(
"event_id" => $this->_details['event_id'],
"event_title" => $this->_details['event_title']
Expand Down

0 comments on commit 99b5e15

Please sign in to comment.