diff options
author | zotlabs <mike@macgirvin.com> | 2018-04-04 18:53:06 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2018-04-04 18:53:06 -0700 |
commit | e8646799427a51a13e97f83a7858274fbf85ba20 (patch) | |
tree | 7b8fd5a876a0ba2cfa9e451c4f59df5dd94b893c | |
parent | cadef5924fd42e45e4a1a19c7c8cb559d1ea8fd7 (diff) | |
download | volse-hubzilla-e8646799427a51a13e97f83a7858274fbf85ba20.tar.gz volse-hubzilla-e8646799427a51a13e97f83a7858274fbf85ba20.tar.bz2 volse-hubzilla-e8646799427a51a13e97f83a7858274fbf85ba20.zip |
private forum mentions
-rw-r--r-- | Zotlabs/Module/Item.php | 2 | ||||
-rw-r--r-- | include/text.php | 8 | ||||
-rw-r--r-- | view/js/autocomplete.js | 2 |
3 files changed, 8 insertions, 4 deletions
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index fba2ef7a4..ad72d9ccd 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -542,7 +542,7 @@ class Item extends \Zotlabs\Web\Controller { // Look for tags and linkify them $results = linkify_tags($a, $body, ($uid) ? $uid : $profile_uid); - + if($results) { // Set permissions based on tag replacements diff --git a/include/text.php b/include/text.php index 658f53305..255d02c7c 100644 --- a/include/text.php +++ b/include/text.php @@ -2577,6 +2577,9 @@ function handle_tag($a, &$body, &$access_tag, &$str_tags, $profile_uid, $tag, $d // The @! tag will alter permissions $exclusive = (((! $grouptag) && (strpos($tag,'!') === 1) && (! $diaspora)) ? true : false); + if(($grouptag) && (strpos($tag,'!!') === 0)) { + $exclusive = true; + } //is it already replaced? if(strpos($tag,'[zrl=')) @@ -2749,8 +2752,8 @@ function handle_tag($a, &$body, &$access_tag, &$str_tags, $profile_uid, $tag, $d $profile = str_replace(',','%2c',$profile); $url = $profile; if($grouptag) { - $newtag = '!' . '[zrl=' . $profile . ']' . $newname . '[/zrl]'; - $body = str_replace('!' . $name, $newtag, $body); + $newtag = '!' . (($exclusive) ? '!' : '') . '[zrl=' . $profile . ']' . $newname . '[/zrl]'; + $body = str_replace('!' . (($exclusive) ? '!' : '') . $name, $newtag, $body); } else { $newtag = '@' . (($exclusive) ? '!' : '') . '[zrl=' . $profile . ']' . $newname . (($forum && ! $trailing_plus_name) ? '+' : '') . '[/zrl]'; @@ -2800,6 +2803,7 @@ function linkify_tags($a, &$body, $uid, $diaspora = false) { continue; $success = handle_tag($a, $body, $access_tag, $str_tags, ($uid) ? $uid : App::$profile_uid , $tag, $diaspora); + $results[] = array('success' => $success, 'access_tag' => $access_tag); if($success['replaced']) $tagged[] = $tag; } diff --git a/view/js/autocomplete.js b/view/js/autocomplete.js index 7a1a7673d..07b9bc449 100644 --- a/view/js/autocomplete.js +++ b/view/js/autocomplete.js @@ -198,7 +198,7 @@ function string2bb(element) { // Autocomplete forums forums = { - match: /(^|\s)(\!)([^ \n]+)$/, + match: /(^|\s)(\!\!*)([^ \n]+)$/, index: 3, search: function(term, callback) { contact_search(term, callback, backend_url, 'f', extra_channels, spinelement=false); }, replace: editor_replace, |