aboutsummaryrefslogtreecommitdiffstats
path: root/mod/item.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-06-27 16:12:04 -0700
committerfriendica <info@friendica.com>2013-06-27 16:12:04 -0700
commit230aeb782eaea85626640d14f5949606de73d502 (patch)
tree20c262e6ad716f36306d51eac3ebfcd2b34d45e5 /mod/item.php
parentb9466941e77eea806539ea56b6b625d354968f4c (diff)
downloadvolse-hubzilla-230aeb782eaea85626640d14f5949606de73d502.tar.gz
volse-hubzilla-230aeb782eaea85626640d14f5949606de73d502.tar.bz2
volse-hubzilla-230aeb782eaea85626640d14f5949606de73d502.zip
if you send a private post to an @-taggable channel (and nobody else), tag them. This sort of implements what Zottel was asking for - posting to a forum by posting only to the forum without having to tag it. Taggables are already highlighted in the ACL widget so as to avoid privacy surprises.
Currently untested but shouldn't take much to get working if it isn't working already.
Diffstat (limited to 'mod/item.php')
-rw-r--r--mod/item.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/mod/item.php b/mod/item.php
index 338d2a2ee..3a1e4a95e 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -320,6 +320,18 @@ function item_post(&$a) {
$body = fix_mce_lf($body);
}
+ // If we're sending a private message with a single @-taggable channel as a recipient, @-tag it.
+
+ if(substr_count($str_contact_allow,'<') == 1 && $str_group_allow == '' && str_contact_deny == '' && $str_group_deny == '') {
+ $x = q("select abook_id, abook_their_perms from abook where abook_xchan = '%s' and abook_channel = %d limit 1",
+ dbesc(str_replace(array('<','>'),array('',''),$str_contact_allow)),
+ intval($profile_uid)
+ );
+ if($x && ($x[0]['abook_their_perms'] & PERMS_W_TAGWALL))
+ $body .= "\n\n@group+" . $x[0]['abook_id'] . "\n";
+ }
+
+
/**
* fix naked links by passing through a callback to see if this is a red site