Merge pull request #14574 from annando/jetstream

Preparation for the Bluesky Jetstream firehose
This commit is contained in:
Hypolite Petovan 2024-11-25 21:25:16 -05:00 committed by GitHub
commit b7329679d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 179 additions and 10 deletions

View file

@ -75,7 +75,8 @@
"npm-asset/moment": "^2.24", "npm-asset/moment": "^2.24",
"npm-asset/perfect-scrollbar": "0.6.16", "npm-asset/perfect-scrollbar": "0.6.16",
"npm-asset/textcomplete": "^0.18.2", "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": { "suggest": {
"ext-imagick": "For faster image processing", "ext-imagick": "For faster image processing",

165
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "356019e5d0c92aae938f5292dd0fd103", "content-hash": "8b3a5f2e265b338812e30e719ff3aa80",
"packages": [ "packages": [
{ {
"name": "asika/simple-console", "name": "asika/simple-console",
@ -1412,6 +1412,24 @@
"html", "html",
"markdown" "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": "2020-07-01T00:34:03+00:00"
}, },
{ {
@ -3431,6 +3449,104 @@
], ],
"time": "2024-03-03T02:14:58+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", "name": "pragmarx/google2fa",
"version": "v5.0.0", "version": "v5.0.0",
@ -4293,6 +4409,53 @@
], ],
"time": "2020-10-23T14:02:19+00:00" "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", "name": "ua-parser/uap-php",
"version": "v3.9.14", "version": "v3.9.14",

View file

@ -125,13 +125,14 @@ class User
/** /**
* Block contact id for user id * Block contact id for user id
* *
* @param int $cid Either public contact id or user's contact id * @param int $cid Either public contact id or user's contact id
* @param int $uid User ID * @param int $uid User ID
* @param boolean $blocked Is the contact blocked or unblocked? * @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 * @return void
* @throws \Exception * @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); $cdata = Contact::getPublicAndUserContactID($cid, $uid);
if (empty($cdata)) { if (empty($cdata)) {
@ -139,10 +140,13 @@ class User
} }
$contact = Contact::getById($cdata['public']); $contact = Contact::getById($cdata['public']);
if ($blocked) {
Worker::add(Worker::PRIORITY_HIGH, 'Contact\Block', $cid, $uid); if (!$only_set) {
} else { if ($blocked) {
Worker::add(Worker::PRIORITY_HIGH, 'Contact\Unblock', $cid, $uid); Worker::add(Worker::PRIORITY_HIGH, 'Contact\Block', $cid, $uid);
} else {
Worker::add(Worker::PRIORITY_HIGH, 'Contact\Unblock', $cid, $uid);
}
} }
if ($cdata['user'] != 0) { if ($cdata['user'] != 0) {

View file

@ -29,6 +29,7 @@ class Conversation
const PARCEL_ATOM = 14; const PARCEL_ATOM = 14;
const PARCEL_ATOM03 = 15; const PARCEL_ATOM03 = 15;
const PARCEL_OPML = 16; const PARCEL_OPML = 16;
const PARCEL_JETSTREAM = 17; // @see https://github.com/bluesky-social/jetstream
const PARCEL_TWITTER = 67; const PARCEL_TWITTER = 67;
const PARCEL_CONNECTOR = 68; const PARCEL_CONNECTOR = 68;
const PARCEL_UNKNOWN = 255; const PARCEL_UNKNOWN = 255;