]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - scripts/xmppconfirmhandler.php
remove 'nudge' -- it won't be in this release
[quix0rs-gnu-social.git] / scripts / xmppconfirmhandler.php
index 3906ac5ebc0c7c2094d0d0b0abeeffb8b1f886e8..8961b0b6e38f6a54a62cdc3782b79ae9a93dadae 100755 (executable)
@@ -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);
        }
 }