From cec634f99ddbdbea91b60b484fff83aa084b34e8 Mon Sep 17 00:00:00 2001 From: "Shnoulle (Denis Chenu)" Date: Fri, 21 Apr 2017 00:48:41 +0200 Subject: [PATCH] [dev] One function to rules them all --- actions/qvitter.php | 27 +++++++++++++++++++-------- js/misc-functions.js | 24 ++++++++---------------- 2 files changed, 27 insertions(+), 24 deletions(-) diff --git a/actions/qvitter.php b/actions/qvitter.php index 6462bc9..6a00124 100644 --- a/actions/qvitter.php +++ b/actions/qvitter.php @@ -107,14 +107,24 @@ class QvitterAction extends ApiAction } else { $attachmentroot = common_path('attachment/', StatusNet::isHTTPS()); } + $avatarconfig=common_config('avatar'); + if($avatarconfig['server']) { + if(StatusNet::isHTTPS() ){ + $avatarroot ='https://'.$avatarconfig['server'].$avatarconfig['path']; + } elseif(!StatusNet::isHTTPS()) { + $avatarroot ='http://'.$avatarconfig['server'].$avatarconfig['path']; + } + } else { + $attachmentroot = common_path('attachment/', StatusNet::isHTTPS()); + } $instanceurl = common_path('', StatusNet::isHTTPS()); - $favicon_path = QvitterPlugin::settings("favicon_path"); + $favicon_path = QvitterPlugin::settings("favicon_path"); - // user's browser's language setting - $user_browser_language = 'en'; // use english if we can't find the browser language - if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { - $user_browser_language = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); - } + // user's browser's language setting + $user_browser_language = 'en'; // use english if we can't find the browser language + if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { + $user_browser_language = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); + } common_set_returnto(''); // forget this @@ -379,15 +389,16 @@ class QvitterAction extends ApiAction window.customWelcomeText = ; window.urlShortenerAPIURL = ''; window.urlShortenerSignature = ''; - window.urlshortenerFormat = ''; + window.urlshortenerFormat = ''; window.commonSessionToken = ''; window.siteMaxThumbnailSize = ; window.siteAttachmentURLBase = ''; + window.siteAvatarURLBase = ''; window.siteEmail = ''; window.siteLicenseTitle = ''; window.siteLicenseURL = ''; window.customTermsOfUse = ; - window.siteLocalOnlyDefaultPath = ; + window.siteLocalOnlyDefaultPath = ;