]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Favorite/actions/apifavoritecreate.php
Improved type-hint for following methods:
[quix0rs-gnu-social.git] / plugins / Favorite / actions / apifavoritecreate.php
index 4172692441413493b02b57602fed7a18cb910e57..83686326580670cc0a4393d6920e92f90688a957 100644 (file)
@@ -57,7 +57,7 @@ class ApiFavoriteCreateAction extends ApiAuthAction
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -82,7 +82,7 @@ class ApiFavoriteCreateAction extends ApiAuthAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
@@ -162,12 +162,10 @@ class ApiFavoriteCreateAction 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
         }