aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-11-03 14:59:14 -0800
committerredmatrix <redmatrix@redmatrix.me>2015-11-03 14:59:14 -0800
commit2c299a9f379b9e8af33cae4270ec1c0c5cf2bc99 (patch)
tree751c48e547ae9c9bf509fb6c2d62503b66fae5d8 /include/items.php
parentd13dae6b060ad1147426ae88791cac5970ab3b03 (diff)
downloadvolse-hubzilla-2c299a9f379b9e8af33cae4270ec1c0c5cf2bc99.tar.gz
volse-hubzilla-2c299a9f379b9e8af33cae4270ec1c0c5cf2bc99.tar.bz2
volse-hubzilla-2c299a9f379b9e8af33cae4270ec1c0c5cf2bc99.zip
implement unfollow thread
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/items.php b/include/items.php
index 4d8fce60f..3e4805212 100755
--- a/include/items.php
+++ b/include/items.php
@@ -2837,6 +2837,8 @@ function store_diaspora_comment_sig($datarray, $channel, $parent_item, $post_id,
function send_status_notifications($post_id,$item) {
$notify = false;
+ $unfollowed = false;
+
$parent = 0;
$r = q("select channel_hash from channel where channel_id = %d limit 1",
@@ -2864,6 +2866,14 @@ function send_status_notifications($post_id,$item) {
foreach($x as $xx) {
if($xx['author_xchan'] === $r[0]['channel_hash']) {
$notify = true;
+
+ // check for an unfollow thread activity - we should probably decode the obj and check the id
+ // but it will be extremely rare for this to be wrong.
+
+ if(($xx['verb'] === ACTIVITY_UNFOLLOW)
+ && ($xx['obj_type'] === ACTIVITY_OBJ_NOTE || $xx['obj_type'] === ACTIVITY_OBJ_PHOTO)
+ && ($xx['parent'] != $xx['id']))
+ $unfollowed = true;
}
if($xx['id'] == $xx['parent']) {
$parent = $xx['parent'];
@@ -2871,6 +2881,9 @@ function send_status_notifications($post_id,$item) {
}
}
+ if($unfollowed)
+ return;
+
$link = get_app()->get_baseurl() . '/display/' . $item['mid'];
$y = q("select id from notify where link = '%s' and uid = %d limit 1",