X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Foauthstore.php;h=df63cc1512c12e800158d335606c52a8b9294b6c;hb=745e35ac1fcee01298db09a8649f79f410138652;hp=d617a7df7e6216f52d72d0beec8892487256f94b;hpb=b4b992bca77d34b8643910e8d590b5be7fede94b;p=quix0rs-gnu-social.git diff --git a/lib/oauthstore.php b/lib/oauthstore.php index d617a7df7e..df63cc1512 100644 --- a/lib/oauthstore.php +++ b/lib/oauthstore.php @@ -351,7 +351,7 @@ class StatusNetOAuthDataStore extends OAuthDataStore $author = User::staticGet('uri', $author_uri); } if (!$author) { - throw new Exception('No such user'); + throw new Exception('No such user.'); } common_log(LOG_DEBUG, print_r($author, true), __FILE__); @@ -359,9 +359,8 @@ class StatusNetOAuthDataStore extends OAuthDataStore $notice = Notice::saveNew($author->id, $omb_notice->getContent(), 'omb', - false, - null, - $omb_notice->getIdentifierURI()); + array('is_local' => Notice::REMOTE_OMB, + 'uri' => $omb_notice->getIdentifierURI())); common_broadcast_notice($notice, true); } @@ -407,7 +406,7 @@ class StatusNetOAuthDataStore extends OAuthDataStore $user = User::staticGet('uri', $uri); } if (!$user) { - throw new Exception('No such user'); + throw new Exception('No such user.'); } return $user; } @@ -462,6 +461,11 @@ class StatusNetOAuthDataStore extends OAuthDataStore $subscribed = $this->_getAnyProfile($subscribed_user_uri); $subscriber = $this->_getAnyProfile($subscriber_uri); + if (!$subscriber->hasRight(Right::SUBSCRIBE)) { + common_log(LOG_INFO, __METHOD__ . ": remote subscriber banned ($subscriber_uri subbing to $subscribed_user_uri)"); + return _('You have been banned from subscribing.'); + } + $sub->subscribed = $subscribed->id; $sub->subscriber = $subscriber->id;