diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2022-12-07 10:56:30 +0000 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2022-12-07 10:56:30 +0000 |
| commit | e160ba5fbe83c3a52f9b2f3619b84f4fc3daa9a9 (patch) | |
| tree | 7e87be83f797c5f7c5a2c3c9b7426c91b95dedd8 /lib/modules | |
| parent | 3d8cb20aef2c55cadd38dccc3f51128d7e357ecf (diff) | |
migrate from storing last visit dates of blubber threads in config_values to...
Closes #744
Merge request studip/studip!1219
Diffstat (limited to 'lib/modules')
| -rw-r--r-- | lib/modules/Blubber.class.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/modules/Blubber.class.php b/lib/modules/Blubber.class.php index d9b5579..d2012b6 100644 --- a/lib/modules/Blubber.class.php +++ b/lib/modules/Blubber.class.php @@ -59,7 +59,11 @@ class Blubber extends CorePlugin implements StudipModule 'me' => $user_id, ]); foreach ($comments as $comment) { - if ($comment->thread->isVisibleInStream() && $comment->thread->isReadable() && ($comment->thread->getLatestActivity() > UserConfig::get($user_id)->getValue("BLUBBERTHREAD_VISITED_".$comment['thread_id']))) { + if ( + $comment->thread->isVisibleInStream() + && $comment->thread->isReadable() + && $comment->thread->getLatestActivity() > $comment->thread->getLastVisit() + ) { $icon->setImage(Icon::create('blubber', Icon::ROLE_NEW, ['title' => _('Es gibt neue Blubber')])); $icon->setTitle(_('Es gibt neue Blubber')); $icon->setBadgeNumber(count($comments)); @@ -83,7 +87,11 @@ class Blubber extends CorePlugin implements StudipModule 'me' => $GLOBALS['user']->id, ]); foreach ($threads as $thread) { - if ($thread->isVisibleInStream() && $thread->isReadable() && ($thread['mkdate'] > UserConfig::get($user_id)->getValue("BLUBBERTHREAD_VISITED_".$thread->getId()))) { + if ( + $thread->isVisibleInStream() + && $thread->isReadable() + && $thread->mkdate > $thread->getLastVisit() + ) { $icon->setImage(Icon::create('blubber', Icon::ROLE_ATTENTION, ['title' => _('Es gibt neue Blubber')])); $icon->setTitle(_('Es gibt neue Blubber')); break; |
