• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Users don't have permission to view a custom alert

Lyphiard

Active member
#1
I'm having an interesting problem with one of my addons that will send a user a custom alert. To send them an alert, I use the following code:

Code:
XenForo_Model_Alert::alert(
        $user['user_id'],
        $visitor['user_id'],
        $visitor['username'],
        'post',
        $threadId,
        'update_new',
        array('postId' => $postId)
);
Users will receive the alert (there will be the little red flag that shows they have a new alert), but as soon as they hover over the alerts button, it quickly disappears and nothing shows up.

The interesting thing is that if I edit the user's permissions and allow them to see deleted content/threads, the alert will show up for them, even if they previously were not able to see it.