aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/help.php9
-rwxr-xr-xinclude/items.php20
2 files changed, 27 insertions, 2 deletions
diff --git a/include/help.php b/include/help.php
index 7f57f3334..4bcc09670 100644
--- a/include/help.php
+++ b/include/help.php
@@ -40,8 +40,13 @@ function search_doc_files($s) {
$r = fetch_post_tags($r,true);
for($x = 0; $x < count($r); $x ++) {
-
- $r[$x]['text'] = $r[$x]['body'];
+ $position = stripos($r[$x]['body'], $s);
+ $dislen = 300;
+ $start = $position-floor($dislen/2);
+ if ( $start < 0) {
+ $start = 0;
+ }
+ $r[$x]['text'] = substr($r[$x]['body'], $start, $dislen);
$r[$x]['rank'] = 0;
if($r[$x]['term']) {
diff --git a/include/items.php b/include/items.php
index ac746c189..53a7b7927 100755
--- a/include/items.php
+++ b/include/items.php
@@ -113,6 +113,26 @@ function collect_recipients($item, &$private_envelope) {
// if($policy === 'pub')
// $recipients[] = $sys['xchan_hash'];
}
+
+ // Add the authors of any posts in this thread, if they are known to us.
+ // This is specifically designed to forward wall-to-wall posts to the original author,
+ // in case they aren't a connection but have permission to write on our wall.
+ // This is important for issue tracker channels. It should be a no-op for most channels.
+ // Whether or not they will accept the delivery is not determined here, but should
+ // be taken into account by zot:process_delivery()
+
+ $r = q("select author_xchan from item where parent = %d",
+ intval($item['parent'])
+ );
+ if($r) {
+ foreach($r as $rv) {
+ if(! in_array($rv['author_xchan'],$recipients)) {
+ $recipients[] = $rv['author_xchan'];
+ }
+ }
+ }
+
+
}
// This is a somewhat expensive operation but important.