Merge pull request #10722 from MrPetovan/task/refactor-notifications

Move notify, notifications and introduction notifications to new paradigm
This commit is contained in:
Michael Vogel 2021-10-03 14:13:28 +02:00 committed by GitHub
commit 3d97149007
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
57 changed files with 2452 additions and 1948 deletions

View file

@ -222,8 +222,8 @@ function display_content(App $a, $update = false, $update_uid = 0)
}
if (!DI::pConfig()->get(local_user(), 'system', 'detailed_notif')) {
DBA::update('notification', ['seen' => true], ['parent-uri-id' => $item['parent-uri-id'], 'uid' => local_user()]);
DBA::update('notify', ['seen' => true], ['parent-uri-id' => $item['parent-uri-id'], 'uid' => local_user()]);
DI::notification()->setAllSeenForUser(local_user(), ['parent-uri-id' => $item['parent-uri-id']]);
DI::notify()->setAllSeenForUser(local_user(), ['parent-uri-id' => $item['parent-uri-id']]);
}
// We are displaying an "alternate" link if that post was public. See issue 2864

View file

@ -445,7 +445,7 @@ function ping_get_notifications($uid)
$notification["message"] = $notification["msg_cache"];
} else {
$notification["name"] = strip_tags(BBCode::convert($notification["name"]));
$notification["message"] = Notification::formatMessage($notification["name"], strip_tags(BBCode::convert($notification["msg"])));
$notification["message"] = \Friendica\Navigation\Notifications\Entity\Notify::formatMessage($notification["name"], BBCode::toPlaintext($notification["msg"]));
q(
"UPDATE `notify` SET `name_cache` = '%s', `msg_cache` = '%s' WHERE `id` = %d",