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

Commit c4028f1d authored by Eric Helgeson's avatar Eric Helgeson

define LACONICA for compatibility on scripts

fixup_conversations.php fixes
parent 0b4b8079
...@@ -27,6 +27,7 @@ if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) { ...@@ -27,6 +27,7 @@ if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) {
} }
define('STATUSNET', true); define('STATUSNET', true);
define('LACONICA', true); // compatibility
// Set various flags so we don't time out on long-running processes // Set various flags so we don't time out on long-running processes
......
...@@ -24,17 +24,17 @@ require_once INSTALLDIR.'/scripts/commandline.inc'; ...@@ -24,17 +24,17 @@ require_once INSTALLDIR.'/scripts/commandline.inc';
common_log(LOG_INFO, 'Fixing up conversations.'); common_log(LOG_INFO, 'Fixing up conversations.');
$nid = new Notice(); $notice = new Notice();
$nid->query('select id, reply_to from notice where conversation is null'); $notice->query('select id, reply_to from notice where conversation is null');
while ($nid->fetch()) { while ($notice->fetch()) {
$cid = null; $cid = null;
$notice = new Notice(); $orig = clone($notice);
if (empty($nid->reply_to)) { if (empty($notice->reply_to)) {
$cid = $nid->id; $notice->conversation = $notice->id;
} else { } else {
$reply = Notice::staticGet('id', $notice->reply_to); $reply = Notice::staticGet('id', $notice->reply_to);
...@@ -61,9 +61,7 @@ while ($nid->fetch()) { ...@@ -61,9 +61,7 @@ while ($nid->fetch()) {
continue; continue;
} }
$notice = null;
$orig = null; $orig = null;
unset($notice);
unset($orig); unset($orig);
print ".\n"; print ".\n";
......
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