Merge pull request #6380 from MrPetovan/bug/5148-get-cookies-from-safari
authorMichael Vogel <icarus@dabo.de>
Sun, 6 Jan 2019 19:37:33 +0000 (20:37 +0100)
committerGitHub <noreply@github.com>
Sun, 6 Jan 2019 19:37:33 +0000 (20:37 +0100)
Change stylesheet path name for mobile browsers

boot.php
doc/de/FAQ.md
doc/translations.md
mod/admin.php
mod/lostpass.php
src/Model/APContact.php
src/Model/User.php
src/Protocol/Diaspora.php
src/Protocol/OStatus.php
view/templates/head.tpl
view/theme/frio/templates/head.tpl

index be217ea..4b95c89 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -35,7 +35,7 @@ use Friendica\Util\DateTimeFormat;
 
 define('FRIENDICA_PLATFORM',     'Friendica');
 define('FRIENDICA_CODENAME',     'The Tazmans Flax-lily');
-define('FRIENDICA_VERSION',      '2018.12-rc');
+define('FRIENDICA_VERSION',      '2019.01-rc');
 define('DFRN_PROTOCOL_VERSION',  '2.23');
 define('NEW_UPDATE_ROUTINE_VERSION', 1170);
 
@@ -868,4 +868,4 @@ function rdirname($path, $levels = 1)
        } else {
                return dirname($path);
        }
