forked from GNUsocial/gnu-social
Merge branch 'master' into 1.0.x
Conflicts: plugins/Blacklist/BlacklistPlugin.php
This commit is contained in:
@@ -505,14 +505,16 @@ class BlacklistPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
$nickname = strtolower($actor->poco->preferredUsername);
|
||||
if (!empty($actor->poco)) {
|
||||
$nickname = strtolower($actor->poco->preferredUsername);
|
||||
|
||||
if (!empty($nickname)) {
|
||||
if (!$this->_checkNickname($nickname)) {
|
||||
// TRANS: Exception thrown trying to post a notice while having a blocked nickname. %s is the blocked nickname.
|
||||
$msg = sprintf(_m("Notices from nickname \"%s\" are disallowed."),
|
||||
$nickname);
|
||||
throw new ClientException($msg);
|
||||
if (!empty($nickname)) {
|
||||
if (!$this->_checkNickname($nickname)) {
|
||||
// TRANS: Exception thrown trying to post a notice while having a blocked nickname. %s is the blocked nickname.
|
||||
$msg = sprintf(_m("Notices from nickname \"%s\" disallowed."),
|
||||
$nickname);
|
||||
throw new ClientException($msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -572,4 +572,20 @@ class BookmarkPlugin extends MicroAppPlugin
|
||||
$notice->update($original);
|
||||
}
|
||||
}
|
||||
|
||||
public function activityObjectOutputJson(ActivityObject $obj, array &$out)
|
||||
{
|
||||
assert($obj->type == ActivityObject::BOOKMARK);
|
||||
|
||||
$bm = Bookmark::staticGet('uri', $obj->id);
|
||||
|
||||
if (empty($bm)) {
|
||||
throw new ServerException("Unknown bookmark: " . $obj->id);
|
||||
}
|
||||
|
||||
$out['displayName'] = $bm->title;
|
||||
$out['targetUrl'] = $bm->url;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@@ -176,7 +176,8 @@ class Facebookclient
|
||||
|
||||
// If it's not a reply, or if the user WANTS to send @-replies,
|
||||
// then, yeah, it can go to Facebook.
|
||||
if (!preg_match('/@[a-zA-Z0-9_]{1,15}\b/u', $this->notice->content) ||
|
||||
|
||||
if (empty($this->notice->reply_to) ||
|
||||
($this->flink->noticesync & FOREIGN_NOTICE_SEND_REPLY)) {
|
||||
return true;
|
||||
}
|
||||
|
41
plugins/OStatus/scripts/gcfeeds.php
Normal file
41
plugins/OStatus/scripts/gcfeeds.php
Normal file
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
/*
|
||||
* StatusNet - a distributed open-source microblogging tool
|
||||
* Copyright (C) 2010, 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__) . '/../../..'));
|
||||
|
||||
$helptext = <<<END_OF_HELP
|
||||
gcfeeds.php [options]
|
||||
Clean up feeds that no longer have subscribers.
|
||||
|
||||
END_OF_HELP;
|
||||
|
||||
require_once INSTALLDIR.'/scripts/commandline.inc';
|
||||
|
||||
$feedsub = new FeedSub();
|
||||
|
||||
while ($feedsub->fetch()) {
|
||||
print $feedsub->uri . "(" . $feedsub->sub_state . ")";
|
||||
$result = $feedsub->garbageCollect();
|
||||
if ($result) {
|
||||
print " INACTIVE\n";
|
||||
} else {
|
||||
print " ACTIVE\n";
|
||||
}
|
||||
}
|
@@ -223,6 +223,7 @@ class RegisterThrottlePlugin extends Plugin
|
||||
private function _getIpAddress()
|
||||
{
|
||||
$keys = array('HTTP_X_FORWARDED_FOR',
|
||||
'HTTP_X_CLIENT',
|
||||
'CLIENT-IP',
|
||||
'REMOTE_ADDR');
|
||||
|
||||
|
@@ -65,6 +65,9 @@ class SphinxSearch extends SearchEngine
|
||||
function query($q)
|
||||
{
|
||||
$result = $this->sphinx->query($q, $this->remote_table());
|
||||
if ($result === false) {
|
||||
throw new ServerException($this->sphinx->getLastError());
|
||||
}
|
||||
if (!isset($result['matches'])) return false;
|
||||
$id_set = join(', ', array_keys($result['matches']));
|
||||
$this->target->whereAdd("id in ($id_set)");
|
||||
|
@@ -157,6 +157,10 @@ class SubMirrorPlugin extends Plugin
|
||||
*/
|
||||
function onOstatus_profileSubscriberCount($oprofile, &$count)
|
||||
{
|
||||
if (empty($oprofile) || !($oprofile instanceof Ostatus_profile)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($oprofile->profile_id) {
|
||||
$mirror = new SubMirror();
|
||||
$mirror->subscribed = $oprofile->profile_id;
|
||||
@@ -166,6 +170,7 @@ class SubMirrorPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -157,7 +157,7 @@ class SubMirror extends Memcached_DataObject
|
||||
{
|
||||
$profile = Profile::staticGet('id', $this->subscriber);
|
||||
if (!$profile) {
|
||||
common_log(LOG_ERROR, "SubMirror plugin skipping auto-repeat of notice $notice->id for missing user $profile->id");
|
||||
common_log(LOG_ERR, "SubMirror plugin skipping auto-repeat of notice $notice->id for missing user $profile->id");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -339,7 +339,7 @@ class TwitterBridgePlugin extends Plugin
|
||||
$versions[] = array(
|
||||
'name' => 'TwitterBridge',
|
||||
'version' => self::VERSION,
|
||||
'author' => 'Zach Copley, Julien C',
|
||||
'author' => 'Zach Copley, Julien C, Jean Baptiste Favre',
|
||||
'homepage' => 'http://status.net/wiki/Plugin:TwitterBridge',
|
||||
// TRANS: Plugin description.
|
||||
'rawdescription' => _m('The Twitter "bridge" plugin allows integration ' .
|
||||
|
@@ -116,13 +116,13 @@ function is_twitter_bound($notice, $flink) {
|
||||
}
|
||||
|
||||
// Check to see if notice should go to Twitter
|
||||
if (!empty($flink) && ($flink->noticesync & FOREIGN_NOTICE_SEND == FOREIGN_NOTICE_SEND)) {
|
||||
if (!empty($flink) && (($flink->noticesync & FOREIGN_NOTICE_SEND) == FOREIGN_NOTICE_SEND)) {
|
||||
|
||||
// If it's not a Twitter-style reply, or if the user WANTS to send replies,
|
||||
// or if it's in reply to a twitter notice
|
||||
if (!preg_match('/^@[a-zA-Z0-9_]{1,15}\b/u', $notice->content) ||
|
||||
($flink->noticesync & FOREIGN_NOTICE_SEND_REPLY == FOREIGN_NOTICE_SEND_REPLY) ||
|
||||
is_twitter_notice($notice->reply_to)) {
|
||||
if ( (($flink->noticesync & FOREIGN_NOTICE_SEND_REPLY) == FOREIGN_NOTICE_SEND_REPLY) ||
|
||||
(is_twitter_notice($notice->reply_to) || is_twitter_notice($notice->repeat_of)) ||
|
||||
(empty($notice->reply_to) && !preg_match('/^@[a-zA-Z0-9_]{1,15}\b/u', $notice->content)) ){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user