We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 71dfc0d9 authored by Evan Prodromou's avatar Evan Prodromou

when in doubt, start throwing transactions around

darcs-hash:20080718043735-84dde-8c74ccaf2560716209b8518e77e6a0f357d881af.gz
parent 310d02ae
......@@ -45,6 +45,9 @@ class TwitapifriendshipsAction extends TwitterapiAction {
}
$sub = new Subscription();
$sub->query('BEGIN');
$sub->subscriber = $user->id;
$sub->subscribed = $other->id;
......@@ -56,6 +59,8 @@ class TwitapifriendshipsAction extends TwitterapiAction {
return;
}
$sub->query('COMMIT');
mail_subscribe_notify($other, $user);
$type = $apidata['content-type'];
......@@ -91,7 +96,9 @@ class TwitapifriendshipsAction extends TwitterapiAction {
$sub->subscribed = $other->id;
if ($sub->fetch(TRUE)) {
$sub->query('BEGIN');
$sub->delete();
$sub->query('COMMIT');
}
$type = $apidata['content-type'];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment