]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
notify user of remote subscriptions
authorEvan Prodromou <evan@prodromou.name>
Sun, 24 Aug 2008 20:05:17 +0000 (16:05 -0400)
committerEvan Prodromou <evan@prodromou.name>
Sun, 24 Aug 2008 20:05:17 +0000 (16:05 -0400)
darcs-hash:20080824200517-84dde-9662d89dbcd948e3ef7b7f8d4e82d90b4891c684.gz

actions/finishremotesubscribe.php
lib/mail.php

index ba5156a204ff770bb25218e43b4fc190259af739..c9bdf26da871bdf4cf48dcb6cb125b7731340dda 100644 (file)
@@ -181,6 +181,10 @@ class FinishremotesubscribeAction extends Action {
                        return;
                }
 
+               # Notify user, if necessary
+               
+               mail_subscribe_notify_profile($user, $profile);
+               
                # Clear the data
                unset($_SESSION['oauth_authorization_request']);
 
index e6c7ee0e2a9a8e5e66be4edd95a6bb1bf36fe868..3dc1f61e2d79e9df5feafce8ac02fd2b8e2a9d1d 100644 (file)
@@ -109,9 +109,13 @@ function mail_confirm_address($code, $nickname, $address) {
 }
 
 function mail_subscribe_notify($listenee, $listener) {
+       $other = $listener->getProfile();
+       mail_subscribe_notify_profile($listenee, $other);
+}
+
+function mail_subscribe_notify_profile($listenee, $other) {
        if ($listenee->email && $listenee->emailnotifysub) {
                $profile = $listenee->getProfile();
-               $other = $listener->getProfile();
                $name = $profile->getBestName();
                $long_name = ($other->fullname) ? ($other->fullname . ' (' . $other->nickname . ')') : $other->nickname;
                $recipients = $listenee->email;