-}
\ No newline at end of file
+}
index 0c77635..0317a35 100644 (file)
@@ -8,6 +8,7 @@ Nutzer
 * **[Warum erhalte ich Warnungen über fehlende Zertifikate?](help/FAQ#ssl)**
 * **[Wie kann ich Bilder, Dateien, Links, Video und Audio in Beiträge einfügen?](help/FAQ#upload)**
 * **[Ist es möglich, bei mehreren Profilen verschiedene Avatare (Nutzerbilder) zu haben?](help/FAQ#avatars)**
+* **[Wie kann ich Friendica in einer bestimmten Sprache ansehen?](help/FAQ#language)**
 * **[Was ist der Unterschied zwischen blockierten|ignorierten|archivierten|versteckten Kontakten?](help/FAQ#contacts)**
 * **[Was passiert, wenn ein Account gelöscht ist? Ist dieser richtig gelöscht?](help/FAQ#removed)**
 * **[Kann ich einem Hashtag folgen?](help/FAQ#hashtag)**
@@ -90,6 +91,31 @@ Anschließend siehst Du eine Seite mit allen Infos zu diesem Profil.
 Klicke nun oben auf den Link "Profilbild ändern" und lade im nächsten Fenster ein Bild von Deinem PC hoch.
 Um Deine privaten Daten zu schützen, wird in Beiträgen nur das Bild aus Deinem öffentlichen Profil angezeigt.
 
+<a name="language"></a>
+### Wie kann ich Friendica in einer bestimmten Sprache ansehen?
+
+Die Sprache des Friendica Interfaces kann durch den `lang` Parameter un der URL beeinflusst werden.
+Das Argument des Parameters ist ein  [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)  Code.
+Zwischen der URL und dem Parameter muss ein Fragezeichen als Trennzeichen verwendet werden.
+
+Ein Beispiel:
+
+     https://social.example.com/profile/example 
+
+auf Deutsch:
+
+     https://social.example.com/profile/example?lang=de.
+
+Wenn das Fragezeichen bereits in der URL verwendet wird, werden die einzelnen URL Parameter mit einem kaufmännischen Und getrennt werden.
+
+Ein Beispiel:
+
+    https://social.example.com/profile/example?tab=profile
+
+auf Deutsch:
+
+    https://social.example.com/profile/example?tab=profile&lang=de.
+
 <a name="contacts"></a>
 ### Was ist der Unterschied zwischen blockierten|ignorierten|archivierten|versteckten Kontakten?
 
index 24b3d8b..9ecd8f6 100644 (file)
@@ -20,7 +20,7 @@ Thank you for your interest in improving Friendica's translation!
 Please register a free Transifex account and ask over at [the Transifex Friendica page](https://www.transifex.com/Friendica/friendica/dashboard/) to join the translation team for your favorite language.
 
 As a rule of thumb, we add support for a language in Friendica when at least 50% of the strings have been translated to avoid a scattered experience.
-For addons, we add support for a language when all the strings for this addon have been translated and only if we already support the language in Friendica.
+For addons, we add support for a language when if we already support the language in Friendica.
 
 ## Add new translation strings
 
index c0ad281..1cbe24e 100644 (file)
@@ -1752,7 +1752,7 @@ function admin_page_users_post(App $a)
                        Thank you and welcome to %4$s.'));
 
                $preamble = sprintf($preamble, $user['username'], Config::get('config', 'sitename'));
-               $body = sprintf($body, System::baseUrl(), $user['email'], $result['password'], Config::get('config', 'sitename'));
+               $body = sprintf($body, System::baseUrl(), $user['nickname'], $result['password'], Config::get('config', 'sitename'));
 
                notification([
                        'type'     => SYSTEM_EMAIL,
index 39209af..d36d329 100644 (file)
@@ -21,7 +21,7 @@ function lostpass_post(App $a)
        }
 
        $condition = ['(`email` = ? OR `nickname` = ?) AND `verified` = 1 AND `blocked` = 0', $loginame, $loginame];
-       $user = DBA::selectFirst('user', ['uid', 'username', 'email', 'language'], $condition);
+       $user = DBA::selectFirst('user', ['uid', 'username', 'nickname', 'email', 'language'], $condition);
        if (!DBA::isResult($user)) {
                notice(L10n::t('No valid account found.') . EOL);
                $a->internalRedirect();
@@ -63,7 +63,7 @@ function lostpass_post(App $a)
                The login details are as follows:
 
                Site Location:  %2$s
-               Login Name:     %3$s', $resetlink, System::baseUrl(), $user['email']));
+               Login Name:     %3$s', $resetlink, System::baseUrl(), $user['nickname']));
 
        notification([
                'type'     => SYSTEM_EMAIL,
@@ -85,7 +85,7 @@ function lostpass_content(App $a)
        if ($a->argc > 1) {
                $pwdreset_token = $a->argv[1];
 
-               $user = DBA::selectFirst('user', ['uid', 'username', 'email', 'pwdreset_time', 'language'], ['pwdreset' => $pwdreset_token]);
+               $user = DBA::selectFirst('user', ['uid', 'username', 'nickname', 'email', 'pwdreset_time', 'language'], ['pwdreset' => $pwdreset_token]);
                if (!DBA::isResult($user)) {
                        notice(L10n::t("Request could not be verified. \x28You may have previously submitted it.\x29 Password reset failed."));
 
@@ -161,7 +161,7 @@ function lostpass_generate_password($user)
                        Password:       %3$s
 
                        You may change that password from your account settings page after logging in.
-               ', System::baseUrl(), $user['email'], $new_password));
+               ', System::baseUrl(), $user['nickname'], $new_password));
 
                notification([
                        'type'     => SYSTEM_EMAIL,
index bbaf6da..5f47313 100644 (file)
@@ -61,7 +61,7 @@ class APContact extends BaseObject
         * Fetches a profile from a given url
         *
         * @param string  $url    profile url
-        * @param boolean $update true = always update, false = never update, null = update when not found
+        * @param boolean $update true = always update, false = never update, null = update when not found or outdated
         * @return array profile array
         */
        public static function getByURL($url, $update = null)
@@ -71,18 +71,22 @@ class APContact extends BaseObject
                }
 
                if (empty($update)) {
+                       if (is_null($update)) {
+                               $ref_update = DateTimeFormat::utc('now - 1 month');
+                       } else {
+                               $ref_update = DBA::NULL_DATETIME;
+                       }
+
                        $apcontact = DBA::selectFirst('apcontact', [], ['url' => $url]);
-                       if (DBA::isResult($apcontact)) {
-                               return $apcontact;
+                       if (!DBA::isResult($apcontact)) {
+                               $apcontact = DBA::selectFirst('apcontact', [], ['alias' => $url]);
                        }
 
-                       $apcontact = DBA::selectFirst('apcontact', [], ['alias' => $url]);
-                       if (DBA::isResult($apcontact)) {
-                               return $apcontact;
+                       if (!DBA::isResult($apcontact)) {
+                               $apcontact = DBA::selectFirst('apcontact', [], ['addr' => $url]);
                        }
 
-                       $apcontact = DBA::selectFirst('apcontact', [], ['addr' => $url]);
-                       if (DBA::isResult($apcontact)) {
+                       if (DBA::isResult($apcontact) && ($apcontact['updated'] > $ref_update)) {
                                return $apcontact;
                        }
 
@@ -185,6 +189,22 @@ class APContact extends BaseObject
 
                // Update some data in the contact table with various ways to catch them all
                $contact_fields = ['name' => $apcontact['name'], 'about' => $apcontact['about']];
+
+               // Fetch the type and match it with the contact type
+               $contact_types = array_keys(ActivityPub::ACCOUNT_TYPES, $apcontact['type']);
+               if (!empty($contact_types)) {
+                       $contact_type = array_pop($contact_types);
+                       if (is_int($contact_type)) {
+                               $contact_fields['contact-type'] = $contact_type;
+
+                               // Resetting the 'forum' and 'prv' field when it isn't a forum
+                               if ($contact_fields['contact-type'] != Contact::ACCOUNT_TYPE_COMMUNITY) {
+                                       $contact_fields['forum'] = false;
+                                       $contact_fields['prv'] = false;
+                               }
+                       }
+               }
+
                DBA::update('contact', $contact_fields, ['nurl' => Strings::normaliseLink($url)]);
 
                $contacts = DBA::select('contact', ['uid', 'id'], ['nurl' => Strings::normaliseLink($url)]);
@@ -194,6 +214,9 @@ class APContact extends BaseObject
                DBA::close($contacts);
 
                // Update the gcontact table
+               // These two fields don't exist in the gcontact table
+               unset($contact_fields['forum']);
+               unset($contact_fields['prv']);
                DBA::update('gcontact', $contact_fields, ['nurl' => Strings::normaliseLink($url)]);
 
                Logger::log('Updated profile for ' . $url, Logger::DEBUG);
index c71ae47..a1a722f 100644 (file)
@@ -771,7 +771,7 @@ class User
                        If you ever want to delete your account, you can do so at %3$s/removeme
 
                        Thank you and welcome to %2$s.',
-                       $user['email'], $sitename, $siteurl, $user['username'], $password
+                       $user['nickname'], $sitename, $siteurl, $user['username'], $password
                ));
 
                return notification([
index b4e4941..152bc38 100644 (file)
@@ -1326,15 +1326,8 @@ class Diaspora
                        $x = false;
                }
 
-               // This will work for older Diaspora and Friendica servers
                if (!$x) {
-                       $source_url = $server."/p/".urlencode($guid).".xml";
-                       Logger::log("Fetch post from ".$source_url, Logger::DEBUG);
-
-                       $x = Network::fetchUrl($source_url);
-                       if (!$x) {
-                               return false;
-                       }
+                       return false;
                }
 
                $source_xml = XML::parseString($x);
index 1a6f748..1a6ce23 100644 (file)
@@ -1228,7 +1228,7 @@ class OStatus
        {
                $siteinfo = BBCode::getAttachedData($body);
 
-               if (($siteinfo["type"] == "photo")) {
+               if (($siteinfo["type"] == "photo") && (!empty($siteinfo["preview"]) || !empty($siteinfo["image"]))) {
                        if (isset($siteinfo["preview"])) {
                                $preview = $siteinfo["preview"];
                        } else {
index e76b97b..8631d76 100644 (file)
@@ -19,7 +19,7 @@
 <link rel="manifest" href="{{$baseurl}}/manifest" />
 <script>
 // Prevents links to switch to Safari in a home screen app - see https://gist.github.com/irae/1042167
-(function(a,b,c){if(c in b&&b[c]){var d,e=a.location,f=/^(a|html)$/i;a.addEventListener("click",function(a){d=a.target;while(!f.test(d.nodeName))d=d.parentNode;"href"in d&&(chref=d.href).replace(e.href,"").indexOf("#")&&(!/^[a-z\+\.\-]+:/i.test(chref)||chref.indexOf(e.protocol+"//"+e.host)===0)&&(a.preventDefault(),e.href=d.href)},!1)}})(document,window.navigator,"standalone");
+(function(a,b,c){if(c in b&&b[c]){var d,e=a.location,f=/^(a|html)$/i;a.addEventListener("click",function(a){d=a.target;while(!f.test(d.nodeName))d=d.parentNode;"href"in d&&(chref=d.href).replace("{{$baseurl}}/", "").replace(e.href,"").indexOf("#")&&(!/^[a-z\+\.\-]+:/i.test(chref)||chref.indexOf(e.protocol+"//"+e.host)===0)&&(a.preventDefault(),e.href=d.href)},!1)}})(document,window.navigator,"standalone");
 </script>
 
 <link rel="search"
index d8f8b1d..e1805f7 100644 (file)
@@ -40,7 +40,7 @@
 <link rel="manifest" href="{{$baseurl}}/manifest" />
 <script type="text/javascript">
 // Prevents links to switch to Safari in a home screen app - see https://gist.github.com/irae/1042167
-(function(a,b,c){if(c in b&&b[c]){var d,e=a.location,f=/^(a|html)$/i;a.addEventListener("click",function(a){d=a.target;while(!f.test(d.nodeName))d=d.parentNode;"href"in d&&(chref=d.href).replace(e.href,"").indexOf("#")&&(!/^[a-z\+\.\-]+:/i.test(chref)||chref.indexOf(e.protocol+"//"+e.host)===0)&&(a.preventDefault(),e.href=d.href)},!1)}})(document,window.navigator,"standalone");
+(function(a,b,c){if(c in b&&b[c]){var d,e=a.location,f=/^(a|html)$/i;a.addEventListener("click",function(a){d=a.target;while(!f.test(d.nodeName))d=d.parentNode;"href"in d&&(chref=d.href).replace("{{$baseurl}}/", "").replace(e.href,"").indexOf("#")&&(!/^[a-z\+\.\-]+:/i.test(chref)||chref.indexOf(e.protocol+"//"+e.host)===0)&&(a.preventDefault(),e.href=d.href)},!1)}})(document,window.navigator,"standalone");
 </script>
 
 <link rel="search"