mirror of
https://github.com/friendica/friendica
synced 2025-04-28 11:44:23 +02:00
Merge pull request #9766 from annando/conversation-direction
Improved direction and protocol detection
This commit is contained in:
commit
ca8e4066fc
14 changed files with 107 additions and 165 deletions
|
@ -297,6 +297,10 @@ class Processor
|
|||
}
|
||||
}
|
||||
|
||||
if (!empty($activity['from-relay'])) {
|
||||
$item['direction'] = Conversation::RELAY;
|
||||
}
|
||||
|
||||
$item['isForum'] = false;
|
||||
|
||||
if (!empty($activity['thread-completion'])) {
|
||||
|
@ -420,20 +424,24 @@ class Processor
|
|||
*/
|
||||
public static function createEvent($activity, $item)
|
||||
{
|
||||
$event['summary'] = HTML::toBBCode($activity['name']);
|
||||
$event['desc'] = HTML::toBBCode($activity['content']);
|
||||
$event['start'] = $activity['start-time'];
|
||||
$event['finish'] = $activity['end-time'];
|
||||
$event['nofinish'] = empty($event['finish']);
|
||||
$event['location'] = $activity['location'];
|
||||
$event['adjust'] = true;
|
||||
$event['cid'] = $item['contact-id'];
|
||||
$event['uid'] = $item['uid'];
|
||||
$event['uri'] = $item['uri'];
|
||||
$event['edited'] = $item['edited'];
|
||||
$event['private'] = $item['private'];
|
||||
$event['guid'] = $item['guid'];
|
||||
$event['plink'] = $item['plink'];
|
||||
$event['summary'] = HTML::toBBCode($activity['name']);
|
||||
$event['desc'] = HTML::toBBCode($activity['content']);
|
||||
$event['start'] = $activity['start-time'];
|
||||
$event['finish'] = $activity['end-time'];
|
||||
$event['nofinish'] = empty($event['finish']);
|
||||
$event['location'] = $activity['location'];
|
||||
$event['adjust'] = true;
|
||||
$event['cid'] = $item['contact-id'];
|
||||
$event['uid'] = $item['uid'];
|
||||
$event['uri'] = $item['uri'];
|
||||
$event['edited'] = $item['edited'];
|
||||
$event['private'] = $item['private'];
|
||||
$event['guid'] = $item['guid'];
|
||||
$event['plink'] = $item['plink'];
|
||||
$event['network'] = $item['network'];
|
||||
$event['protocol'] = $item['protocol'];
|
||||
$event['direction'] = $item['direction'];
|
||||
$event['source'] = $item['source'];
|
||||
|
||||
$condition = ['uri' => $item['uri'], 'uid' => $item['uid']];
|
||||
$ev = DBA::selectFirst('event', ['id'], $condition);
|
||||
|
|
|
@ -358,6 +358,7 @@ class Receiver
|
|||
$object_data['author'] = JsonLD::fetchElement($activity, 'as:actor', '@id');
|
||||
$object_data['object_id'] = $object_id;
|
||||
$object_data['object_type'] = ''; // Since we don't fetch the object, we don't know the type
|
||||
$object_data['push'] = $push;
|
||||
} elseif (in_array($type, ['as:Add'])) {
|
||||
$object_data = [];
|
||||
$object_data['id'] = JsonLD::fetchElement($activity, '@id');
|
||||
|
@ -365,6 +366,7 @@ class Receiver
|
|||
$object_data['object_id'] = JsonLD::fetchElement($activity, 'as:object', '@id');
|
||||
$object_data['object_type'] = JsonLD::fetchElement($activity['as:object'], '@type');
|
||||
$object_data['object_content'] = JsonLD::fetchElement($activity['as:object'], 'as:content', '@type');
|
||||
$object_data['push'] = $push;
|
||||
} else {
|
||||
$object_data = [];
|
||||
$object_data['id'] = JsonLD::fetchElement($activity, '@id');
|
||||
|
@ -372,6 +374,7 @@ class Receiver
|
|||
$object_data['object_actor'] = JsonLD::fetchElement($activity['as:object'], 'as:actor', '@id');
|
||||
$object_data['object_object'] = JsonLD::fetchElement($activity['as:object'], 'as:object');
|
||||
$object_data['object_type'] = JsonLD::fetchElement($activity['as:object'], '@type');
|
||||
$object_data['push'] = $push;
|
||||
|
||||
// An Undo is done on the object of an object, so we need that type as well
|
||||
if (($type == 'as:Undo') && !empty($object_data['object_object'])) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue