[PLUGIN][ActivityPub][Model][Note] Fix @language handling
This commit is contained in:
parent
7eddbd343d
commit
45344c80d1
|
@ -143,10 +143,15 @@ class Note extends Model
|
|||
}
|
||||
|
||||
// Figure the locale of the note when possible
|
||||
$locale = array_column($type_note->get('@context'), '@language');
|
||||
if ($locale !== []) {
|
||||
$locale = $locale[0];
|
||||
if ($locale === 'und') {
|
||||
$locale = null;
|
||||
if (\is_array($type_note->get('@context'))) {
|
||||
$locale = array_column($type_note->get('@context'), '@language');
|
||||
if ($locale !== []) {
|
||||
$locale = $locale[0];
|
||||
if ($locale === 'und') {
|
||||
$locale = null;
|
||||
}
|
||||
} else {
|
||||
$locale = null;
|
||||
}
|
||||
}
|
||||
|
@ -178,7 +183,7 @@ class Note extends Model
|
|||
} else {
|
||||
// Either Followers-only or Direct
|
||||
if ($type_note->get('type') === 'ChatMessage' // Is DM explicitly?
|
||||
|| (empty($type_note->get('cc')))) { // Only has TO targets
|
||||
|| ($type_note->get('cc') === [])) { // Only has TO targets
|
||||
$map['scope'] = VisibilityScope::MESSAGE;
|
||||
} else { // Then is collection
|
||||
$map['scope'] = VisibilityScope::COLLECTION;
|
||||
|
|
Loading…
Reference in New Issue
Block a user