diff --git a/QvitterPlugin.php b/QvitterPlugin.php index 0d22617..a008734 100644 --- a/QvitterPlugin.php +++ b/QvitterPlugin.php @@ -606,12 +606,7 @@ class QvitterPlugin extends Plugin { } } - if($notice->source == 'activity' || $notice->object_type == 'activity' || $notice->object_type == 'http://activitystrea.ms/schema/1.0/activity' || $notice->verb == 'delete') { - $twitter_status['is_activity'] = true; - } - else { - $twitter_status['is_activity'] = false; - } + $twitter_status['is_post_verb'] = ActivityUtils::compareVerbs(ActivityVerb::POST, array($notice->verb)); if(ActivityUtils::compareTypes($notice->verb, array('qvitter-delete-notice', 'delete'))) { $twitter_status['qvitter_delete_notice'] = true; diff --git a/js/dom-functions.js b/js/dom-functions.js index 56c6ebd..7eb911d 100644 --- a/js/dom-functions.js +++ b/js/dom-functions.js @@ -1550,7 +1550,7 @@ function addToFeed(feed, after, extraClasses) { if(window.currentStreamObject.name == 'notifications') { // don't show any notices with object_type "activity" - if(typeof obj.notice != 'undefined' && obj.notice !== null && obj.notice.is_activity === true) { + if(typeof obj.notice != 'undefined' && obj.notice !== null && obj.notice.is_post_verb === false) { return true; } @@ -1861,7 +1861,7 @@ function buildQueetHtml(obj, idInStream, extraClasses, requeeted_by, isConversat } // activity? (hidden with css) - if(obj.source == 'activity' || obj.is_activity === true) { + if(obj.source == 'activity' || obj.is_post_verb === false) { extraClasses += ' activity always-hidden'; // because we had an xss issue with activities, the obj.statusnet_html of qvitter-deleted-activity-notices can contain unwanted html, so we escape, they are hidden anyway diff --git a/js/misc-functions.js b/js/misc-functions.js index 7e81617..9f4c932 100644 --- a/js/misc-functions.js +++ b/js/misc-functions.js @@ -832,7 +832,7 @@ function searchForUpdatedNoticeData(obj) { // sometimes activity notices don't get the is_activity flag set to true // maybe because they were in the process of being saved when // we first got them - if(obj.is_activity) { + if(obj.is_post_verb === false) { streamItemFoundInFeed.addClass('activity always-hidden'); }