diff options
author | Mario <mario@mariovavti.com> | 2020-03-02 09:50:11 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2020-03-02 09:50:11 +0000 |
commit | ba566fd64bbb57fb52779a3f29f30e730cab7744 (patch) | |
tree | 85ff6e77a4a0bbbdde7638055270f5a3a2b33f55 /Zotlabs/Lib/Libzot.php | |
parent | 19bb9e018152ce528846fb955b58d76f1bb6bdec (diff) | |
parent | 85c07d57fe0f468eb8cc84584f3636b590aa929f (diff) | |
download | volse-hubzilla-ba566fd64bbb57fb52779a3f29f30e730cab7744.tar.gz volse-hubzilla-ba566fd64bbb57fb52779a3f29f30e730cab7744.tar.bz2 volse-hubzilla-ba566fd64bbb57fb52779a3f29f30e730cab7744.zip |
Merge branch 'dev' into z6connect
Diffstat (limited to 'Zotlabs/Lib/Libzot.php')
-rw-r--r-- | Zotlabs/Lib/Libzot.php | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index ad00aa97a..42e706754 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -1277,7 +1277,12 @@ class Libzot { logger('Channel sync received: ' . print_r($arr,true), LOGGER_DATA, LOG_DEBUG); logger('Channel sync recipients: ' . print_r($deliveries,true), LOGGER_DATA, LOG_DEBUG); - $result = Libsync::process_channel_sync_delivery($env['sender'],$arr,$deliveries); + if ($env['encoding'] === 'hz') { + $result = Libsync::process_channel_sync_delivery($env['sender'],$arr,$deliveries); + } + else { + logger('sync packet type not supported.'); + } } } if ($result) { @@ -1608,10 +1613,11 @@ class Libzot { // As a side effect we will also do a preliminary check that we have the top-level-post, otherwise // processing it is pointless. - $r = q("select route, id, owner_xchan, item_private from item where mid = '%s' and uid = %d limit 1", + $r = q("select route, id, parent_mid, mid, owner_xchan, item_private, obj_type from item where mid = '%s' and uid = %d limit 1", dbesc($arr['parent_mid']), intval($channel['channel_id']) ); + if(! $r) { $DR->update('comment parent not found'); $result[] = $DR->get(); @@ -1634,6 +1640,16 @@ class Libzot { continue; } + if ($r[0]['obj_type'] === 'Question') { + // route checking doesn't work correctly here because we've changed the privacy + $r[0]['route'] = EMPTY_STR; + // If this is a poll response, convert the obj_type to our (internal-only) "Answer" type + if ($arr['obj_type'] === ACTIVITY_OBJ_COMMENT && $arr['title'] && (! $arr['body'])) { + $arr['obj_type'] = 'Answer'; + } + } + + if($relay || $friendofriend || (intval($r[0]['item_private']) === 0 && intval($arr['item_private']) === 0)) { // reset the route in case it travelled a great distance upstream // use our parent's route so when we go back downstream we'll match |