aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/Libzot.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-02-10 12:25:11 +0100
committerMario <mario@mariovavti.com>2020-02-10 12:25:11 +0100
commit50dbe1e62d8da44a710f1eb0f7e9d9eaf88c4084 (patch)
treea5a7646e1401b2c943d426f1198c3834f62baee6 /Zotlabs/Lib/Libzot.php
parent33be244d8a4ab62d52f7715b5f95ed293be79504 (diff)
parentbbcb237f5b996e94af37611152105b2e965ea493 (diff)
downloadvolse-hubzilla-50dbe1e62d8da44a710f1eb0f7e9d9eaf88c4084.tar.gz
volse-hubzilla-50dbe1e62d8da44a710f1eb0f7e9d9eaf88c4084.tar.bz2
volse-hubzilla-50dbe1e62d8da44a710f1eb0f7e9d9eaf88c4084.zip
Merge branch 'dev' into 'dev'
poll updates See merge request hubzilla/core!1828
Diffstat (limited to 'Zotlabs/Lib/Libzot.php')
-rw-r--r--Zotlabs/Lib/Libzot.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php
index bb70dfbf2..2776a681e 100644
--- a/Zotlabs/Lib/Libzot.php
+++ b/Zotlabs/Lib/Libzot.php
@@ -1613,7 +1613,7 @@ 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'])
);
@@ -1639,6 +1639,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_NOTE && $arr['title'] && (! $arr['content'])) {
+ $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