From 8b6230726fac986b96f0dc8405d30afe456605df Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 29 Aug 2016 18:06:39 -0700 Subject: add authors to post distribution; case insensitive sort apps --- Zotlabs/Lib/Apps.php | 2 +- include/items.php | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php index 19ed1b612..a646d8a30 100644 --- a/Zotlabs/Lib/Apps.php +++ b/Zotlabs/Lib/Apps.php @@ -112,7 +112,7 @@ class Apps { static public function app_name_compare($a,$b) { - return strcmp($a['name'],$b['name']); + return strcasecmp($a['name'],$b['name']); } 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. -- cgit v1.2.3