summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-09-13 12:43:33 -0400
committerEvan Prodromou <evan@prodromou.name>2008-09-13 12:43:33 -0400
commite84439d5c595c0b3c3e9996a47f8a2eac49a14e9 (patch)
treebf6961e8f70ffae876aa3a3756a9466bdb6f44a0 /scripts
parented57778b92e03d1e1dc922273eb07bd929398cbd (diff)
duplicate confirmation to avoid where clause
darcs-hash:20080913164333-84dde-ef4f3363e045aabd52173ea9be34b2f59f64d084.gz
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/xmppconfirmhandler.php17
1 files changed, 12 insertions, 5 deletions
diff --git a/scripts/xmppconfirmhandler.php b/scripts/xmppconfirmhandler.php
index d1735d8d2..8961b0b6e 100755
--- a/scripts/xmppconfirmhandler.php
+++ b/scripts/xmppconfirmhandler.php
@@ -66,15 +66,22 @@ 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) {
- common_log_db_error($confirm, 'UPDATE', __FILE__);
+ 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);