Merge branch 'dev'
This commit is contained in:
commit
deede8e2dd
@ -794,6 +794,20 @@ class Enotify {
|
|||||||
: sprintf( t('commented on %s\'s post'), $item['owner']['xchan_name']));
|
: sprintf( t('commented on %s\'s post'), $item['owner']['xchan_name']));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$edit = false;
|
||||||
|
|
||||||
|
if($item['edited'] > $item['created']) {
|
||||||
|
if($item['item_thread_top']) {
|
||||||
|
$itemem_text = sprintf( t('edited a post dated %s'), relative_date($item['created']));
|
||||||
|
$edit = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$itemem_text = sprintf( t('edited a comment dated %s'), relative_date($item['created']));
|
||||||
|
$edit = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// convert this logic into a json array just like the system notifications
|
// convert this logic into a json array just like the system notifications
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
@ -801,7 +815,7 @@ class Enotify {
|
|||||||
'name' => $item['author']['xchan_name'],
|
'name' => $item['author']['xchan_name'],
|
||||||
'url' => $item['author']['xchan_url'],
|
'url' => $item['author']['xchan_url'],
|
||||||
'photo' => $item['author']['xchan_photo_s'],
|
'photo' => $item['author']['xchan_photo_s'],
|
||||||
'when' => relative_date($item['created']),
|
'when' => relative_date(($edit)? $item['edited'] : $item['created']),
|
||||||
'class' => (intval($item['item_unseen']) ? 'notify-unseen' : 'notify-seen'),
|
'class' => (intval($item['item_unseen']) ? 'notify-unseen' : 'notify-seen'),
|
||||||
'b64mid' => ((in_array($item['verb'], [ACTIVITY_LIKE, ACTIVITY_DISLIKE])) ? 'b64.' . base64url_encode($item['thr_parent']) : 'b64.' . base64url_encode($item['mid'])),
|
'b64mid' => ((in_array($item['verb'], [ACTIVITY_LIKE, ACTIVITY_DISLIKE])) ? 'b64.' . base64url_encode($item['thr_parent']) : 'b64.' . base64url_encode($item['mid'])),
|
||||||
'notify_id' => 'undefined',
|
'notify_id' => 'undefined',
|
||||||
|
@ -3009,14 +3009,17 @@ function check_item_source($uid, $item) {
|
|||||||
$words = explode("\n",$r[0]['src_patt']);
|
$words = explode("\n",$r[0]['src_patt']);
|
||||||
if($words) {
|
if($words) {
|
||||||
foreach($words as $word) {
|
foreach($words as $word) {
|
||||||
if(substr($word,0,1) === '#' && $tags) {
|
$w = trim($word);
|
||||||
|
if(! $w)
|
||||||
|
continue;
|
||||||
|
if(substr($w,0,1) === '#' && $tags) {
|
||||||
foreach($tags as $t)
|
foreach($tags as $t)
|
||||||
if((($t['ttype'] == TERM_HASHTAG) || ($t['ttype'] == TERM_COMMUNITYTAG)) && (($t['term'] === substr($word,1)) || (substr($word,1) === '*')))
|
if((($t['ttype'] == TERM_HASHTAG) || ($t['ttype'] == TERM_COMMUNITYTAG)) && (($t['term'] === substr($w,1)) || (substr($w,1) === '*')))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
elseif((strpos($word,'/') === 0) && preg_match($word,$text))
|
elseif((strpos($w,'/') === 0) && preg_match($w,$text))
|
||||||
return true;
|
return true;
|
||||||
elseif(stristr($text,$word) !== false)
|
elseif(stristr($text,$w) !== false)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user