summaryrefslogtreecommitdiff
path: root/classes/Subscription.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-03-02 13:38:10 -0800
committerBrion Vibber <brion@pobox.com>2010-03-02 13:38:10 -0800
commitddf3614c843bcd8d9ecfd0850ac9a8cefae6dbba (patch)
tree07b772b280e6f23761c0111d953b3c2f5b8d2120 /classes/Subscription.php
parent8629664ed90ffb496f607d15491821217f6b3126 (diff)
parente9c127ddd869f44eafe7ae6b30d9dc69df8b863c (diff)
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'classes/Subscription.php')
-rw-r--r--classes/Subscription.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/classes/Subscription.php b/classes/Subscription.php
index d6fb3fcbd..9cef2df1a 100644
--- a/classes/Subscription.php
+++ b/classes/Subscription.php
@@ -172,6 +172,28 @@ class Subscription extends Memcached_DataObject
assert(!empty($sub));
+ // @todo: move this block to EndSubscribe handler for
+ // OMB plugin when it exists.
+
+ if (!empty($sub->token)) {
+
+ $token = new Token();
+
+ $token->tok = $sub->token;
+
+ if ($token->find(true)) {
+
+ $result = $token->delete();
+
+ if (!$result) {
+ common_log_db_error($token, 'DELETE', __FILE__);
+ throw new Exception(_('Couldn\'t delete subscription OMB token.'));
+ }
+ } else {
+ common_log(LOG_ERR, "Couldn't find credentials with token {$token->tok}");
+ }
+ }
+
$result = $sub->delete();
if (!$result) {