diff options
author | Zach Copley <zach@status.net> | 2010-03-01 16:38:56 -0800 |
---|---|---|
committer | Zach Copley <zach@status.net> | 2010-03-01 16:38:56 -0800 |
commit | 0ca7aa68d3e6f86d9b5388fd33baee7b2719f5d9 (patch) | |
tree | 5098da7d69322a61dfe92739d8aa6a46eb99f427 /classes/Subscription.php | |
parent | bb94f160bd19e82babd5224cd39ff01ad2bd0380 (diff) | |
parent | 45e8819c1b9cc618e9b2d6678b0ff14c653a09d3 (diff) |
Merge branch 'testing' of gitorious.org:statusnet/mainline into testing
* 'testing' of gitorious.org:statusnet/mainline: (25 commits)
Fix a bunch of notice & warning-level messages that were breaking my inter-instance communications
more output in updateostatus.php
lost important fields when switching queries
show service debug info
pass listener URI into consumer for OMB
remove strict check on OMB exception strings
return correct HTTP status code for OMB errors
send smaller error pages for OMB API endpoints
Remove check for secret in token deletion on Subscription::cancel()
Better logging on bad token in subscription
Return empty array when no subscriptions to remote
drop tokens for OMB on unsubscribe
fix path for updateostatus.php
Script to convert OMB subscriptions to OStatus subscriptions
show service debug info
pass listener URI into consumer for OMB
remove strict check on OMB exception strings
return correct HTTP status code for OMB errors
send smaller error pages for OMB API endpoints
Remove check for secret in token deletion on Subscription::cancel()
...
Diffstat (limited to 'classes/Subscription.php')
-rw-r--r-- | classes/Subscription.php | 22 |
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) { |