aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-06-25 18:30:22 -0700
committerzotlabs <mike@macgirvin.com>2017-06-25 18:30:22 -0700
commitef53db0b91c09c0446a706222dd4922520b008ef (patch)
treeddd7aa7f781aea7ce33eeba82e962c09457ed868
parent21542d1f9e66638ff9b4012a63a0070d1abe652a (diff)
downloadvolse-hubzilla-ef53db0b91c09c0446a706222dd4922520b008ef.tar.gz
volse-hubzilla-ef53db0b91c09c0446a706222dd4922520b008ef.tar.bz2
volse-hubzilla-ef53db0b91c09c0446a706222dd4922520b008ef.zip
allow poke by xchan_hash
-rw-r--r--Zotlabs/Module/Poke.php30
1 files changed, 21 insertions, 9 deletions
diff --git a/Zotlabs/Module/Poke.php b/Zotlabs/Module/Poke.php
index cf8d83023..ea50e821a 100644
--- a/Zotlabs/Module/Poke.php
+++ b/Zotlabs/Module/Poke.php
@@ -41,7 +41,10 @@ class Poke extends \Zotlabs\Web\Controller {
$activity = ACTIVITY_POKE . '#' . urlencode($verbs[$verb][0]);
$contact_id = intval($_REQUEST['cid']);
- if(! $contact_id)
+
+ $xchan = trim($_REQUEST['xchan']);
+
+ if(! ($contact_id || $xchan))
return;
$parent = ((x($_REQUEST,'parent')) ? intval($_REQUEST['parent']) : 0);
@@ -49,13 +52,20 @@ class Poke extends \Zotlabs\Web\Controller {
logger('poke: verb ' . $verb . ' contact ' . $contact_id, LOGGER_DEBUG);
- $r = q("SELECT * FROM abook left join xchan on xchan_hash = abook_xchan where abook_id = %d and abook_channel = %d LIMIT 1",
- intval($contact_id),
- intval($uid)
- );
-
+ if($contact_id) {
+ $r = q("SELECT * FROM abook left join xchan on xchan_hash = abook_xchan where abook_id = %d and abook_channel = %d LIMIT 1",
+ intval($contact_id),
+ intval($uid)
+ );
+ }
+ if($xchan) {
+ $r = q("SELECT * FROM xchan where xchan_hash like ( '%s' ) LIMIT 1",
+ dbesc($xchan . '%')
+ );
+ }
+
if(! $r) {
- logger('poke: no target ' . $contact_id);
+ logger('poke: no target.');
return;
}
@@ -79,7 +89,7 @@ class Poke extends \Zotlabs\Web\Controller {
$deny_gid = $r[0]['deny_gid'];
}
}
- else {
+ elseif($contact_id) {
$item_private = ((x($_GET,'private')) ? intval($_GET['private']) : 0);
@@ -92,9 +102,11 @@ class Poke extends \Zotlabs\Web\Controller {
$arr = array();
+
+
$arr['item_wall'] = 1;
$arr['owner_xchan'] = (($parent_item) ? $parent_item['owner_xchan'] : $channel['channel_hash']);
- $arr['parent_mid'] = (($parent_mid) ? $parent_mid : $mid);
+ $arr['parent_mid'] = (($parent_mid) ? $parent_mid : '');
$arr['title'] = '';
$arr['allow_cid'] = $allow_cid;
$arr['allow_gid'] = $allow_gid;