mirror of
https://github.com/friendica/friendica
synced 2025-04-27 07:10:12 +00:00
Preparation for the Bluesky Jetstream firehose
This commit is contained in:
parent
e88606a4f8
commit
c85d979fea
4 changed files with 179 additions and 10 deletions
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue