diff --git a/actions/apifavoritecreate.php b/actions/apifavoritecreate.php index b890d4af69..3f639159cc 100644 --- a/actions/apifavoritecreate.php +++ b/actions/apifavoritecreate.php @@ -65,6 +65,12 @@ class ApiFavoriteCreateAction extends ApiAuthAction $this->user = $this->auth_user; $this->notice = Notice::staticGet($this->arg('id')); + if ($this->notice->repeat_of != '' ) { + common_log(LOG_DEBUG, 'Trying to Fave '.$this->notice->id.', repeat of '.$this->notice->repeat_of); + common_log(LOG_DEBUG, 'Will Fave '.$this->notice->repeat_of.' instead'); + $real_notice_id = $this->notice->repeat_of; + $this->notice = Notice::staticGet($real_notice_id); + } return true; } diff --git a/actions/apifavoritedestroy.php b/actions/apifavoritedestroy.php index db121ac882..59ca5c96df 100644 --- a/actions/apifavoritedestroy.php +++ b/actions/apifavoritedestroy.php @@ -65,6 +65,12 @@ class ApiFavoriteDestroyAction extends ApiAuthAction $this->user = $this->auth_user; $this->notice = Notice::staticGet($this->arg('id')); + if ($this->notice->repeat_of != '' ) { + common_log(LOG_DEBUG, 'Trying to unFave '.$this->notice->id); + common_log(LOG_DEBUG, 'Will unFave '.$this->notice->repeat_of.' instead'); + $real_notice_id = $this->notice->repeat_of; + $this->notice = Notice::staticGet($real_notice_id); + } return true; } diff --git a/actions/oauthappssettings.php b/actions/oauthappssettings.php index a7a4b219a3..c93a0a1580 100644 --- a/actions/oauthappssettings.php +++ b/actions/oauthappssettings.php @@ -31,6 +31,9 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } +require_once INSTALLDIR . '/lib/applicationlist.php'; +require_once INSTALLDIR . '/lib/statusnetoauthstore.php'; + /** * Show a user's registered OAuth applications * diff --git a/plugins/ClientSideShorten/ClientSideShortenPlugin.php b/plugins/ClientSideShorten/ClientSideShortenPlugin.php index 6379acd334..cc10929231 100644 --- a/plugins/ClientSideShorten/ClientSideShortenPlugin.php +++ b/plugins/ClientSideShorten/ClientSideShortenPlugin.php @@ -55,7 +55,7 @@ class ClientSideShortenPlugin extends Plugin $user = common_current_user(); $action->inlineScript('var maxNoticeLength = ' . User_urlshortener_prefs::maxNoticeLength($user)); $action->inlineScript('var maxUrlLength = ' . User_urlshortener_prefs::maxUrlLength($user)); - $action->script('plugins/ClientSideShorten/shorten.js'); + $action->script($this->path('shorten.js')); } } diff --git a/plugins/InfiniteScroll/InfiniteScrollPlugin.php b/plugins/InfiniteScroll/InfiniteScrollPlugin.php index 376d88abb0..cec1a53524 100644 --- a/plugins/InfiniteScroll/InfiniteScrollPlugin.php +++ b/plugins/InfiniteScroll/InfiniteScrollPlugin.php @@ -33,6 +33,9 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { class InfiniteScrollPlugin extends Plugin { + + public $on_next_only = false; + function __construct() { parent::__construct(); @@ -41,6 +44,7 @@ class InfiniteScrollPlugin extends Plugin function onEndShowScripts($action) { $action->inlineScript('var infinite_scroll_on_next_only = ' . ($this->on_next_only?'true':'false') . ';'); + $action->inlineScript('var ajax_loader_url = "' . ($this->path('ajax-loader.gif')) . '";'); $action->script($this->path('jquery.infinitescroll.js')); $action->script($this->path('infinitescroll.js')); } diff --git a/plugins/InfiniteScroll/infinitescroll.js b/plugins/InfiniteScroll/infinitescroll.js index f28c90a808..6fcf098dfe 100644 --- a/plugins/InfiniteScroll/infinitescroll.js +++ b/plugins/InfiniteScroll/infinitescroll.js @@ -9,7 +9,7 @@ jQuery(document).ready(function($){ 'body#showfavorites li.nav_next a,'+ 'body#showgroup li.nav_next a,'+ 'body#favorited li.nav_next a', - loadingImg : $('address .url')[0].href+'plugins/InfiniteScroll/ajax-loader.gif', + loadingImg : ajax_loader_url, text : "Loading the next set of posts...", donetext : "Congratulations, you\'ve reached the end of the Internet.", navSelector : "#pagination", diff --git a/plugins/OStatus/scripts/update_ostatus_profiles.php b/plugins/OStatus/scripts/update_ostatus_profiles.php index bca136bbbc..f0bc3e12dc 100644 --- a/plugins/OStatus/scripts/update_ostatus_profiles.php +++ b/plugins/OStatus/scripts/update_ostatus_profiles.php @@ -18,7 +18,7 @@ * along with this program. If not, see . */ -define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); +define('INSTALLDIR', realpath(dirname(__FILE__) . '/../../..')); $shortoptions = 'u:a'; $longoptions = array('uri=', 'all'); diff --git a/plugins/TwitterBridge/twitterimport.php b/plugins/TwitterBridge/twitterimport.php index 1c362d6fe8..e3b51c0908 100644 --- a/plugins/TwitterBridge/twitterimport.php +++ b/plugins/TwitterBridge/twitterimport.php @@ -172,8 +172,8 @@ class TwitterImport $notice->is_local = Notice::GATEWAY; - $notice->content = html_entity_decode($status->text, ENT_QUOTES, 'UTF-8'); - $notice->rendered = $this->linkify($status); + $notice->content = html_entity_decode($this->linkify($status, FALSE), ENT_QUOTES, 'UTF-8'); + $notice->rendered = $this->linkify($status, TRUE); if (Event::handle('StartNoticeSave', array(&$notice))) { @@ -540,7 +540,7 @@ class TwitterImport const HASHTAG = 2; const MENTION = 3; - function linkify($status) + function linkify($status, $html = FALSE) { $text = $status->text; @@ -596,13 +596,21 @@ class TwitterImport $orig = $this->twitEscape(mb_substr($text, $start, $end - $start)); switch($type) { case self::URL: - $linkText = $this->makeUrlLink($object, $orig); + $linkText = $this->makeUrlLink($object, $orig, $html); break; case self::HASHTAG: - $linkText = $this->makeHashtagLink($object, $orig); + if ($html) { + $linkText = $this->makeHashtagLink($object, $orig); + }else{ + $linkText = $orig; + } break; case self::MENTION: - $linkText = $this->makeMentionLink($object, $orig); + if ($html) { + $linkText = $this->makeMentionLink($object, $orig); + }else{ + $linkText = $orig; + } break; default: $linkText = $orig; @@ -630,9 +638,13 @@ class TwitterImport return htmlspecialchars(html_entity_decode($str, ENT_COMPAT, 'UTF-8')); } - function makeUrlLink($object, $orig) + function makeUrlLink($object, $orig, $html) { - return "{$orig}"; + if ($html) { + return ''.htmlspecialchars($object->display_url).''; + }else{ + return htmlspecialchars($object->expanded_url); + } } function makeHashtagLink($object, $orig)