]> git.mxchange.org Git - friendica.git/commitdiff
Merge branch 'develop' into rewrite/gravity-constants
authorRoland Häder <Quix0r@users.noreply.github.com>
Tue, 18 Oct 2022 14:34:40 +0000 (16:34 +0200)
committerGitHub <noreply@github.com>
Tue, 18 Oct 2022 14:34:40 +0000 (16:34 +0200)
26 files changed:
1  2 
boot.php
mod/events.php
mod/item.php
mod/message.php
mod/notes.php
mod/ostatus_subscribe.php
mod/photos.php
mod/tagger.php
src/Content/Conversation.php
src/Content/Item.php
src/Model/Contact.php
src/Model/FContact.php
src/Model/Item.php
src/Module/Api/Mastodon/Statuses.php
src/Module/Conversation/Network.php
src/Module/Profile/Status.php
src/Protocol/ActivityPub/Processor.php
src/Protocol/ActivityPub/Receiver.php
src/Protocol/ActivityPub/Transmitter.php
src/Protocol/DFRN.php
src/Protocol/Diaspora.php
src/Protocol/Feed.php
src/Protocol/OStatus.php
src/Worker/ExpirePosts.php
src/Worker/Notifier.php
update.php

diff --cc boot.php
index 0f2b25027f370e435ad9b03be8b2c1048fa9a53a,1716956fa1ad962da221989cd4633b552c575b23..60c8bf5a30ebbfdb750d949b40d8bfb6ea066b8a
+++ b/boot.php
   * easily as email does today.
   */
  
