Don't display ignored pending contacts, link to contact request page

This commit is contained in:
Michael 2019-09-09 05:29:33 +00:00
parent 591ba9c68e
commit 2dbd843ed2
4 changed files with 29 additions and 17 deletions

View file

@ -549,6 +549,7 @@ class NotificationsManager extends BaseObject
* which aren't marked as ignored
* @param int $start Start the query at this point
* @param int $limit Maximum number of query results
* @param int $id When set, only the introduction with this id is displayed
*
* @return array with
* string 'ident' => Notification identifier
@ -556,14 +557,20 @@ class NotificationsManager extends BaseObject
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
public function introNotifs($all = false, $start = 0, $limit = 80)
public function introNotifs($all = false, $start = 0, $limit = 80, $id = 0)
{
$ident = 'introductions';
$notifs = [];
$sql_extra = "";
if (!$all) {
$sql_extra = " AND NOT `ignore` ";
if (empty($id)) {
if (!$all) {
$sql_extra = " AND NOT `ignore` ";
}
$sql_extra .= " AND NOT `intro`.`blocked` ";
} else {
$sql_extra = sprintf(" AND `intro`.`id` = %d ", intval($id));
}
/// @todo Fetch contact details by "Contact::getDetailsByUrl" instead of queries to contact, fcontact and gcontact
@ -578,7 +585,7 @@ 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` = ? $sql_extra AND `intro`.`blocked` = 0
WHERE `intro`.`uid` = ? $sql_extra
LIMIT ?, ?",
$_SESSION['uid'],
$start,