operation snakebite, cont.
This commit is contained in:
parent
ccef9e5636
commit
62b2fa6ac7
@ -727,6 +727,16 @@ require_once('include/items.php');
|
|||||||
else
|
else
|
||||||
$_REQUEST['parent_mid'] = $parent;
|
$_REQUEST['parent_mid'] = $parent;
|
||||||
|
|
||||||
|
if($_REQUEST['namespace'] && $parent) {
|
||||||
|
$x = q("select iid from item_id where service = '%s' and sid = '%s' limit 1",
|
||||||
|
dbesc($_REQUEST['namespace']),
|
||||||
|
dbesc($parent)
|
||||||
|
);
|
||||||
|
if($x) {
|
||||||
|
$_REQUEST['parent'] = $x[0]['iid'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(requestdata('lat') && requestdata('long'))
|
if(requestdata('lat') && requestdata('long'))
|
||||||
$_REQUEST['coord'] = sprintf("%s %s",requestdata('lat'),requestdata('long'));
|
$_REQUEST['coord'] = sprintf("%s %s",requestdata('lat'),requestdata('long'));
|
||||||
|
|
||||||
|
@ -256,12 +256,12 @@ function xchan_fetch($arr) {
|
|||||||
if(! $key)
|
if(! $key)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
$r = q("select * from xchan where $key = '$v'");
|
$r = q("select * from xchan where $key = '$v' limit 1");
|
||||||
if(! $r)
|
if(! $r)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
$ret = array();
|
$ret = array();
|
||||||
foreach($r as $k => $v) {
|
foreach($r[0] as $k => $v) {
|
||||||
if($k === 'xchan_addr')
|
if($k === 'xchan_addr')
|
||||||
$ret['address'] = $v;
|
$ret['address'] = $v;
|
||||||
else
|
else
|
||||||
|
27
mod/item.php
27
mod/item.php
@ -35,6 +35,23 @@ function item_post(&$a) {
|
|||||||
$channel = null;
|
$channel = null;
|
||||||
$observer = null;
|
$observer = null;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is this a reply to something?
|
||||||
|
*/
|
||||||
|
|
||||||
|
$parent = ((x($_REQUEST,'parent')) ? intval($_REQUEST['parent']) : 0);
|
||||||
|
$parent_mid = ((x($_REQUEST,'parent_mid')) ? trim($_REQUEST['parent_mid']) : '');
|
||||||
|
|
||||||
|
$remote_xchan = ((x($_REQUEST,'remote_xchan')) ? trim($_REQUEST['remote_xchan']) : false);
|
||||||
|
$r = q("select * from xchan where xchan_hash = '%s' limit 1",
|
||||||
|
dbesc($remote_xchan)
|
||||||
|
);
|
||||||
|
if($r)
|
||||||
|
$remote_observer = $r[0];
|
||||||
|
else
|
||||||
|
$remote_xchan = $remote_observer = false;
|
||||||
|
|
||||||
$profile_uid = ((x($_REQUEST,'profile_uid')) ? intval($_REQUEST['profile_uid']) : 0);
|
$profile_uid = ((x($_REQUEST,'profile_uid')) ? intval($_REQUEST['profile_uid']) : 0);
|
||||||
require_once('include/identity.php');
|
require_once('include/identity.php');
|
||||||
$sys = get_sys_channel();
|
$sys = get_sys_channel();
|
||||||
@ -116,13 +133,6 @@ function item_post(&$a) {
|
|||||||
|
|
||||||
$item_flags = $item_restrict = 0;
|
$item_flags = $item_restrict = 0;
|
||||||
|
|
||||||
/**
|
|
||||||
* Is this a reply to something?
|
|
||||||
*/
|
|
||||||
|
|
||||||
$parent = ((x($_REQUEST,'parent')) ? intval($_REQUEST['parent']) : 0);
|
|
||||||
$parent_mid = ((x($_REQUEST,'parent_mid')) ? trim($_REQUEST['parent_mid']) : '');
|
|
||||||
|
|
||||||
$route = '';
|
$route = '';
|
||||||
$parent_item = null;
|
$parent_item = null;
|
||||||
$parent_contact = null;
|
$parent_contact = null;
|
||||||
@ -275,6 +285,9 @@ function item_post(&$a) {
|
|||||||
$walltowall = false;
|
$walltowall = false;
|
||||||
$walltowall_comment = false;
|
$walltowall_comment = false;
|
||||||
|
|
||||||
|
if($remote_xchan)
|
||||||
|
$observer = $remote_observer;
|
||||||
|
|
||||||
if($observer) {
|
if($observer) {
|
||||||
logger('mod_item: post accepted from ' . $observer['xchan_name'] . ' for ' . $owner_xchan['xchan_name'], LOGGER_DEBUG);
|
logger('mod_item: post accepted from ' . $observer['xchan_name'] . ' for ' . $owner_xchan['xchan_name'], LOGGER_DEBUG);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user