mirror of
https://github.com/friendica/friendica
synced 2025-04-22 09:10:10 +00:00
Entities, Source and api functions rearranged
This commit is contained in:
parent
452cd57437
commit
a3aab4a75a
5 changed files with 710 additions and 749 deletions
|
@ -129,17 +129,19 @@ class Status extends BaseDataTransferObject
|
|||
$this->external_url = $item['plink'];
|
||||
$this->favorited = (bool)$item['starred'];
|
||||
$this->friendica_comments = $friendica_comments;
|
||||
$this->source = $item['app'] ?: 'web';
|
||||
$this->source = $item['app'];
|
||||
$this->geo = $geo;
|
||||
$this->friendica_activities = $friendica_activities;
|
||||
$this->attachments = $attachments;
|
||||
$this->entities = $entities;
|
||||
$this->extended_entities = $entities;
|
||||
|
||||
if ($this->source == 'web') {
|
||||
$this->source = ContactSelector::networkToName($item['author-network'], $item['author-link'], $item['network']);
|
||||
} elseif (ContactSelector::networkToName($item['author-network'], $item['author-link'], $item['network']) != $this->source) {
|
||||
$this->source = trim($this->source. ' (' . ContactSelector::networkToName($item['author-network'], $item['author-link'], $item['network']) . ')');
|
||||
$origin = ContactSelector::networkToName($item['author-network'], $item['author-link'], $item['network']);
|
||||
|
||||
if (empty($this->source)) {
|
||||
$this->source = $origin;
|
||||
} elseif ($origin != $this->source) {
|
||||
$this->source = trim($this->source. ' (' . $origin . ')');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -164,6 +166,19 @@ class Status extends BaseDataTransferObject
|
|||
$status['geo'] = null;
|
||||
}
|
||||
|
||||
if (empty($status['entities'])) {
|
||||
$status['entities'] = null;
|
||||
}
|
||||
|
||||
if (empty($status['extended_entities'])) {
|
||||
$status['extended_entities'] = null;
|
||||
}
|
||||
|
||||
if (empty($status['attachments'])) {
|
||||
$status['attachments'] = null;
|
||||
}
|
||||
|
||||
|
||||
return $status;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue