From 6fb8cd4d24902af1c861c1ee242ea2e86b1eee68 Mon Sep 17 00:00:00 2001 From: Alexandre Hannud Abdo Date: Wed, 21 May 2014 17:23:18 -0300 Subject: Make tag delivery work when channel name differs from profile name --- include/items.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'include/items.php') diff --git a/include/items.php b/include/items.php index 5aaeb55c0..1c44b7df5 100755 --- a/include/items.php +++ b/include/items.php @@ -2438,7 +2438,7 @@ function tag_deliver($uid,$item_id) { if($terms) { foreach($terms as $term) { - if((strcasecmp($term['term'],$u[0]['channel_name']) == 0) && link_compare($term['url'],$link)) { + if(link_compare($term['url'],$link)) { $mention = true; break; } @@ -2474,11 +2474,11 @@ function tag_deliver($uid,$item_id) { $tagged = false; $plustagged = false; - $pattern = '/@\!?\[zrl\=' . preg_quote($term['url'],'/') . '\]' . preg_quote($u[0]['channel_name'],'/') . '\[\/zrl\]/'; + $pattern = '/@\!?\[zrl\=' . preg_quote($term['url'],'/') . '\]' . preg_quote($term['term'],'/') . '\[\/zrl\]/'; if(preg_match($pattern,$body,$matches)) $tagged = true; - $pattern = '/@\!?\[zrl\=' . preg_quote($term['url'],'/') . '\]' . preg_quote($u[0]['channel_name'] . '+','/') . '\[\/zrl\]/'; + $pattern = '/@\!?\[zrl\=' . preg_quote($term['url'],'/') . '\]' . preg_quote($term['term'] . '+','/') . '\[\/zrl\]/'; if(preg_match($pattern,$body,$matches)) $plustagged = true; @@ -2607,7 +2607,7 @@ function tgroup_check($uid,$item) { if($terms) { foreach($terms as $term) { - if(($term['term'] == $u[0]['channel_name']) && link_compare($term['url'],$link)) { + if(link_compare($term['url'],$link)) { $mention = true; break; } @@ -2625,7 +2625,7 @@ function tgroup_check($uid,$item) { $body = preg_replace('/\[share(.*?)\[\/share\]/','',$item['body']); - $pattern = '/@\!?\[zrl\=' . preg_quote($term['url'],'/') . '\]' . preg_quote($u[0]['channel_name'] . '+','/') . '\[\/zrl\]/'; + $pattern = '/@\!?\[zrl\=' . preg_quote($term['url'],'/') . '\]' . preg_quote($term['term'] . '+','/') . '\[\/zrl\]/'; if(! preg_match($pattern,$body,$matches)) { logger('tgroup_check: mention was in a reshare - ignoring'); -- cgit v1.2.3