XF 2.3 Automatic Watching of Threads with Notifications

mjda

Well-known member
I'm trying to make it so that specific users are set to automatically "Watch" a specific thread. The watch record works using this:

PHP:
$this->getWatchRepo()->setWatchState($thread, $visitor, 'watch_no_email');

When I visit the thread, I do only have the option to "Unwatch". However, I don't get notifications on replies until I actually view the thread first. How can I make it so that I'm instantly able to get notifications when new posts are added to the thread without me having to view it for the first time?

I've tried this:

PHP:
$this->getThreadRepo()->markThreadReadByUser($thread, $visitor);

...and this...

PHP:
$alertRepo->markUserAlertsReadForContent('thread', $thread->thread_id);

...but neither of those things make a difference.
 
Back
Top Bottom