diff options
author | friendica <info@friendica.com> | 2014-03-29 21:53:50 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-03-29 21:53:50 -0700 |
commit | 1108eaaed0cf451668dcaf04bd532a3615724dbc (patch) | |
tree | b84e577d0f5487d33f3a7066007aa3e7ecdffb21 /include/items.php | |
parent | a31d5c7cddf8674478b9537c206fba05adf30652 (diff) | |
download | volse-hubzilla-1108eaaed0cf451668dcaf04bd532a3615724dbc.tar.gz volse-hubzilla-1108eaaed0cf451668dcaf04bd532a3615724dbc.tar.bz2 volse-hubzilla-1108eaaed0cf451668dcaf04bd532a3615724dbc.zip |
source routing stuff
Diffstat (limited to 'include/items.php')
-rwxr-xr-x | include/items.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/include/items.php b/include/items.php index dcf9f5bc2..71e89e1e2 100755 --- a/include/items.php +++ b/include/items.php @@ -81,6 +81,18 @@ function collect_recipients($item,&$private) { $recipients = check_list_permissions($item['uid'],$recipients,'view_stream'); + $routes = q("select * from route where iid = %d", + intval($item['id']) + ); + + if($routes) { + $route = explode(',',$routes[0]['route']); + if(count($route)) { + $route = array_unique($route); + $recipients = array_diff($recipients,$route); + } + } + // add ourself just in case we have nomadic clones that need to get a copy. $recipients[] = $item['author_xchan']; @@ -141,6 +153,28 @@ function can_comment_on_post($observer_xchan,$item) { } +function add_source_route($iid,$hash) { + if((! $iid) || (! $route)) + return; + $r = q("select * from route where iid = %d limit 1", + intval($iid) + ); + if($r && $r[0]['route']) { + q("update route set route = '%s' where iid = %d limit 1", + dbesc(',' . $hash), + intval($iid) + ); + } + else { + q("insert into route ( iid, route ) values ( %d, '%s') ", + intval($iid), + dbesc($route) + ); + } +} + + + /** * @function red_zrl_callback * preg_match function when fixing 'naked' links in mod item.php |