From 828cec27dd34477a8fcd3b4fb6f6ff1c54cf1c75 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Wed, 27 Jan 2016 10:44:15 +0100 Subject: [PATCH] Do not notify on "likes" - update only OStatus contacts --- include/ostatus.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/include/ostatus.php b/include/ostatus.php index b127d41e41..4ccd13130d 100644 --- a/include/ostatus.php +++ b/include/ostatus.php @@ -176,10 +176,13 @@ function ostatus_fetchauthor($xpath, $context, $importer, &$contact, $onlyfetch) dbesc(datetime_convert()), intval($contact["id"]), dbesc(NETWORK_OSTATUS)); } - /// @todo Add the "addr" field - $contact["generation"] = 2; - $contact["photo"] = $author["author-avatar"]; - update_gcontact($contact); + // Only update the global contact if it is an OStatus contact + if ($contact["network"] == NETWORK_OSTATUS) { + /// @todo Add the "addr" field + $contact["generation"] = 2; + $contact["photo"] = $author["author-avatar"]; + update_gcontact($contact); + } } return($author); @@ -560,7 +563,7 @@ function ostatus_import($xml,$importer,&$contact, &$hub) { logger("Item was stored with id ".$item_id, LOGGER_DEBUG); $item["id"] = $item_id; - if ($mention) { + if ($mention AND in_array($item["verb"], array(ACTIVITY_POST, ACTIVITY_SHARE))) { $u = q("SELECT `notify-flags`, `language`, `username`, `email` FROM user WHERE uid = %d LIMIT 1", intval($item['uid'])); $r = q("SELECT `parent` FROM `item` WHERE `id` = %d", intval($item_id));