Simplify some logic
This commit is contained in:
parent
0475954741
commit
76bea7b17e
@ -793,24 +793,6 @@ class ActivityPubPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Is an Announce?
|
|
||||||
if ($notice->isRepeat()) {
|
|
||||||
$repeated_notice = Notice::getKV('id', $notice->repeat_of);
|
|
||||||
if ($repeated_notice instanceof Notice) {
|
|
||||||
try {
|
|
||||||
$other[] = Activitypub_profile::from_profile($repeated_notice->getProfile());
|
|
||||||
} catch (Exception $e) {
|
|
||||||
// Local user can be ignored
|
|
||||||
}
|
|
||||||
|
|
||||||
$postman = new Activitypub_postman($profile, $other);
|
|
||||||
|
|
||||||
// That was it
|
|
||||||
$postman->announce($repeated_notice);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Is a reply?
|
// Is a reply?
|
||||||
if ($notice->reply_to) {
|
if ($notice->reply_to) {
|
||||||
try {
|
try {
|
||||||
@ -834,13 +816,26 @@ class ActivityPubPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// That was it
|
// Is an Announce?
|
||||||
try {
|
if ($notice->isRepeat()) {
|
||||||
$postman = new Activitypub_postman($profile, $other);
|
$repeated_notice = Notice::getKV('id', $notice->repeat_of);
|
||||||
$postman->create_note($notice);
|
if ($repeated_notice instanceof Notice) {
|
||||||
} catch (Exception $e) {
|
try {
|
||||||
// Let another plugin handle this instead.
|
$other[] = Activitypub_profile::from_profile($repeated_notice->getProfile());
|
||||||
|
} catch (Exception $e) {
|
||||||
|
// Local user can be ignored
|
||||||
|
}
|
||||||
|
|
||||||
|
// That was it
|
||||||
|
$postman = new Activitypub_postman($profile, $other);
|
||||||
|
$postman->announce($repeated_notice);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// That was it
|
||||||
|
$postman = new Activitypub_postman($profile, $other);
|
||||||
|
$postman->create_note($notice);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,10 +63,6 @@ class Activitypub_postman
|
|||||||
public function __construct($from, $to)
|
public function __construct($from, $to)
|
||||||
{
|
{
|
||||||
$this->actor = $from;
|
$this->actor = $from;
|
||||||
|
|
||||||
if (empty ($to)) {
|
|
||||||
throw new Exception ('You can not summon up a postman without recipients!');
|
|
||||||
}
|
|
||||||
$discovery = new Activitypub_explorer();
|
$discovery = new Activitypub_explorer();
|
||||||
$this->to = $to;
|
$this->to = $to;
|
||||||
$followers = apActorFollowersAction::generate_followers($this->actor, 0, null);
|
$followers = apActorFollowersAction::generate_followers($this->actor, 0, null);
|
||||||
|
Reference in New Issue
Block a user