From ef27a1ce6c3cdb6f08584e76fa0c012377cadc49 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 8 Nov 2017 19:21:36 -0800 Subject: use logger --- include/zot.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/zot.php b/include/zot.php index 0aa50ab92..40e303bf1 100644 --- a/include/zot.php +++ b/include/zot.php @@ -2010,8 +2010,7 @@ function update_imported_item($sender, $item, $orig, $uid, $tag_delivery) { // may have a different owner than the one being transmitted. if(($sender['hash'] != $orig['owner_xchan'] && $sender['hash'] != $orig['author_xchan']) && (! $tag_delivery)) { - /// @fixme shouldn't this be logger? - notice('sender is not owner or author'); + logger('sender is not owner or author'); return; } -- cgit v1.2.3 From 629c915f36a6b22d9eba24e2394198c71bcf9365 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 21 Jan 2018 23:30:08 -0800 Subject: ensure filter words are not empty --- include/items.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/include/items.php b/include/items.php index d0b9cffc9..b12ad1d85 100755 --- a/include/items.php +++ b/include/items.php @@ -3009,14 +3009,17 @@ function check_item_source($uid, $item) { $words = explode("\n",$r[0]['src_patt']); if($words) { 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) - 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; } - elseif((strpos($word,'/') === 0) && preg_match($word,$text)) + elseif((strpos($w,'/') === 0) && preg_match($w,$text)) return true; - elseif(stristr($text,$word) !== false) + elseif(stristr($text,$w) !== false) return true; } } -- cgit v1.2.3 From f85c6d76de5532e62f95de3f4d814109ea3472f9 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 22 Jan 2018 11:54:53 -0800 Subject: better notifications for edit post/comments which may have been originally posted long ago --- Zotlabs/Lib/Enotify.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Zotlabs/Lib/Enotify.php b/Zotlabs/Lib/Enotify.php index a7b4f28e8..5cf4ec31d 100644 --- a/Zotlabs/Lib/Enotify.php +++ b/Zotlabs/Lib/Enotify.php @@ -794,6 +794,20 @@ class Enotify { : 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 return array( @@ -801,7 +815,7 @@ class Enotify { 'name' => $item['author']['xchan_name'], 'url' => $item['author']['xchan_url'], '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'), 'b64mid' => ((in_array($item['verb'], [ACTIVITY_LIKE, ACTIVITY_DISLIKE])) ? 'b64.' . base64url_encode($item['thr_parent']) : 'b64.' . base64url_encode($item['mid'])), 'notify_id' => 'undefined', -- cgit v1.2.3