- use Friendica\Model\Contact;
- define('FRIENDICA_PLATFORM',     'Friendica');
- define('FRIENDICA_CODENAME',     'Giant Rhubarb');
- define('FRIENDICA_VERSION',      '2022.12-dev');
- define('DFRN_PROTOCOL_VERSION',  '2.23');
- define('NEW_TABLE_STRUCTURE_VERSION', 1288);
- /**
-  * Constant with a HTML line break.
-  *
-  * Contains a HTML line break (br) element and a real carriage return with line
-  * feed for the source.
-  * This can be used in HTML and JavaScript where needed a line break.
-  */
- define('EOL',                    "<br />\r\n");
- /**
-  * @name CP
-  *
-  * Type of the community page
-  * @{
-  */
- define('CP_NO_INTERNAL_COMMUNITY', -2);
- define('CP_NO_COMMUNITY_PAGE',     -1);
- define('CP_USERS_ON_SERVER',        0);
- define('CP_GLOBAL_COMMUNITY',       1);
- define('CP_USERS_AND_GLOBAL',       2);
- /**
-  * @}
-  */
- /**
-  * @name Priority
-  *
-  * Process priority for the worker
-  * @{
-  */
- define('PRIORITY_UNDEFINED',   0);
- define('PRIORITY_CRITICAL',   10);
- define('PRIORITY_HIGH',       20);
- define('PRIORITY_MEDIUM',     30);
- define('PRIORITY_LOW',        40);
- define('PRIORITY_NEGLIGIBLE', 50);
- define('PRIORITIES', [PRIORITY_CRITICAL, PRIORITY_HIGH, PRIORITY_MEDIUM, PRIORITY_LOW, PRIORITY_NEGLIGIBLE]);
- /* @}*/
- // Normally this constant is defined - but not if "pcntl" isn't installed
- if (!defined('SIGTERM')) {
-       define('SIGTERM', 15);
- }
- /**
-  * Depending on the PHP version this constant does exist - or not.
-  * See here: http://php.net/manual/en/curl.constants.php#117928
-  */
- if (!defined('CURLE_OPERATION_TIMEDOUT')) {
-       define('CURLE_OPERATION_TIMEDOUT', CURLE_OPERATION_TIMEOUTED);
- }
- if (!function_exists('exif_imagetype')) {
-       function exif_imagetype($file)
-       {
-               $size = getimagesize($file);
-               return $size[2];
-       }
- }
+ use Friendica\Core\Session;
  
 -/**
 - * @name Gravity
 - *
 - * Item weight for query ordering
 - * @{
 - */
 -define('GRAVITY_PARENT',       0);
 -define('GRAVITY_ACTIVITY',     3);
 -define('GRAVITY_COMMENT',      6);
 -define('GRAVITY_UNKNOWN',      9);
 -/* @}*/
 -
  /**
   * Returns the user id of locally logged in user or false.
   *
diff --cc mod/events.php
Simple merge
diff --cc mod/item.php
index 56384b22b972c1f2b0112c556734bb8e7d94d230,cc8e9538583ff3c53fd19f1785f58eba47f2775e..799d1b8881765baf7c99b1928a4c45efa25091a7
@@@ -831,15 -834,15 +832,15 @@@ function item_content(App $a
   * @return string
   * @throws HTTPException\InternalServerErrorException
   */
 -function drop_item(int $id, string $return = '')
 +function drop_item(int $id, string $return = ''): string
  {
 -      // locate item to be deleted
 -      $fields = ['id', 'uid', 'guid', 'contact-id', 'deleted', 'gravity', 'parent'];
 -      $item = Post::selectFirstForUser(local_user(), $fields, ['id' => $id]);
 +      // Locate item to be deleted
 +      $item = Post::selectFirstForUser(local_user(), ['id', 'uid', 'guid', 'contact-id', 'deleted', 'gravity', 'parent'], ['id' => $id]);
  
        if (!DBA::isResult($item)) {
-               notice(DI::l10n()->t('Item not found.'));
+               DI::sysmsg()->addNotice(DI::l10n()->t('Item not found.'));
                DI::baseUrl()->redirect('network');
 +              //NOTREACHED
        }
  
        if ($item['deleted']) {
                Item::deleteForUser(['id' => $item['id']], local_user());
  
                item_redirect_after_action($item, $return);
 +              //NOTREACHED
        } else {
                Logger::warning('Permission denied.', ['local' => local_user(), 'uid' => $item['uid'], 'cid' => $contact_id]);
-               notice(DI::l10n()->t('Permission denied.'));
+               DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
                DI::baseUrl()->redirect('display/' . $item['guid']);
                //NOTREACHED
        }
diff --cc mod/message.php
index e8fe60fd33544887abaf602e9d3de58c9f8d5906,d1231b7c5dcb0425a91feb61f0511c6be30674e5..4b6f5b31b81006b12a707966ccab2cf3f9e70e05
@@@ -80,20 -80,17 +80,20 @@@ function message_post(App $a
  
        switch ($ret) {
                case -1:
-                       notice(DI::l10n()->t('No recipient selected.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('No recipient selected.'));
                        $norecip = true;
                        break;
 +
                case -2:
-                       notice(DI::l10n()->t('Unable to locate contact information.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('Unable to locate contact information.'));
                        break;
 +
                case -3:
-                       notice(DI::l10n()->t('Message could not be sent.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('Message could not be sent.'));
                        break;
 +
                case -4:
-                       notice(DI::l10n()->t('Message collection failure.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('Message collection failure.'));
                        break;
        }
  
diff --cc mod/notes.php
index e81cedf0b73aadf860fe0cc5faf02fb115d5aabd,a30d807693b7c2ad497adb27ae4e2f753c35099b..2c23e7aaa6ecf3d0e8d71de5e01b9eb8d9870c80
@@@ -38,10 -38,10 +38,10 @@@ function notes_init(App $a
  }
  
  
 -function notes_content(App $a, $update = false)
 +function notes_content(App $a, bool $update = false)
  {
        if (!local_user()) {
-               notice(DI::l10n()->t('Permission denied.'));
+               DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
                return;
        }
  
index 345e64924f5a658d7ca7910ff2b9c23f18112797,2ecea601668b2db5b975300243e1a5fafd3b6280..0dbce59f29305475f7e8c3f197dec4366d33927a
@@@ -27,10 -27,10 +27,10 @@@ use Friendica\Model\Contact
  use Friendica\Network\HTTPClient\Client\HttpClientAccept;
  use Friendica\Protocol\ActivityPub;
  
 -function ostatus_subscribe_content(App $a)
 +function ostatus_subscribe_content(App $a): string
  {
        if (!local_user()) {
-               notice(DI::l10n()->t('Permission denied.'));
+               DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
                DI::baseUrl()->redirect('ostatus_subscribe');
                // NOTREACHED
        }
diff --cc mod/photos.php
Simple merge
diff --cc mod/tagger.php
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc update.php
Simple merge