aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-04-19 22:53:42 -0700
committerfriendica <info@friendica.com>2014-04-19 22:53:42 -0700
commit8d950b4e0628f448393d4d5166caa5d5fe5a1a9b (patch)
tree34ee55de1bff5f8f2fdc7114867c3b5b1209f575
parent167bf252c0f5d52e3928428406b80471bd2ed732 (diff)
downloadvolse-hubzilla-8d950b4e0628f448393d4d5166caa5d5fe5a1a9b.tar.gz
volse-hubzilla-8d950b4e0628f448393d4d5166caa5d5fe5a1a9b.tar.bz2
volse-hubzilla-8d950b4e0628f448393d4d5166caa5d5fe5a1a9b.zip
this should fix mention notification that aren't plus tagged
-rwxr-xr-xinclude/items.php24
1 files changed, 20 insertions, 4 deletions
diff --git a/include/items.php b/include/items.php
index 8df090e0b..487666e36 100755
--- a/include/items.php
+++ b/include/items.php
@@ -2450,16 +2450,24 @@ function tag_deliver($uid,$item_id) {
$body = preg_replace('/\[share(.*?)\[\/share\]/','',$body);
+ $tagged = false;
+ $plustagged = false;
+
+ $pattern = '/@\!?\[zrl\=' . preg_quote($term['url'],'/') . '\]' . preg_quote($u[0]['channel_name'],'/') . '\[\/zrl\]/';
+ if(preg_match($pattern,$body,$matches))
+ $tagged = true;
+
$pattern = '/@\!?\[zrl\=' . preg_quote($term['url'],'/') . '\]' . preg_quote($u[0]['channel_name'] . '+','/') . '\[\/zrl\]/';
+ if(preg_match($pattern,$body,$matches))
+ $plustagged = true;
- if(! preg_match($pattern,$body,$matches)) {
+ if(! ($tagged || $plustagged)) {
logger('tag_deliver: mention was in a reshare - ignoring');
return;
}
-
- // All good.
- // Send a notification
+
+ // Valid tag. Send a notification
require_once('include/enotify.php');
notification(array(
@@ -2472,6 +2480,14 @@ function tag_deliver($uid,$item_id) {
'otype' => 'item'
));
+ // Just a normal tag?
+
+ if(! $plustagged) {
+ logger('tag_deliver: not a plus tag', LOGGER_DEBUG);
+ return;
+ }
+
+ // plustagged - keep going, next check permissions
if(! perm_is_allowed($uid,$item['author_xchan'],'tag_deliver')) {
logger('tag_delivery denied for uid ' . $uid . ' and xchan ' . $item['author_xchan']);