}
function isMyType($type) {
+ // Third argument to compareTypes is true, to allow for notices with empty object_type for example (verb-only)
return count($this->types())===0 || ActivityUtils::compareTypes($type, $this->types());
}
if ($this->isMyNotice($notice)) {
try {
$this->deleteRelated($notice);
+ } catch (NoProfileException $e) {
+ // we failed because of database lookup failure, Notice has no recognized profile as creator
+ // so we skip this. If we want to remove missing notices we should do a SQL constraints check
+ // in the affected plugin.
} catch (AlreadyFulfilledException $e) {
// Nothing to see here, it's obviously already gone...
}
if ($nli->notice->scope != 0 && $nli->notice->scope != 1) {
$class .= ' limited-scope';
}
+ try {
+ $class .= ' notice-source-'.common_to_alphanumeric($nli->notice->source);
+ } catch (Exception $e) {
+ // either source or what we filtered out was a zero-length string
+ }
$nli->out->elementStart('li', array('class' => $class,
'id' => 'notice-' . $id));
}