From d995fc3994a065d068679edb09afd03483079f10 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Fri, 15 May 2015 20:56:05 +0200 Subject: [PATCH] The intelligent shortening for social media systems like Twitter, GNU Social and App.net can now be disabled. --- include/plaintext.php | 2 ++ mod/settings.php | 23 +++++++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/include/plaintext.php b/include/plaintext.php index 88febbfff..c8cdfa57d 100644 --- a/include/plaintext.php +++ b/include/plaintext.php @@ -182,6 +182,8 @@ function plaintext($a, $b, $limit = 0, $includedlinks = false, $htmlmode = 2) { $post["url"] = $b["plink"]; } elseif (strpos($b["body"], "[share") !== false) $post["url"] = $b["plink"]; + elseif (get_pconfig($b["uid"], "system", "no_intelligent_shortening")) + $post["url"] = $b["plink"]; $msg = shortenmsg($msg, $limit); } diff --git a/mod/settings.php b/mod/settings.php index 7db196b03..da987260c 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -177,7 +177,9 @@ function settings_post(&$a) { check_form_security_token_redirectOnErr('/settings/connectors', 'settings_connectors'); - if(x($_POST, 'imap-submit')) { + if(x($_POST, 'general-submit')) { + set_pconfig(local_user(), 'system', 'no_intelligent_shortening', $_POST['no_intelligent_shortening']); + } elseif(x($_POST, 'imap-submit')) { $mail_server = ((x($_POST,'mail_server')) ? $_POST['mail_server'] : ''); $mail_port = ((x($_POST,'mail_port')) ? $_POST['mail_port'] : ''); @@ -733,7 +735,24 @@ function settings_content(&$a) { if(($a->argc > 1) && ($a->argv[1] === 'connectors')) { - $settings_connectors = ""; + $settings_connectors = ''; + $settings_connectors .= '

'. t('General Social Media Settings').'

'; + $settings_connectors .= '
'; + $settings_connectors .= '
'; call_hooks('connector_settings', $settings_connectors);