X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=scripts%2Fxmppconfirmhandler.php;h=8961b0b6e38f6a54a62cdc3782b79ae9a93dadae;hb=31d5b61ca7daf72a847aed50eb65b672b52766f5;hp=3906ac5ebc0c7c2094d0d0b0abeeffb8b1f886e8;hpb=bd83350c89383ef3eb0237b9f34d3d5ccb5b2651;p=quix0rs-gnu-social.git diff --git a/scripts/xmppconfirmhandler.php b/scripts/xmppconfirmhandler.php index 3906ac5ebc..8961b0b6e3 100755 --- a/scripts/xmppconfirmhandler.php +++ b/scripts/xmppconfirmhandler.php @@ -66,16 +66,27 @@ class XmppConfirmHandler extends XmppQueueHandler { continue; } else { $this->log(LOG_INFO, 'Confirmation sent for ' . $confirm->address); - # Mark confirmation sent - $original = clone($confirm); - $confirm->sent = $confirm->claimed; - $result = $confirm->update($original); + # Mark confirmation sent; need a dupe so we don't have the WHERE clause + $dupe = Confirm_address::staticGet('code', $confirm->code); + if (!$dupe) { + common_log(LOG_WARNING, 'Could not refetch confirm', __FILE__); + continue; + } + $orig = clone($dupe); + $dupe->sent = $dupe->claimed; + $result = $dupe->update($orig); if (!$result) { - $this->log(LOG_ERR, 'Cannot mark sent for ' . $confirm->address); + common_log_db_error($dupe, 'UPDATE', __FILE__); # Just let the claim age out; hopefully things work then continue; } + $dupe->free(); + unset($dupe); } + $user->free(); + unset($user); + $confirm->free(); + unset($confirm); $this->idle(0); } else { # $this->clear_old_confirm_claims(); @@ -119,6 +130,8 @@ class XmppConfirmHandler extends XmppQueueHandler { $confirm->claimed = NULL; $confirm->whereAdd('now() - claimed > '.CLAIM_TIMEOUT); $confirm->update(DB_DATAOBJECT_WHEREADD_ONLY); + $confirm->free(); + unset($confirm); } }