summaryrefslogtreecommitdiff
path: root/classes/Subscription.php
diff options
context:
space:
mode:
authorCraig Andrews <candrews@integralblue.com>2010-03-08 17:22:23 -0500
committerCraig Andrews <candrews@integralblue.com>2010-03-08 17:22:23 -0500
commit714d920faea302b55857cc3bec4e9e6160ea136a (patch)
treecffa5ee7a3261ad24b272cb3ced16a6c1dcafad1 /classes/Subscription.php
parentc187bf55974347f7ddb4f28714af57861dce8f08 (diff)
parent51a245f18c1e4a830c5eb94f3e60c6b4b3e560ee (diff)
Merge branch '0.9.x' into 1.0.x
Conflicts: classes/statusnet.ini db/statusnet.sql lib/jabber.php lib/xmppmanager.php
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) {