]> git.mxchange.org Git - friendica.git/commitdiff
Preparation for the Bluesky Jetstream firehose
authorMichael <heluecht@pirati.ca>
Sun, 24 Nov 2024 06:51:00 +0000 (06:51 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 24 Nov 2024 06:51:00 +0000 (06:51 +0000)
composer.json
composer.lock
src/Model/Contact/User.php
src/Model/Conversation.php

index 0140d313704e06d450c56f591fabd90b3fa95ce0..91e78517ddb1d34fd5f02595982892c9b551a245 100644 (file)
@@ -75,7 +75,8 @@
                "npm-asset/moment": "^2.24",
                "npm-asset/perfect-scrollbar": "0.6.16",
                "npm-asset/textcomplete": "^0.18.2",
-               "npm-asset/typeahead.js": "^0.11.1"
+               "npm-asset/typeahead.js": "^0.11.1",
+               "textalk/websocket": "^1.6"
        },
        "suggest": {
                "ext-imagick": "For faster image processing",
index d89a03630e3596db2228da869e208bc01f48cde6..dc956e175a0bc8eabc3e85972b6d53bf8db501a3 100644 (file)
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "356019e5d0c92aae938f5292dd0fd103",
+    "content-hash": "8b3a5f2e265b338812e30e719ff3aa80",
     "packages": [
         {
             "name": "asika/simple-console",
                 "html",
                 "markdown"
             ],
+            "funding": [
+                {
+                    "url": "https://www.colinodell.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://www.paypal.me/colinpodell/10.00",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/colinodell",
+                    "type": "github"
+                },
+                {
+                    "url": "https://www.patreon.com/colinodell",
+                    "type": "patreon"
+                }
+            ],
             "time": "2020-07-01T00:34:03+00:00"
         },
         {
             ],
             "time": "2024-03-03T02:14:58+00:00"
         },
+        {
+            "name": "phrity/net-uri",
+            "version": "1.3.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sirn-se/phrity-net-uri.git",
+                "reference": "3f458e0c4d1ddc0e218d7a5b9420127c63925f43"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sirn-se/phrity-net-uri/zipball/3f458e0c4d1ddc0e218d7a5b9420127c63925f43",
+                "reference": "3f458e0c4d1ddc0e218d7a5b9420127c63925f43",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^7.4 | ^8.0",
+                "psr/http-factory": "^1.0",
+                "psr/http-message": "^1.0 | ^2.0"
+            },
+            "require-dev": {
+                "php-coveralls/php-coveralls": "^2.0",
+                "phpunit/phpunit": "^9.0 | ^10.0",
+                "squizlabs/php_codesniffer": "^3.0"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Phrity\\Net\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Sören Jensen",
+                    "email": "sirn@sirn.se",
+                    "homepage": "https://phrity.sirn.se"
+                }
+            ],
+            "description": "PSR-7 Uri and PSR-17 UriFactory implementation",
+            "homepage": "https://phrity.sirn.se/net-uri",
+            "keywords": [
+                "psr-17",
+                "psr-7",
+                "uri",
+                "uri factory"
+            ],
+            "time": "2023-08-21T10:33:06+00:00"
+        },
+        {
+            "name": "phrity/util-errorhandler",
+            "version": "1.1.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sirn-se/phrity-util-errorhandler.git",
+                "reference": "483228156e06673963902b1cc1e6bd9541ab4d5e"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sirn-se/phrity-util-errorhandler/zipball/483228156e06673963902b1cc1e6bd9541ab4d5e",
+                "reference": "483228156e06673963902b1cc1e6bd9541ab4d5e",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^7.4 | ^8.0"
+            },
+            "require-dev": {
+                "php-coveralls/php-coveralls": "^2.0",
+                "phpunit/phpunit": "^9.0 | ^10.0 | ^11.0",
+                "squizlabs/php_codesniffer": "^3.5"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Phrity\\Util\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Sören Jensen",
+                    "email": "sirn@sirn.se",
+                    "homepage": "https://phrity.sirn.se"
+                }
+            ],
+            "description": "Inline error handler; catch and resolve errors for code block.",
+            "homepage": "https://phrity.sirn.se/util-errorhandler",
+            "keywords": [
+                "error",
+                "warning"
+            ],
+            "time": "2024-09-12T06:49:16+00:00"
+        },
         {
             "name": "pragmarx/google2fa",
             "version": "v5.0.0",
             ],
             "time": "2020-10-23T14:02:19+00:00"
         },
+        {
+            "name": "textalk/websocket",
+            "version": "1.6.3",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/Textalk/websocket-php.git",
+                "reference": "67de79745b1a357caf812bfc44e0abf481cee012"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/Textalk/websocket-php/zipball/67de79745b1a357caf812bfc44e0abf481cee012",
+                "reference": "67de79745b1a357caf812bfc44e0abf481cee012",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^7.4 | ^8.0",
+                "phrity/net-uri": "^1.0",
+                "phrity/util-errorhandler": "^1.0",
+                "psr/http-message": "^1.0",
+                "psr/log": "^1.0 | ^2.0 | ^3.0"
+            },
+            "require-dev": {
+                "php-coveralls/php-coveralls": "^2.0",
+                "phpunit/phpunit": "^9.0",
+                "squizlabs/php_codesniffer": "^3.5"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "WebSocket\\": "lib"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "ISC"
+            ],
+            "authors": [
+                {
+                    "name": "Fredrik Liljegren"
+                },
+                {
+                    "name": "Sören Jensen"
+                }
+            ],
+            "description": "WebSocket client and server",
+            "time": "2022-11-07T18:59:33+00:00"
+        },
         {
             "name": "ua-parser/uap-php",
             "version": "v3.9.14",
index ad121fd86af9d7010bf8be90505039e2b4eac626..66a3721193b2d26f276707abc17c2fb9165227b8 100644 (file)
@@ -125,13 +125,14 @@ class User
        /**
         * Block contact id for user id
         *
-        * @param int     $cid     Either public contact id or user's contact id
-        * @param int     $uid     User ID
-        * @param boolean $blocked Is the contact blocked or unblocked?
+        * @param int     $cid      Either public contact id or user's contact id
+        * @param int     $uid      User ID
+        * @param boolean $blocked  Is the contact blocked or unblocked?
+        * @param boolean $only_set Only set the block flag, don't execute any block transmission
         * @return void
         * @throws \Exception
         */
-       public static function setBlocked(int $cid, int $uid, bool $blocked)
+       public static function setBlocked(int $cid, int $uid, bool $blocked, bool $only_set = false)
        {
                $cdata = Contact::getPublicAndUserContactID($cid, $uid);
                if (empty($cdata)) {
@@ -139,10 +140,13 @@ class User
                }
 
                $contact = Contact::getById($cdata['public']);
-               if ($blocked) {
-                       Worker::add(Worker::PRIORITY_HIGH, 'Contact\Block', $cid, $uid);
-               } else {
-                       Worker::add(Worker::PRIORITY_HIGH, 'Contact\Unblock', $cid, $uid);
+
+               if (!$only_set) {
+                       if ($blocked) {
+                               Worker::add(Worker::PRIORITY_HIGH, 'Contact\Block', $cid, $uid);
+                       } else {
+                               Worker::add(Worker::PRIORITY_HIGH, 'Contact\Unblock', $cid, $uid);
+                       }
                }
 
                if ($cdata['user'] != 0) {
index 8637880074616d5f2b4c41e4862fcdcf6194f316..f7c7d1dd441988459c8f90d2e65acaa98f9bef47 100644 (file)
@@ -29,6 +29,7 @@ class Conversation
        const PARCEL_ATOM               = 14;
        const PARCEL_ATOM03             = 15;
        const PARCEL_OPML               = 16;
+       const PARCEL_JETSTREAM          = 17; // @see https://github.com/bluesky-social/jetstream
        const PARCEL_TWITTER            = 67;
        const PARCEL_CONNECTOR          = 68;
        const PARCEL_UNKNOWN            = 255;