]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
disallow email on faves from sandboxed users
authorEvan Prodromou <evan@status.net>
Mon, 16 Nov 2009 19:28:55 +0000 (14:28 -0500)
committerEvan Prodromou <evan@status.net>
Mon, 16 Nov 2009 19:28:55 +0000 (14:28 -0500)
classes/Profile.php
lib/mail.php
lib/right.php

index 8754c506ced67993b83ea0a4c68b22797fb0ac98..d52dff5af66d3f2244850cde8f216ae5c3d3b1ca 100644 (file)
@@ -697,6 +697,7 @@ class Profile extends Memcached_DataObject
             case Right::PUBLICNOTICE:
             case Right::EMAILONREPLY:
             case Right::EMAILONSUBSCRIBE:
+            case Right::EMAILONFAVE:
                 $result = !$this->isSandboxed();
                 break;
             default:
index 6e74d18066443097732930922e877fb490686747..dffac32626e1e3ee3b48ee70045c53729926d31b 100644 (file)
@@ -546,6 +546,10 @@ function mail_notify_message($message, $from=null, $to=null)
 
 function mail_notify_fave($other, $user, $notice)
 {
+    if (!$user->hasRight(Right::EMAILONFAVE)) {
+        return;
+    }
+
     $profile = $user->getProfile();
 
     $bestname = $profile->getBestName();
index 90ca75fd5be28f5ba01e0ea11c8a9ef1b67842dd..5e66eae0ed3da13e43d638eb6e33f9534ebb9043 100644 (file)
@@ -56,5 +56,6 @@ class Right
     const SUBSCRIBE          = 'subscribe';
     const EMAILONREPLY       = 'emailonreply';
     const EMAILONSUBSCRIBE   = 'emailonsubscribe';
+    const EMAILONFAVE        = 'emailonfave';
 }