summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-06-22 14:51:17 -0700
committerEvan Prodromou <evan@controlyourself.ca>2009-06-22 14:51:17 -0700
commit0461aafeef55782056b02cd0d8702ae0a0e3812a (patch)
tree810c04d3cea406203432122a89d42e991f61c101 /scripts
parent5b96523c239609c97012834ec92e8162d868c9f7 (diff)
parent2c4486401d2303dddd55e4965d4e9770b7b75d45 (diff)
Merge branch '0.8.x' into cmdline
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/enjitqueuehandler.php2
-rwxr-xr-xscripts/facebookqueuehandler.php2
-rwxr-xr-xscripts/fixup_conversations.php79
-rwxr-xr-xscripts/fixup_hashtags.php2
-rwxr-xr-xscripts/fixup_inboxes.php2
-rwxr-xr-xscripts/fixup_notices_rendered.php2
-rwxr-xr-xscripts/fixup_replies.php2
-rwxr-xr-xscripts/getpiddir.php2
-rwxr-xr-xscripts/getvaliddaemons.php2
-rwxr-xr-xscripts/inbox_users.php2
-rwxr-xr-xscripts/jabberqueuehandler.php2
-rwxr-xr-xscripts/maildaemon.php2
-rwxr-xr-xscripts/ombqueuehandler.php2
-rw-r--r--scripts/pingqueuehandler.php2
-rwxr-xr-xscripts/publicqueuehandler.php2
-rwxr-xr-xscripts/setpassword.php2
-rwxr-xr-xscripts/smsqueuehandler.php2
-rwxr-xr-xscripts/sphinx-cron.sh2
-rwxr-xr-xscripts/sphinx-indexer.sh2
-rwxr-xr-xscripts/startdaemons.sh2
-rwxr-xr-xscripts/stopdaemons.sh5
-rwxr-xr-xscripts/synctwitterfriends.php2
-rwxr-xr-xscripts/twitterqueuehandler.php2
-rwxr-xr-xscripts/twitterstatusfetcher.php2
-rw-r--r--scripts/uncache_users.php2
-rwxr-xr-xscripts/xmppconfirmhandler.php2
-rwxr-xr-xscripts/xmppdaemon.php2
27 files changed, 107 insertions, 27 deletions
diff --git a/scripts/enjitqueuehandler.php b/scripts/enjitqueuehandler.php
index 37fef0b04..15ab3a427 100755
--- a/scripts/enjitqueuehandler.php
+++ b/scripts/enjitqueuehandler.php
@@ -2,7 +2,7 @@
<?php
/*
* Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, Controlez-Vous, Inc.
+ * Copyright (C) 2008, 2009, Control Yourself, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
diff --git a/scripts/facebookqueuehandler.php b/scripts/facebookqueuehandler.php
index c24a22596..f9123db8c 100755
--- a/scripts/facebookqueuehandler.php
+++ b/scripts/facebookqueuehandler.php
@@ -2,7 +2,7 @@
<?php
/*
* Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, Controlez-Vous, Inc.
+ * Copyright (C) 2008, 2009, Control Yourself, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
diff --git a/scripts/fixup_conversations.php b/scripts/fixup_conversations.php
new file mode 100755
index 000000000..d4a47cfee
--- /dev/null
+++ b/scripts/fixup_conversations.php
@@ -0,0 +1,79 @@
+#!/usr/bin/env php
+<?php
+/*
+ * Laconica - a distributed open-source microblogging tool
+ * Copyright (C) 2008, 2009, Control Yourself, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+# Abort if called from a web server
+if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) {
+ print "This script must be run from the command line\n";
+ exit();
+}
+
+define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
+define('LACONICA', true);
+
+require_once(INSTALLDIR . '/lib/common.php');
+
+common_log(LOG_INFO, 'Fixing up conversations.');
+
+$notice = new Notice();
+$notice->whereAdd('conversation is null');
+$notice->orderBy('id');
+
+$cnt = $notice->find();
+
+print "Found $cnt notices.\n";
+
+while ($notice->fetch()) {
+
+ print "$notice->id =>";
+
+ $orig = clone($notice);
+
+ if (empty($notice->reply_to)) {
+ $notice->conversation = $notice->id;
+ } else {
+ $reply = Notice::staticGet('id', $notice->reply_to);
+
+ if (empty($reply)) {
+ common_log(LOG_WARNING, "Replied-to notice $notice->reply_to not found.");
+ $notice->conversation = $notice->id;
+ } else if (empty($reply->conversation)) {
+ common_log(LOG_WARNING, "Replied-to notice $reply->id has no conversation ID.");
+ $notice->conversation = $notice->id;
+ } else {
+ $notice->conversation = $reply->conversation;
+ }
+ }
+
+ print "$notice->conversation";
+
+ $result = $notice->update($orig);
+
+ if (!$result) {
+ common_log_db_error($notice, 'UPDATE', __FILE__);
+ continue;
+ }
+
+ print ".\n";
+}
+
+ini_set("max_execution_time", "0");
+ini_set("max_input_time", "0");
+set_time_limit(0);
+mb_internal_encoding('UTF-8');
diff --git a/scripts/fixup_hashtags.php b/scripts/fixup_hashtags.php
index 6f65c78a1..bd38e3105 100755
--- a/scripts/fixup_hashtags.php
+++ b/scripts/fixup_hashtags.php
@@ -2,7 +2,7 @@
<?php
/*
* Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, Controlez-Vous, Inc.
+ * Copyright (C) 2008, 2009, Control Yourself, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
diff --git a/scripts/fixup_inboxes.php b/scripts/fixup_inboxes.php
index a5c8a0a5a..3e55edef1 100755
--- a/scripts/fixup_inboxes.php
+++ b/scripts/fixup_inboxes.php
@@ -2,7 +2,7 @@
<?php
/*
* Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, Controlez-Vous, Inc.
+ * Copyright (C) 2008, 2009, Control Yourself, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
diff --git a/scripts/fixup_notices_rendered.php b/scripts/fixup_notices_rendered.php
index c27185546..3e7eb7acb 100755
--- a/scripts/fixup_notices_rendered.php
+++ b/scripts/fixup_notices_rendered.php
@@ -2,7 +2,7 @@
<?php
/*
* Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, Controlez-Vous, Inc.
+ * Copyright (C) 2008, 2009, Control Yourself, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
diff --git a/scripts/fixup_replies.php b/scripts/fixup_replies.php
index 6010e21d1..9d8cfda08 100755
--- a/scripts/fixup_replies.php
+++ b/scripts/fixup_replies.php
@@ -2,7 +2,7 @@
<?php
/*
* Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, Controlez-Vous, Inc.
+ * Copyright (C) 2008, 2009, Control Yourself, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
diff --git a/scripts/getpiddir.php b/scripts/getpiddir.php
index 4f5704249..d29c95cb0 100755
--- a/scripts/getpiddir.php
+++ b/scripts/getpiddir.php
@@ -2,7 +2,7 @@
<?php
/*
* Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, Controlez-Vous, Inc.
+ * Copyright (C) 2008, 2009, Control Yourself, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
diff --git a/scripts/getvaliddaemons.php b/scripts/getvaliddaemons.php
index 4e49f9bd4..a45ff79ab 100755
--- a/scripts/getvaliddaemons.php
+++ b/scripts/getvaliddaemons.php
@@ -2,7 +2,7 @@
<?php
/*
* Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, Controlez-Vous, Inc.
+ * Copyright (C) 2008, 2009, Control Yourself, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
diff --git a/scripts/inbox_users.php b/scripts/inbox_users.php
index 7d14f0efe..6d3656d2e 100755
--- a/scripts/inbox_users.php
+++ b/scripts/inbox_users.php
@@ -2,7 +2,7 @@
<?php
/*
* Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, Controlez-Vous, Inc.
+ * Copyright (C) 2008, 2009, Control Yourself, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
diff --git a/scripts/jabberqueuehandler.php b/scripts/jabberqueuehandler.php
index 454c67f7b..b848442fd 100755
--- a/scripts/jabberqueuehandler.php
+++ b/scripts/jabberqueuehandler.php
@@ -2,7 +2,7 @@
<?php
/*
* Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, Controlez-Vous, Inc.
+ * Copyright (C) 2008, 2009, Control Yourself, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
diff --git a/scripts/maildaemon.php b/scripts/maildaemon.php
index 0b9ab0deb..dc3ab0b56 100755
--- a/scripts/maildaemon.php
+++ b/scripts/maildaemon.php
@@ -2,7 +2,7 @@
<?php
/*
* Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, Controlez-Vous, Inc.
+ * Copyright (C) 2008, 2009, Control Yourself, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
diff --git a/scripts/ombqueuehandler.php b/scripts/ombqueuehandler.php
index 6abc6d7f1..4c5890f57 100755
--- a/scripts/ombqueuehandler.php
+++ b/scripts/ombqueuehandler.php
@@ -2,7 +2,7 @@
<?php
/*
* Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, Controlez-Vous, Inc.
+ * Copyright (C) 2008, 2009, Control Yourself, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
diff --git a/scripts/pingqueuehandler.php b/scripts/pingqueuehandler.php
index 372c550f5..84ef9be27 100644
--- a/scripts/pingqueuehandler.php
+++ b/scripts/pingqueuehandler.php
@@ -2,7 +2,7 @@
<?php
/*
* Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, Controlez-Vous, Inc.
+ * Copyright (C) 2008, 2009, Control Yourself, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
diff --git a/scripts/publicqueuehandler.php b/scripts/publicqueuehandler.php
index 7e09454d1..017174ed8 100755
--- a/scripts/publicqueuehandler.php
+++ b/scripts/publicqueuehandler.php
@@ -2,7 +2,7 @@
<?php
/*
* Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, Controlez-Vous, Inc.
+ * Copyright (C) 2008, 2009, Control Yourself, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
diff --git a/scripts/setpassword.php b/scripts/setpassword.php
index d694eed09..c417f741a 100755
--- a/scripts/setpassword.php
+++ b/scripts/setpassword.php
@@ -2,7 +2,7 @@
<?php
/*
* Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, Controlez-Vous, Inc.
+ * Copyright (C) 2008, 2009, Control Yourself, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
diff --git a/scripts/smsqueuehandler.php b/scripts/smsqueuehandler.php
index ed6dbd2ad..0366d4c4c 100755
--- a/scripts/smsqueuehandler.php
+++ b/scripts/smsqueuehandler.php
@@ -2,7 +2,7 @@
<?php
/*
* Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, Controlez-Vous, Inc.
+ * Copyright (C) 2008, 2009, Control Yourself, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
diff --git a/scripts/sphinx-cron.sh b/scripts/sphinx-cron.sh
index 9759adbd0..c16af3c4b 100755
--- a/scripts/sphinx-cron.sh
+++ b/scripts/sphinx-cron.sh
@@ -2,7 +2,7 @@
# Laconica - a distributed open-source microblogging tool
-# Copyright (C) 2008, Controlez-Vous, Inc.
+# Copyright (C) 2008, 2009, Control Yourself, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
diff --git a/scripts/sphinx-indexer.sh b/scripts/sphinx-indexer.sh
index 3311b2ed1..fe7c16bea 100755
--- a/scripts/sphinx-indexer.sh
+++ b/scripts/sphinx-indexer.sh
@@ -2,7 +2,7 @@
# Laconica - a distributed open-source microblogging tool
-# Copyright (C) 2008, Controlez-Vous, Inc.
+# Copyright (C) 2008, 2009, Control Yourself, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
diff --git a/scripts/startdaemons.sh b/scripts/startdaemons.sh
index 3869e95c4..053c4f8ee 100755
--- a/scripts/startdaemons.sh
+++ b/scripts/startdaemons.sh
@@ -2,7 +2,7 @@
# Laconica - a distributed open-source microblogging tool
-# Copyright (C) 2008, Controlez-Vous, Inc.
+# Copyright (C) 2008, 2009, Control Yourself, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
diff --git a/scripts/stopdaemons.sh b/scripts/stopdaemons.sh
index 2134b4ab0..60ffd83ad 100755
--- a/scripts/stopdaemons.sh
+++ b/scripts/stopdaemons.sh
@@ -2,7 +2,7 @@
# Laconica - a distributed open-source microblogging tool
-# Copyright (C) 2008, Controlez-Vous, Inc.
+# Copyright (C) 2008, 2009, Control Yourself, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@@ -24,7 +24,8 @@ SDIR=`dirname $0`
DIR=`php $SDIR/getpiddir.php`
for f in jabberhandler ombhandler publichandler smshandler pinghandler \
- xmppconfirmhandler xmppdaemon twitterhandler facebookhandler; do
+ xmppconfirmhandler xmppdaemon twitterhandler facebookhandler \
+ twitterstatusfetcher; do
FILES="$DIR/$f.*.pid"
for ff in "$FILES" ; do
diff --git a/scripts/synctwitterfriends.php b/scripts/synctwitterfriends.php
index dea3f9700..7f418894e 100755
--- a/scripts/synctwitterfriends.php
+++ b/scripts/synctwitterfriends.php
@@ -2,7 +2,7 @@
<?php
/*
* Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, Controlez-Vous, Inc.
+ * Copyright (C) 2008, 2009, Control Yourself, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
diff --git a/scripts/twitterqueuehandler.php b/scripts/twitterqueuehandler.php
index 8c8a59d6a..d6fb17cc8 100755
--- a/scripts/twitterqueuehandler.php
+++ b/scripts/twitterqueuehandler.php
@@ -2,7 +2,7 @@
<?php
/*
* Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, Controlez-Vous, Inc.
+ * Copyright (C) 2008, 2009, Control Yourself, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
diff --git a/scripts/twitterstatusfetcher.php b/scripts/twitterstatusfetcher.php
index 2863207b0..c18261b5b 100755
--- a/scripts/twitterstatusfetcher.php
+++ b/scripts/twitterstatusfetcher.php
@@ -2,7 +2,7 @@
<?php
/**
* Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, Controlez-Vous, Inc.
+ * Copyright (C) 2008, 2009, Control Yourself, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
diff --git a/scripts/uncache_users.php b/scripts/uncache_users.php
index fa0fb64cd..e35ea81ea 100644
--- a/scripts/uncache_users.php
+++ b/scripts/uncache_users.php
@@ -2,7 +2,7 @@
<?php
/*
* Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, Controlez-Vous, Inc.
+ * Copyright (C) 2008, 2009, Control Yourself, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
diff --git a/scripts/xmppconfirmhandler.php b/scripts/xmppconfirmhandler.php
index fee902320..217481d65 100755
--- a/scripts/xmppconfirmhandler.php
+++ b/scripts/xmppconfirmhandler.php
@@ -2,7 +2,7 @@
<?php
/*
* Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, Controlez-Vous, Inc.
+ * Copyright (C) 2008, 2009, Control Yourself, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
diff --git a/scripts/xmppdaemon.php b/scripts/xmppdaemon.php
index 468a163d2..0f98becda 100755
--- a/scripts/xmppdaemon.php
+++ b/scripts/xmppdaemon.php
@@ -2,7 +2,7 @@
<?php
/*
* Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, Controlez-Vous, Inc.
+ * Copyright (C) 2008, 2009, Control Yourself, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by