From: Evan Prodromou Date: Mon, 1 Mar 2010 18:41:06 +0000 (-0500) Subject: drop tokens for OMB on unsubscribe X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=320036dbfbd1d4b2b1e866aafb5da26330cc1e21;p=quix0rs-gnu-social.git drop tokens for OMB on unsubscribe --- diff --git a/classes/Subscription.php b/classes/Subscription.php index d6fb3fcbdd..878ab83e63 100644 --- a/classes/Subscription.php +++ b/classes/Subscription.php @@ -172,6 +172,26 @@ 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; + $token->secret = $sub->secret; + + if ($token->find(true)) { + + $result = $token->delete(); + if (!$result) { + common_log_db_error($sub, 'DELETE', __FILE__); + throw new Exception(_('Couldn\'t delete subscription OMB token.')); + } + } + } + $result = $sub->delete(); if (!$result) {