diff options
author | Sarven Capadisli <csarven@status.net> | 2009-10-27 15:00:35 +0100 |
---|---|---|
committer | Sarven Capadisli <csarven@status.net> | 2009-10-27 15:00:35 +0100 |
commit | ac47015e2b9b4a82ef497d203fb971b7f128ad41 (patch) | |
tree | c9bb929b2062f4437bafea1830a8af08d877015f /scripts | |
parent | 0e029d728429009e7791ae052df4e9998e309fab (diff) | |
parent | 0b4390e7f2322a15f16919425de039d555b3e516 (diff) |
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/commandline.inc | 1 | ||||
-rwxr-xr-x | scripts/facebookqueuehandler.php | 74 | ||||
-rwxr-xr-x | scripts/fixup_conversations.php | 14 | ||||
-rwxr-xr-x | scripts/getvaliddaemons.php | 1 | ||||
-rwxr-xr-x | scripts/maildaemon.php | 4 |
5 files changed, 11 insertions, 83 deletions
diff --git a/scripts/commandline.inc b/scripts/commandline.inc index 1573b569d..9029bb19d 100644 --- a/scripts/commandline.inc +++ b/scripts/commandline.inc @@ -27,6 +27,7 @@ if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) { } define('STATUSNET', true); +define('LACONICA', true); // compatibility // Set various flags so we don't time out on long-running processes diff --git a/scripts/facebookqueuehandler.php b/scripts/facebookqueuehandler.php deleted file mode 100755 index e13ac4e85..000000000 --- a/scripts/facebookqueuehandler.php +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env php -<?php -/* - * StatusNet - the distributed open-source microblogging tool - * Copyright (C) 2008, 2009, StatusNet, 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/>. - */ - -define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); - -$shortoptions = 'i::'; -$longoptions = array('id::'); - -$helptext = <<<END_OF_FACEBOOK_HELP -Daemon script for pushing new notices to Facebook. - - -i --id Identity (default none) - -END_OF_FACEBOOK_HELP; - -require_once INSTALLDIR.'/scripts/commandline.inc'; - -require_once INSTALLDIR . '/lib/facebookutil.php'; -require_once INSTALLDIR . '/lib/queuehandler.php'; - -class FacebookQueueHandler extends QueueHandler -{ - function transport() - { - return 'facebook'; - } - - function start() - { - $this->log(LOG_INFO, "INITIALIZE"); - return true; - } - - function handle_notice($notice) - { - return facebookBroadcastNotice($notice); - } - - function finish() - { - } - -} - -if (have_option('i')) { - $id = get_option_value('i'); -} else if (have_option('--id')) { - $id = get_option_value('--id'); -} else if (count($args) > 0) { - $id = $args[0]; -} else { - $id = null; -} - -$handler = new FacebookQueueHandler($id); - -$handler->runOnce(); diff --git a/scripts/fixup_conversations.php b/scripts/fixup_conversations.php index 8a9f7bb57..80890fe98 100755 --- a/scripts/fixup_conversations.php +++ b/scripts/fixup_conversations.php @@ -24,17 +24,17 @@ require_once INSTALLDIR.'/scripts/commandline.inc'; common_log(LOG_INFO, 'Fixing up conversations.'); -$nid = new Notice(); -$nid->query('select id, reply_to from notice where conversation is null'); +$notice = new Notice(); +$notice->query('select id, reply_to from notice where conversation is null'); -while ($nid->fetch()) { +while ($notice->fetch()) { $cid = null; - $notice = new Notice(); + $orig = clone($notice); - if (empty($nid->reply_to)) { - $cid = $nid->id; + if (empty($notice->reply_to)) { + $notice->conversation = $notice->id; } else { $reply = Notice::staticGet('id', $notice->reply_to); @@ -61,9 +61,7 @@ while ($nid->fetch()) { continue; } - $notice = null; $orig = null; - unset($notice); unset($orig); print ".\n"; diff --git a/scripts/getvaliddaemons.php b/scripts/getvaliddaemons.php index 7caea1bb7..99ad41b37 100755 --- a/scripts/getvaliddaemons.php +++ b/scripts/getvaliddaemons.php @@ -39,7 +39,6 @@ $daemons = array(); $daemons[] = INSTALLDIR.'/scripts/pluginqueuehandler.php'; $daemons[] = INSTALLDIR.'/scripts/ombqueuehandler.php'; -$daemons[] = INSTALLDIR.'/scripts/facebookqueuehandler.php'; $daemons[] = INSTALLDIR.'/scripts/pingqueuehandler.php'; if(common_config('xmpp','enabled')) { diff --git a/scripts/maildaemon.php b/scripts/maildaemon.php index 586bef624..84dff8912 100755 --- a/scripts/maildaemon.php +++ b/scripts/maildaemon.php @@ -365,6 +365,10 @@ class MailerDaemon if (preg_match('/^\s*Sent via/', $line)) { continue; } + if (preg_match('/^\s*Sent from my/', $line)) { + continue; + } + // skip everything after a sig if (preg_match('/^\s*--+\s*$/', $line) || preg_match('/^\s*__+\s*$/', $line)) |