Disable qvitter-delete-notice if ActivityModeration plugin exists

This commit is contained in:
Mikael Nordfeldth 2015-10-03 16:52:35 +02:00
parent 66728fb136
commit 96e718a5c3

View File

@ -572,7 +572,7 @@ class QvitterPlugin extends Plugin {
$twitter_status['is_activity'] = false;
}
if($notice->verb == 'qvitter-delete-notice') {
if(ActivityUtils::compareTypes($notice->verb, array('qvitter-delete-notice', 'delete'))) {
$twitter_status['qvitter_delete_notice'] = true;
}
@ -797,7 +797,7 @@ class QvitterPlugin extends Plugin {
$user_is_deleted = true;
}
if(!$user_is_deleted) {
if(!$user_is_deleted && class_exists('StatusNet') && !array_key_exists('ActivityModeration', StatusNet::getActivePlugins())) {
$rendered = sprintf(_m('<a href="%1$s">%2$s</a> deleted notice <a href="%3$s">{{%4$s}}</a>.'),
htmlspecialchars($profile->getUrl()),
htmlspecialchars($profile->getBestName()),
@ -835,7 +835,7 @@ class QvitterPlugin extends Plugin {
public function onEndHandleFeedEntry($activity) {
if($activity->verb == 'qvitter-delete-notice') {
if($activity->verb == 'qvitter-delete-notice' && class_exists('StatusNet') && !array_key_exists('ActivityModeration', StatusNet::getActivePlugins())) {
$deleter_profile_uri = $activity->actor->id;
$deleted_notice_uri = $activity->objects[0]->objects[0]->content;