Merge pull request #6940 from annando/fix-notif

Notifications do work now again
This commit is contained in:
Philipp 2019-03-26 23:26:10 +01:00 committed by GitHub
commit 2d522f872d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -199,13 +199,13 @@ class ForumManager
$stmtContacts = DBA::p(
"SELECT `contact`.`id`, `contact`.`name`, COUNT(*) AS `count` FROM `item`
INNER JOIN `contact` ON `item`.`contact-id` = `contact`.`id`
WHERE `item`.`uid` = %d AND `item`.`visible` AND NOT `item`.`deleted` AND `item`.`unseen`
WHERE `item`.`uid` = ? AND `item`.`visible` AND NOT `item`.`deleted` AND `item`.`unseen`
AND `contact`.`network`= 'dfrn' AND (`contact`.`forum` OR `contact`.`prv`)
AND NOT `contact`.`blocked` AND NOT `contact`.`hidden`
AND NOT `contact`.`pending` AND NOT `contact`.`archive`
AND `contact`.`success_update` > `failure_update`
GROUP BY `contact`.`id` ",
intval(local_user())
local_user()
);
return DBA::toArray($stmtContacts);

View File

@ -563,7 +563,7 @@ class NotificationsManager extends BaseObject
$sql_extra = "";
if (!$all) {
$sql_extra = " AND `ignore` = 0 ";
$sql_extra = " AND NOT `ignore` ";
}
/// @todo Fetch contact details by "Contact::getDetailsByUrl" instead of queries to contact, fcontact and gcontact
@ -578,11 +578,11 @@ class NotificationsManager extends BaseObject
LEFT JOIN `contact` ON `contact`.`id` = `intro`.`contact-id`
LEFT JOIN `gcontact` ON `gcontact`.`nurl` = `contact`.`nurl`
LEFT JOIN `fcontact` ON `intro`.`fid` = `fcontact`.`id`
WHERE `intro`.`uid` = %d $sql_extra AND `intro`.`blocked` = 0
LIMIT %d, %d",
intval($_SESSION['uid']),
intval($start),
intval($limit)
WHERE `intro`.`uid` = ? $sql_extra AND `intro`.`blocked` = 0
LIMIT ?, ?",
$_SESSION['uid'],
$start,
$limit
);
if (DBA::isResult($stmtNotifies)) {
$notifs = $this->formatIntros(DBA::toArray($stmtNotifies));