diff --git a/QvitterPlugin.php b/QvitterPlugin.php
index 2c3992e..742a1ff 100644
--- a/QvitterPlugin.php
+++ b/QvitterPlugin.php
@@ -153,6 +153,11 @@ class QvitterPlugin extends Plugin {
// route/reroute urls
public function onRouterInitialized($m)
{
+ $m->connect(':nickname/mutes',
+ array('action' => 'qvitter',
+ 'nickname' => Nickname::INPUT_FMT));
+ $m->connect('api/qvitter/mutes.json',
+ array('action' => 'ApiQvitterMutes'));
$m->connect('api/qvitter/sandboxed.:format',
array('action' => 'ApiQvitterSandboxed',
'format' => '(xml|json)'));
@@ -1291,6 +1296,16 @@ class QvitterPlugin extends Plugin {
$notification->whereAdd(sprintf('qvitternotification.from_profile_id IN (SELECT subscribed FROM subscription WHERE subscriber = %u)', $user_id));
}
+ // the user might have opted out from notifications from profiles they have muted
+ $hide_notifications_from_muted_users = Profile_prefs::getConfigData($profile, 'qvitter', 'hide_notifications_from_muted_users');
+ if($hide_notifications_from_muted_users == '1') {
+ $muted_ids = QvitterMuted::getMutedIDs($profile->id,0,10000); // get all (hopefully not more than 10 000...)
+ if($muted_ids !== false && count($muted_ids) > 0) {
+ $ids_imploded = implode(',',$muted_ids);
+ $notification->whereAdd('qvitternotification.from_profile_id NOT IN ('.$ids_imploded.')');
+ }
+ }
+
// the user might have opted out from certain notification types
$current_profile = $user->getProfile();
$disable_notify_replies_and_mentions = Profile_prefs::getConfigData($current_profile, 'qvitter', 'disable_notify_replies_and_mentions');
diff --git a/actions/apiqvitterblocks.php b/actions/apiqvitterblocks.php
index f6d7bb2..d970605 100644
--- a/actions/apiqvitterblocks.php
+++ b/actions/apiqvitterblocks.php
@@ -96,7 +96,7 @@ class ApiQvitterBlocksAction extends ApiPrivateAuthAction
}
/**
- * Get the user's subscribers (followers) as an array of profiles
+ * Get the user's blocked profiles
*
* @return array Profiles
*/
diff --git a/actions/apiqvittermutes.php b/actions/apiqvittermutes.php
new file mode 100644
index 0000000..ec56189
--- /dev/null
+++ b/actions/apiqvittermutes.php
@@ -0,0 +1,182 @@
+ \\\\_\ ·
+ · \\) \____) ·
+ · ·
+ · ·
+ · ·
+ · Qvitter is free software: you can redistribute it and / or modify it ·
+ · under the terms of the GNU Affero General Public License as published by ·
+ · the Free Software Foundation, either version three of the License or (at ·
+ · your option) any later version. ·
+ · ·
+ · Qvitter is distributed in hope that it will be useful but WITHOUT ANY ·
+ · WARRANTY; without even the implied warranty of MERCHANTABILTY or FITNESS ·
+ · FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for ·
+ · more details. ·
+ · ·
+ · You should have received a copy of the GNU Affero General Public License ·
+ · along with Qvitter. If not, see