From 6e46987515fc36210e58c080cc4c4348a935b2f5 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 20 Dec 2016 07:10:47 +0000 Subject: [PATCH 1/2] The object type "photo" is deprecated and was replaced by "image" --- include/diaspora.php | 2 +- include/like.php | 2 +- mod/photos.php | 4 ++-- mod/subthread.php | 2 +- mod/tagger.php | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/diaspora.php b/include/diaspora.php index f2d4848678..09dff5cfab 100644 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -2290,7 +2290,7 @@ class diaspora { $body = "[img]".unxmlify($photo->remote_photo_path). unxmlify($photo->remote_photo_name)."[/img]\n".$body; - $datarray["object-type"] = ACTIVITY_OBJ_PHOTO; + $datarray["object-type"] = ACTIVITY_OBJ_IMAGE; } else { $datarray["object-type"] = ACTIVITY_OBJ_NOTE; diff --git a/include/like.php b/include/like.php index 118ec81ca1..e5c1867b44 100644 --- a/include/like.php +++ b/include/like.php @@ -163,7 +163,7 @@ function do_like($item_id, $verb) { $post_type = (($item['resource-id']) ? t('photo') : t('status')); if($item['object-type'] === ACTIVITY_OBJ_EVENT) $post_type = t('event'); - $objtype = (($item['resource-id']) ? ACTIVITY_OBJ_PHOTO : ACTIVITY_OBJ_NOTE ); + $objtype = (($item['resource-id']) ? ACTIVITY_OBJ_IMAGE : ACTIVITY_OBJ_NOTE ); $link = xmlify('' . "\n") ; $body = $item['body']; diff --git a/mod/photos.php b/mod/photos.php index d72a824827..6d3ab28465 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -681,7 +681,7 @@ function photos_post(&$a) { $arr['visible'] = 1; $arr['verb'] = ACTIVITY_TAG; $arr['object-type'] = ACTIVITY_OBJ_PERSON; - $arr['target-type'] = ACTIVITY_OBJ_PHOTO; + $arr['target-type'] = ACTIVITY_OBJ_IMAGE; $arr['tag'] = $tagged[4]; $arr['inform'] = $tagged[2]; $arr['origin'] = 1; @@ -694,7 +694,7 @@ function photos_post(&$a) { $arr['object'] .= xmlify('' . "\n"); $arr['object'] .= '' . "\n"; - $arr['target'] = '' . ACTIVITY_OBJ_PHOTO . '' . $p[0]['desc'] . '' + $arr['target'] = '' . ACTIVITY_OBJ_IMAGE . '' . $p[0]['desc'] . '' . $a->get_baseurl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . ''; $arr['target'] .= '' . xmlify('' . "\n" . '') . ''; diff --git a/mod/subthread.php b/mod/subthread.php index 33cf7489c1..d983903627 100644 --- a/mod/subthread.php +++ b/mod/subthread.php @@ -85,7 +85,7 @@ function subthread_content(&$a) { $uri = item_new_uri($a->get_hostname(),$owner_uid); $post_type = (($item['resource-id']) ? t('photo') : t('status')); - $objtype = (($item['resource-id']) ? ACTIVITY_OBJ_PHOTO : ACTIVITY_OBJ_NOTE ); + $objtype = (($item['resource-id']) ? ACTIVITY_OBJ_IMAGE : ACTIVITY_OBJ_NOTE ); $link = xmlify('' . "\n") ; $body = $item['body']; diff --git a/mod/tagger.php b/mod/tagger.php index e0ef1ceb02..57f53d5dc7 100644 --- a/mod/tagger.php +++ b/mod/tagger.php @@ -60,7 +60,7 @@ function tagger_content(&$a) { $uri = item_new_uri($a->get_hostname(),$owner_uid); $xterm = xmlify($term); $post_type = (($item['resource-id']) ? t('photo') : t('status')); - $targettype = (($item['resource-id']) ? ACTIVITY_OBJ_PHOTO : ACTIVITY_OBJ_NOTE ); + $targettype = (($item['resource-id']) ? ACTIVITY_OBJ_IMAGE : ACTIVITY_OBJ_NOTE ); $link = xmlify('' . "\n") ; From 4c77ae2fe903bf15d6a41fb3ff802036c08a82c7 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 20 Dec 2016 07:13:22 +0000 Subject: [PATCH 2/2] Only distribute items to active contacts --- include/notifier.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/notifier.php b/include/notifier.php index 812752a55c..58240557bb 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -575,7 +575,7 @@ function notifier_run(&$argv, &$argc){ $r0 = array(); $r1 = q("SELECT DISTINCT(`batch`), `id`, `name`,`network` FROM `contact` WHERE `network` = '%s' - AND `uid` = %d AND `rel` != %d group by `batch` ORDER BY rand() ", + AND `uid` = %d AND `rel` != %d AND NOT `blocked` AND NOT `pending` AND NOT `archive` GROUP BY `batch` ORDER BY rand()", dbesc(NETWORK_DIASPORA), intval($owner['uid']), intval(CONTACT_IS_SHARING)