X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Foauthstore.php;h=a6a6de7505c946bbdd0a24b7760dea3ff8abb940;hb=01a03e34c8d286011c0f4301e60c103d992a449a;hp=a4ea5ad4d0eccaa1eb9fa65541ab85748a1a2023;hpb=8e58f241739b97bd53f78035781f16e2067a31d9;p=quix0rs-gnu-social.git diff --git a/lib/oauthstore.php b/lib/oauthstore.php index a4ea5ad4d0..a6a6de7505 100644 --- a/lib/oauthstore.php +++ b/lib/oauthstore.php @@ -65,7 +65,7 @@ class StatusNetOAuthDataStore extends OAuthDataStore { $n = new Nonce(); $n->consumer_key = $consumer->key; - $n->ts = $timestamp; + $n->ts = common_sql_date($timestamp); $n->nonce = $nonce; if ($n->find(true)) { return true; @@ -359,11 +359,9 @@ 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); } /** @@ -392,7 +390,7 @@ class StatusNetOAuthDataStore extends OAuthDataStore $sub->subscribed = $user->id; if (!$sub->find(true)) { - return 0; + return array(); } /* Since we do not use OMB_Service_Provider’s action methods, there @@ -462,6 +460,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;