diff options
author | friendica <info@friendica.com> | 2012-10-04 03:23:49 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-10-04 03:23:49 -0700 |
commit | 4302134fdd2640843aa1349e95285b966d1282ab (patch) | |
tree | fafb3b0fd6834adb9b2004ecb40b9c17a6cc6df9 /mod | |
parent | ff43d62e445422a40271855dcd9933499da501fa (diff) | |
download | volse-hubzilla-4302134fdd2640843aa1349e95285b966d1282ab.tar.gz volse-hubzilla-4302134fdd2640843aa1349e95285b966d1282ab.tar.bz2 volse-hubzilla-4302134fdd2640843aa1349e95285b966d1282ab.zip |
baby steps
Diffstat (limited to 'mod')
-rw-r--r-- | mod/item.php | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/mod/item.php b/mod/item.php index 857d7ec63..4c30736c9 100644 --- a/mod/item.php +++ b/mod/item.php @@ -191,11 +191,26 @@ function item_post(&$a) { if(! $channel) { logger("mod_item: no channel."); - if(x($_REQUEST,'return')) - goaway($a->get_baseurl() . "/" . $return_path ); - killme(); + if(x($_REQUEST,'return')) + goaway($a->get_baseurl() . "/" . $return_path ); + killme(); } + $owner_xchan = null; + + $r = q("select * from xchan where xchan_hash = '%s' limit 1", + dbesc($channel['channel_hash']) + ); + if($r && count($r)) { + $owner_xchan = $r[0]; + } + else { + logger("mod_item: no owner."); + if(x($_REQUEST,'return')) + goaway($a->get_baseurl() . "/" . $return_path ); + killme(); + } + if($orig_post) { $str_group_allow = $orig_post['allow_gid']; @@ -566,14 +581,13 @@ function item_post(&$a) { if(! $parent) $datarray['parent_uri'] = $uri; - $datarray['aid'] = get_account_id(); // fixme $datarray['uid'] = $profile_uid; $datarray['type'] = $post_type; $datarray['wall'] = $wall; $datarray['gravity'] = $gravity; - $datarray['owner_xchan'] = $observer['xchan_hash']; // fixme + $datarray['owner_xchan'] = $owner_xchan['xchan_hash']; $datarray['author_xchan'] = $observer['xchan_hash']; $datarray['created'] = datetime_convert(); $datarray['edited'] = datetime_convert(); |