Merge branch '0.8.x' of git@gitorious.org:+laconica-developers/laconica/dev into 0.8.x

This commit is contained in:
Evan Prodromou 2009-06-22 14:32:40 -07:00
commit 2c4486401d
3 changed files with 57 additions and 45 deletions

View File

@ -118,12 +118,20 @@ class MySQLSearch extends SearchEngine
}
return true;
} else if ('identica_notices' === $this->table) {
// Don't show imported notices
$this->target->whereAdd('notice.is_local != ' . NOTICE_GATEWAY);
if (strtolower($q) != $q) {
$this->target->whereAdd("( MATCH(content) AGAINST ('" . addslashes($q) .
"' IN BOOLEAN MODE)) OR ( MATCH(content) " .
"AGAINST ('" . addslashes(strtolower($q)) .
"' IN BOOLEAN MODE))");
} else {
$this->target->whereAdd('MATCH(content) ' .
'AGAINST (\''.addslashes($q).'\' IN BOOLEAN MODE)');
if (strtolower($q) != $q) {
$this->target->whereAdd('MATCH(content) ' .
'AGAINST (\''.addslashes(strtolower($q)).'\' IN BOOLEAN MODE)', 'OR');
}
return true;
} else {
throw new ServerException('Unknown table: ' . $this->table);
@ -160,6 +168,9 @@ class PGSearch extends SearchEngine
if ('identica_people' === $this->table) {
return $this->target->whereAdd('textsearch @@ plainto_tsquery(\''.addslashes($q).'\')');
} else if ('identica_notices' === $this->table) {
// XXX: We need to filter out gateway notices (notice.is_local = -2) --Zach
return $this->target->whereAdd('to_tsvector(\'english\', content) @@ plainto_tsquery(\''.addslashes($q).'\')');
} else {
throw new ServerException('Unknown table: ' . $this->table);

View File

@ -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

View File

@ -25,7 +25,7 @@ source src2
sql_db = identi_ca
sql_port = 3306
sql_query = SELECT id, UNIX_TIMESTAMP(created) as created_ts, content FROM notice
sql_query_info = SELECT * FROM notice where id = $id
sql_query_info = SELECT * FROM notice where notice.id = $id AND notice.is_local != -2
sql_attr_timestamp = created_ts
}