mirror of
https://github.com/friendica/friendica
synced 2024-11-10 07:02:54 +00:00
Merge pull request #9509 from MrPetovan/task/5616-clear-notifications-display
Set thread notifications as seen in mod/display
This commit is contained in:
commit
0031b4e18c
4 changed files with 7975 additions and 7875 deletions
|
@ -238,6 +238,10 @@ function display_content(App $a, $update = false, $update_uid = 0)
|
|||
throw new HTTPException\NotFoundException(DI::l10n()->t('The requested item doesn\'t exist or has been deleted.'));
|
||||
}
|
||||
|
||||
if (!DI::pConfig()->get(local_user(), 'system', 'detailed_notif')) {
|
||||
DBA::update('notify', ['seen' => true], ['parent' => $item['parent'], 'uid' => local_user()]);
|
||||
}
|
||||
|
||||
// We are displaying an "alternate" link if that post was public. See issue 2864
|
||||
$is_public = Item::exists(['id' => $item_id, 'private' => [Item::PUBLIC, Item::UNLISTED]]);
|
||||
if ($is_public) {
|
||||
|
|
14
mod/ping.php
14
mod/ping.php
|
@ -289,6 +289,7 @@ function ping_init(App $a)
|
|||
}
|
||||
|
||||
if (DBA::isResult($regs)) {
|
||||
if (count($regs) <= 1 || DI::pConfig()->get(local_user(), 'system', 'detailed_notif')) {
|
||||
foreach ($regs as $reg) {
|
||||
$notif = [
|
||||
'id' => 0,
|
||||
|
@ -302,6 +303,19 @@ function ping_init(App $a)
|
|||
];
|
||||
$notifs[] = $notif;
|
||||
}
|
||||
} else {
|
||||
$notif = [
|
||||
'id' => 0,
|
||||
'href' => DI::baseUrl() . '/admin/users/pending',
|
||||
'name' => $regs[0]['name'],
|
||||
'url' => $regs[0]['url'],
|
||||
'photo' => $regs[0]['micro'],
|
||||
'date' => $regs[0]['created'],
|
||||
'seen' => false,
|
||||
'message' => DI::l10n()->t('{0} and %d others requested registration', count($regs) - 1),
|
||||
];
|
||||
$notifs[] = $notif;
|
||||
}
|
||||
}
|
||||
|
||||
// sort notifications by $[]['date']
|
||||
|
|
|
@ -108,7 +108,13 @@ class Notification extends BaseModule
|
|||
|
||||
if ($request_id) {
|
||||
$notify = DI::notify()->getByID($request_id, local_user());
|
||||
|
||||
if (DI::pConfig()->get(local_user(), 'system', 'detailed_notif')) {
|
||||
$notify->seen = true;
|
||||
DI::notify()->update($notify);
|
||||
} else {
|
||||
DI::notify()->setSeen(true, $notify);
|
||||
}
|
||||
|
||||
if (!empty($notify->link)) {
|
||||
System::externalRedirect($notify->link);
|
||||
|
|
15812
view/lang/C/messages.po
15812
view/lang/C/messages.po
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue