summaryrefslogtreecommitdiff
path: root/lib/oauthstore.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/oauthstore.php')
-rw-r--r--lib/oauthstore.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/oauthstore.php b/lib/oauthstore.php
index 4ad123455..688c7477a 100644
--- a/lib/oauthstore.php
+++ b/lib/oauthstore.php
@@ -106,9 +106,21 @@ class LaconicaOAuthDataStore extends OAuthDataStore {
$rt->state = 2; # used
if (!$rt->update($orig_rt)) {
return NULL;
+ }
+ # Update subscription
+ # XXX: mixing levels here
+ $sub = Subscription::staticGet('token', $rt->tok);
+ if (!$sub) {
+ return NULL;
+ }
+ $orig_sub = clone($sub);
+ $sub->token = $at->tok;
+ $sub->secret = $at->secret;
+ if (!$sub->update($orig_sub)) {
+ return NULL;
} else {
return new OAuthToken($at->tok, $at->secret);
- }
+ }
}
} else {
return NULL;