Don't break when notice grabber fails
It's better to fragment the integrity of a note than to fail publishing a note
This commit is contained in:
parent
334923e542
commit
935495415b
@ -108,7 +108,7 @@ class apActorFollowersAction extends ManagedAction
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a list of followers for a given profile.
|
||||
* Generates a list of stalkers for a given profile.
|
||||
*
|
||||
* @author Diogo Cordeiro <diogo@fc.up.pt>
|
||||
* @param Profile $profile
|
||||
|
@ -108,7 +108,7 @@ class apActorFollowingAction extends ManagedAction
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a list of people following given profile.
|
||||
* Generates the list of those a given profile is stalking.
|
||||
*
|
||||
* @author Diogo Cordeiro <diogo@fc.up.pt>
|
||||
* @param Profile $profile
|
||||
|
@ -188,11 +188,15 @@ class Activitypub_notice extends Managed_DataObject
|
||||
if (isset($settings['inReplyTo'])) {
|
||||
try {
|
||||
$inReplyTo = ActivityPubPlugin::grab_notice_from_url($settings['inReplyTo']);
|
||||
} catch (Exception $e) {
|
||||
throw new Exception('Invalid Object inReplyTo value: '.$e->getMessage());
|
||||
}
|
||||
$act->context->replyToID = $inReplyTo->getUri();
|
||||
$act->context->replyToUrl = $inReplyTo->getUrl();
|
||||
} catch (Exception $e) {
|
||||
// It failed to grab, maybe we got this note from another source
|
||||
// (e.g.: OStatus) that handles this differently or we really
|
||||
// failed to get it...
|
||||
// Welp, nothing that we can do about, let's
|
||||
// just fake we don't have such notice.
|
||||
}
|
||||
} else {
|
||||
$inReplyTo = null;
|
||||
}
|
||||
|
Reference in New Issue
Block a user