]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #3961 from MrPetovan/task/3946-use-random-bytes
authorMichael Vogel <icarus@dabo.de>
Sun, 26 Nov 2017 13:24:48 +0000 (14:24 +0100)
committerGitHub <noreply@github.com>
Sun, 26 Nov 2017 13:24:48 +0000 (14:24 +0100)
Use random_bytes() in random_string()

doc/de/events.md
doc/events.md
mod/contacts.php
mod/item.php
util/make_credits.py
view/templates/contact_edit.tpl
view/theme/frio/templates/contact_edit.tpl
view/theme/vier/templates/contact_edit.tpl

index 4da36a746458afb6f803998dee88086b5daeb49f..809b8c0e48d2f470668648bec2112c38fbecc2c0 100644 (file)
@@ -58,9 +58,3 @@ Zusätzlich können sie sagen ob sie teilnehmen, oder vielleicht teilnehmen an d
 Wenn du deine öffentlichen Kalender Einträge exportieren möchtest, kannst du dies in den Einstellungen aktivieren (Einstellungen -> Zusätzliche Features -> Allgemeine Features -> Öffentlichen Kalender exportieren).
 Im Anschluss sind auf der Veranstaltungs-Übersichtsseite zwei Links zu den exportierten Einträgen (im ical oder csv Format) verfügbar.
 
-### Addons
-
-#### OpenStreetMap
-
-Wenn du diese Addon aktivierst auf deinem Frendica-Knoten, wird der Inhalt des Ort-Feldes mit den Identifikations-Service von OpenStreetMap verbunden, wenn du die Veranstaltung postest.
-Wenn Openstreetmap etwas passendes findet, wird eine Karte mit dem Ort automatisch eingebettet, am Ende der Veranstalltungsanzeige.
index eb6b77d331c4fec86b28ab560921f9cf95c193aa..be0040d298c6dc9d17abe5d558a91a9d1dc82b5f 100644 (file)
@@ -67,10 +67,3 @@ Furthermore they can announce that they will attend, not attend or may-be attend
 If you want to export your public events to ical or csv, you can activate an additional feature in your user settings (Additional features -> General Features -> Export Public Calendar).
 Afterwards a link will be shown in the events page of your profile to access the calendar.
 
-### Addons
-
-#### OpenStreetMap
-
-If this addon is activated on your friendica node, the content of the location field will be matched with the identification service of OSM when you submit the event.
-Should OSM find anything matching, a map for the location will be embedded automatically at the end of the events view.
-
index 8889e65131747e21cd66c28bae3e4933a5e5baf5..35be8e79e3f21efaad3494b98f569a0baf6c68eb 100644 (file)
@@ -647,6 +647,7 @@ function contacts_content(App $a) {
                        '$blocked' => (($contact['blocked']) ? t('Currently blocked') : ''),
                        '$ignored' => (($contact['readonly']) ? t('Currently ignored') : ''),
                        '$archived' => (($contact['archive']) ? t('Currently archived') : ''),
+                       '$pending' => (($contact['pending']) ? t('Awaiting connection acknowledge') : ''),
                        '$hidden' => array('hidden', t('Hide this contact from others'), ($contact['hidden'] == 1), t('Replies/likes to your public posts <strong>may</strong> still be visible')),
                        '$notify' => array('notify', t('Notification for new posts'), ($contact['notify_new_posts'] == 1), t('Send a notification of every new post of this contact')),
                        '$fetch_further_information' => $fetch_further_information,
index 4aafa22995667e083bb1f92abd4628280ad26865..8ae99948a103e5addc49cefb83a86259622c410e 100644 (file)
@@ -423,6 +423,112 @@ function item_post(App $a) {
                }
        }
 
