]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Favorite/actions/atompubfavoritefeed.php
Improved type-hint for following methods:
[quix0rs-gnu-social.git] / plugins / Favorite / actions / atompubfavoritefeed.php
index 4ff76e183d1622b20a47625d76d1013c35411284..8092bbac78e581baf4f8b1fe3cc11a5277e8fa18 100644 (file)
@@ -298,7 +298,7 @@ class AtompubfavoritefeedAction extends ApiAuthAction
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
             $_SERVER['REQUEST_METHOD'] == 'HEAD') {
@@ -361,12 +361,10 @@ class AtompubfavoritefeedAction extends ApiAuthAction
     function notify($fave, $notice, $user)
     {
         $other = User::getKV('id', $notice->profile_id);
-        if ($other && $other->id != $user->id) {
-            if ($other->email && $other->emailnotifyfav) {
-                require_once INSTALLDIR.'/lib/mail.php';
+        if ($other && $other->id != $user->id && !empty($other->email)) {
+            require_once INSTALLDIR.'/lib/mail.php';
 
-                mail_notify_fave($other, $user->getProfile(), $notice);
-            }
+            mail_notify_fave($other, $user->getProfile(), $notice);
             // XXX: notify by IM
             // XXX: notify by SMS
         }