+       // Look for any tags and linkify them
+       $str_tags = '';
+       $inform   = '';
+
+       $tags = get_tags($body);
+
+       /*
+        * add a statusnet style reply tag if the original post was from there
+        * and we are replying, and there isn't one already
+        */
+       if ($parent && ($parent_contact['network'] == NETWORK_OSTATUS)) {
+               $contact = '@[url=' . $parent_contact['url'] . ']' . $parent_contact['nick'] . '[/url]';
+
+               if (!in_array($contact, $tags)) {
+                       $body = $contact . ' ' . $body;
+                       $tags[] = $contact;
+               }
+
+               $toplevel_contact = "";
+               $toplevel_parent = q("SELECT `contact`.* FROM `contact`
+                                               INNER JOIN `item` ON `item`.`contact-id` = `contact`.`id` AND `contact`.`url` = `item`.`author-link`
+                                               WHERE `item`.`id` = `item`.`parent` AND `item`.`parent` = %d", intval($parent));
+               if (DBM::is_result($toplevel_parent)) {
+                       if (!empty($toplevel_parent[0]['addr'])) {
+                               $toplevel_contact = '@' . $toplevel_parent[0]['addr'];
+                       } else {
+                               $toplevel_contact = '@' . $toplevel_parent[0]['nick'] . '+' . $toplevel_parent[0]['id'];
+                       }
+               } else {
+                       $toplevel_parent = q("SELECT `author-link`, `author-name` FROM `item` WHERE `id` = `parent` AND `parent` = %d", intval($parent));
+                       $toplevel_contact = '@[url=' . $toplevel_parent[0]['author-link'] . ']' . $toplevel_parent[0]['author-name'] . '[/url]';
+               }
+
+               if (!in_array($toplevel_contact, $tags)) {
+                       $tags[] = $toplevel_contact;
+               }
+       }
+
+       $tagged = array();
+
+       $private_forum = false;
+       $only_to_forum = false;
+       $forum_contact = array();
+
+       if (count($tags)) {
+               foreach ($tags as $tag) {
+
+                       $tag_type = substr($tag, 0, 1);
+
+                       if ($tag_type == '#') {
+                               continue;
+                       }
+
+                       /*
+                        * If we already tagged 'Robert Johnson', don't try and tag 'Robert'.
+                        * Robert Johnson should be first in the $tags array
+                        */
+                       $fullnametagged = false;
+                       /// @TODO $tagged is initialized above if() block and is not filled, maybe old-lost code?
+                       foreach ($tagged as $nextTag) {
+                               if (stristr($nextTag, $tag . ' ')) {
+                                       $fullnametagged = true;
+                                       break;
+                               }
+                       }
+                       if ($fullnametagged) {
+                               continue;
+                       }
+
+                       $success = handle_tag($a, $body, $inform, $str_tags, (local_user()) ? local_user() : $profile_uid , $tag, $network);
+                       if ($success['replaced']) {
+                               $tagged[] = $tag;
+                       }
+                       // When the forum is private or the forum is addressed with a "!" make the post private
+                       if (is_array($success['contact']) && ($success['contact']['prv'] || ($tag_type == '!'))) {
+                               $private_forum = $success['contact']['prv'];
+                               $only_to_forum = ($tag_type == '!');
+                               $private_id = $success['contact']['id'];
+                               $forum_contact = $success['contact'];
+                       } elseif (is_array($success['contact']) && $success['contact']['forum'] &&
+                               ($str_contact_allow == '<' . $success['contact']['id'] . '>')) {
+                               $private_forum = false;
+                               $only_to_forum = true;
+                               $private_id = $success['contact']['id'];
+                               $forum_contact = $success['contact'];
+                       }
+               }
+       }
+
+       if (!$parent && count($forum_contact) && ($private_forum || $only_to_forum)) {
+               // we tagged a forum in a top level post. Now we change the post
+               $private = $private_forum;
+
+               $str_group_allow = '';
+               $str_contact_deny = '';
+               $str_group_deny = '';
+               if ($private_forum) {
+                       $str_contact_allow = '<' . $private_id . '>';
+               } else {
+                       $str_contact_allow = '';
+               }
+               $contact_id = $private_id;
+               $contact_record = $forum_contact;
+               $_REQUEST['origin'] = false;
+       }
+
        /*
         * When a photo was uploaded into the message using the (profile wall) ajax
         * uploader, The permissions are initially set to disallow anybody but the
@@ -435,7 +541,7 @@ function item_post(App $a) {
 
        $match = null;
 
-       if ((! $preview) && preg_match_all("/\[img([\=0-9x]*?)\](.*?)\[\/img\]/",$body,$match)) {
+       if (!$preview && preg_match_all("/\[img([\=0-9x]*?)\](.*?)\[\/img\]/",$body,$match)) {
                $images = $match[2];
                if (count($images)) {
 
@@ -529,122 +635,16 @@ function item_post(App $a) {
                require_once 'include/plaintext.php';
                $objectdata = get_attached_data($body);
 
-               if ($post["type"] == "link") {
+               if ($objectdata["type"] == "link") {
                        $objecttype = ACTIVITY_OBJ_BOOKMARK;
-               } elseif ($post["type"] == "video") {
+               } elseif ($objectdata["type"] == "video") {
                        $objecttype = ACTIVITY_OBJ_VIDEO;
-               } elseif ($post["type"] == "photo") {
+               } elseif ($objectdata["type"] == "photo") {
                        $objecttype = ACTIVITY_OBJ_IMAGE;
                }
 
        }
 
-       // Look for any tags and linkify them
-       $str_tags = '';
-       $inform   = '';
-
-       $tags = get_tags($body);
-
-       /*
-        * add a statusnet style reply tag if the original post was from there
-        * and we are replying, and there isn't one already
-        */
-       if ($parent && ($parent_contact['network'] == NETWORK_OSTATUS)) {
-               $contact = '@[url=' . $parent_contact['url'] . ']' . $parent_contact['nick'] . '[/url]';
-
-               if (!in_array($contact, $tags)) {
-                       $body = $contact . ' ' . $body;
-                       $tags[] = $contact;
-               }
-
-               $toplevel_contact = "";
-               $toplevel_parent = q("SELECT `contact`.* FROM `contact`
-                                               INNER JOIN `item` ON `item`.`contact-id` = `contact`.`id` AND `contact`.`url` = `item`.`author-link`
-                                               WHERE `item`.`id` = `item`.`parent` AND `item`.`parent` = %d", intval($parent));
-               if (DBM::is_result($toplevel_parent)) {
-                       if (!empty($toplevel_parent[0]['addr'])) {
-                               $toplevel_contact = '@' . $toplevel_parent[0]['addr'];
-                       } else {
-                               $toplevel_contact = '@' . $toplevel_parent[0]['nick'] . '+' . $toplevel_parent[0]['id'];
-                       }
-               } else {
-                       $toplevel_parent = q("SELECT `author-link`, `author-name` FROM `item` WHERE `id` = `parent` AND `parent` = %d", intval($parent));
-                       $toplevel_contact = '@[url=' . $toplevel_parent[0]['author-link'] . ']' . $toplevel_parent[0]['author-name'] . '[/url]';
-               }
-
-               if (!in_array($toplevel_contact, $tags)) {
-                       $tags[] = $toplevel_contact;
-               }
-       }
-
-       $tagged = array();
-
-       $private_forum = false;
-       $only_to_forum = false;
-       $forum_contact = array();
-
-       if (count($tags)) {
-               foreach ($tags as $tag) {
-
-                       $tag_type = substr($tag, 0, 1);
-
-                       if ($tag_type == '#') {
-                               continue;
-                       }
-
-                       /*
-                        * If we already tagged 'Robert Johnson', don't try and tag 'Robert'.
-                        * Robert Johnson should be first in the $tags array
-                        */
-                       $fullnametagged = false;
-                       /// @TODO $tagged is initialized above if() block and is not filled, maybe old-lost code?
-                       foreach ($tagged as $nextTag) {
-                               if (stristr($nextTag, $tag . ' ')) {
-                                       $fullnametagged = true;
-                                       break;
-                               }
-                       }
-                       if ($fullnametagged) {
-                               continue;
-                       }
-
-                       $success = handle_tag($a, $body, $inform, $str_tags, (local_user()) ? local_user() : $profile_uid , $tag, $network);
-                       if ($success['replaced']) {
-                               $tagged[] = $tag;
-                       }
-                       // When the forum is private or the forum is addressed with a "!" make the post private
-                       if (is_array($success['contact']) && ($success['contact']['prv'] || ($tag_type == '!'))) {
-                               $private_forum = $success['contact']['prv'];
-                               $only_to_forum = ($tag_type == '!');
-                               $private_id = $success['contact']['id'];
-                               $forum_contact = $success['contact'];
-                       } elseif (is_array($success['contact']) && $success['contact']['forum'] &&
-                               ($str_contact_allow == '<' . $success['contact']['id'] . '>')) {
-                               $private_forum = false;
-                               $only_to_forum = true;
-                               $private_id = $success['contact']['id'];
-                               $forum_contact = $success['contact'];
-                       }
-               }
-       }
-
-       if (!$parent && count($forum_contact) && ($private_forum || $only_to_forum)) {
-               // we tagged a forum in a top level post. Now we change the post
-               $private = $private_forum;
-
-               $str_group_allow = '';
-               $str_contact_deny = '';
-               $str_group_deny = '';
-               if ($private_forum) {
-                       $str_contact_allow = '<' . $private_id . '>';
-               } else {
-                       $str_contact_allow = '';
-               }
-               $contact_id = $private_id;
-               $contact_record = $forum_contact;
-               $_REQUEST['origin'] = false;
-       }
-
        $attachments = '';
        $match = false;
 
index 917679d4a94c6557ae7650501e7e704f13ec0097..fb13322b1371e605abb20ec38ec3509a5172b558 100755 (executable)
@@ -32,7 +32,7 @@ dontinclude = ['root', 'friendica', 'bavatar', 'tony baldwin', 'Taek', 'silke m'
 path = os.path.abspath(argv[0].split('util/make_credits.py')[0])
 print('> base directory is assumed to be: '+path)
 #  a place to store contributors
-contributors = ["Andi Stadler", "Vít Šesták 'v6ak'"]
+contributors = ["Andi Stadler", "Ratten", "Vít Šesták 'v6ak'"]
 #  get the contributors
 print('> getting contributors to the friendica core repository')
 p = subprocess.Popen(['git', 'shortlog', '--no-merges', '-s'],
index 4493161899bc22a5a6c2e8c0005c5d8126049293..ab38a1c6c19ccb296709de167222165e09dadd29 100644 (file)
@@ -39,7 +39,8 @@
 
                                                {{if $lost_contact}}<li><div id="lost-contact-message">{{$lost_contact}}</div></li>{{/if}}
                                                {{if $insecure}}<li><div id="insecure-message">{{$insecure}}</div></li> {{/if}}
-                                               {{if $blocked}}<li><div id="block-message">{{$blocked}}</div></li>{{/if}}
+                                               {{if $blocked && !$pending}}<li><div id="block-message">{{$blocked}}</div></li>{{/if}}
+                                               {{if $pending}}<li><div id="pending-message">{{$pending}}</div></li>{{/if}}
                                                {{if $ignored}}<li><div id="ignore-message">{{$ignored}}</div></li>{{/if}}
                                                {{if $archived}}<li><div id="archive-message">{{$archived}}</div></li>{{/if}}
                                        </ul>
index 52f3fc545ed5edd7e2c5b29031b92259ba52ed33..8a202197b8c5519db61c6364feca74fef9c1301a 100644 (file)
@@ -52,7 +52,8 @@
 
                                                {{if $lost_contact}}<li><div id="lost-contact-message">{{$lost_contact}}</div></li>{{/if}}
                                                {{if $insecure}}<li><div id="insecure-message">{{$insecure}}</div></li> {{/if}}
-                                               {{if $blocked}}<li><div id="block-message">{{$blocked}}</div></li>{{/if}}
+                                               {{if $blocked && !$pending}}<li><div id="block-message">{{$blocked}}</div></li>{{/if}}
+                                               {{if $pending}}<li><div id="pending-message">{{$pending}}</div></li>{{/if}}
                                                {{if $ignored}}<li><div id="ignore-message">{{$ignored}}</div></li>{{/if}}
                                                {{if $archived}}<li><div id="archive-message">{{$archived}}</div></li>{{/if}}
                                        </ul>
index 9dc11a31c2e29bf077a272b99d32504950b7c595..945895ba6b678935e473afa32b76f6ae866b85ea 100644 (file)
@@ -40,7 +40,8 @@
 
                                                {{if $lost_contact}}<li><div id="lost-contact-message">{{$lost_contact}}</div></li>{{/if}}
                                                {{if $insecure}}<li><div id="insecure-message">{{$insecure}}</div></li> {{/if}}
-                                               {{if $blocked}}<li><div id="block-message">{{$blocked}}</div></li>{{/if}}
+                                               {{if $blocked && !$pending}}<li><div id="block-message">{{$blocked}}</div></li>{{/if}}
+                                               {{if $pending}}<li><div id="pending-message">{{$pending}}</div></li>{{/if}}
                                                {{if $ignored}}<li><div id="ignore-message">{{$ignored}}</div></li>{{/if}}
                                                {{if $archived}}<li><div id="archive-message">{{$archived}}</div></li>{{/if}}
                                        </ul>