Merge remote-tracking branch 'upstream/develop' into private
This commit is contained in:
@@ -29,6 +29,7 @@ use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\APContact;
|
||||
use Friendica\Model\Contact;
|
||||
use Friendica\Model\Conversation;
|
||||
use Friendica\Model\Event;
|
||||
use Friendica\Model\Item;
|
||||
use Friendica\Model\Mail;
|
||||
@@ -455,6 +456,13 @@ class Processor
|
||||
$item['private'] = Item::PRIVATE;
|
||||
}
|
||||
|
||||
if (!empty($activity['raw'])) {
|
||||
$item['source'] = $activity['raw'];
|
||||
$item['protocol'] = Conversation::PARCEL_ACTIVITYPUB;
|
||||
$item['conversation-href'] = $activity['context'] ?? '';
|
||||
$item['conversation-uri'] = $activity['conversation'] ?? '';
|
||||
}
|
||||
|
||||
$isForum = false;
|
||||
|
||||
if (!empty($activity['thread-completion'])) {
|
||||
|
||||
@@ -28,7 +28,6 @@ use Friendica\Core\Logger;
|
||||
use Friendica\Core\Protocol;
|
||||
use Friendica\Model\Contact;
|
||||
use Friendica\Model\APContact;
|
||||
use Friendica\Model\Conversation;
|
||||
use Friendica\Model\Item;
|
||||
use Friendica\Model\User;
|
||||
use Friendica\Protocol\Activity;
|
||||
@@ -303,33 +302,6 @@ class Receiver
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Store the unprocessed data into the conversation table
|
||||
* This has to be done outside the regular function,
|
||||
* since we store everything - not only item posts.
|
||||
*
|
||||
* @param array $activity Array with activity data
|
||||
* @param string $body The raw message
|
||||
* @throws \Exception
|
||||
*/
|
||||
private static function storeConversation($activity, $body)
|
||||
{
|
||||
if (empty($body) || empty($activity['id'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$conversation = [
|
||||
'protocol' => Conversation::PARCEL_ACTIVITYPUB,
|
||||
'item-uri' => $activity['id'],
|
||||
'reply-to-uri' => $activity['reply-to-id'] ?? '',
|
||||
'conversation-href' => $activity['context'] ?? '',
|
||||
'conversation-uri' => $activity['conversation'] ?? '',
|
||||
'source' => $body,
|
||||
'received' => DateTimeFormat::utcNow()];
|
||||
|
||||
DBA::insert('conversation', $conversation, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes the activity object
|
||||
*
|
||||
@@ -380,9 +352,8 @@ class Receiver
|
||||
return;
|
||||
}
|
||||
|
||||
// Only store content related stuff - and no announces, since they possibly overwrite the original content
|
||||
if (in_array($object_data['object_type'], self::CONTENT_TYPES) && ($type != 'as:Announce')) {
|
||||
self::storeConversation($object_data, $body);
|
||||
if (!empty($body)) {
|
||||
$object_data['raw'] = $body;
|
||||
}
|
||||
|
||||
// Internal flag for thread completion. See Processor.php
|
||||
|
||||
@@ -264,7 +264,7 @@ class Transmitter
|
||||
$data['name'] = $contact['name'];
|
||||
$data['vcard:hasAddress'] = ['@type' => 'vcard:Home', 'vcard:country-name' => $profile['country-name'],
|
||||
'vcard:region' => $profile['region'], 'vcard:locality' => $profile['locality']];
|
||||
$data['summary'] = $contact['about'];
|
||||
$data['summary'] = BBCode::convert($contact['about'], false);
|
||||
$data['url'] = $contact['url'];
|
||||
$data['manuallyApprovesFollowers'] = in_array($user['page-flags'], [User::PAGE_FLAGS_NORMAL, User::PAGE_FLAGS_PRVGROUP]);
|
||||
$data['publicKey'] = ['id' => $contact['url'] . '#main-key',
|
||||
|
||||
@@ -4135,8 +4135,7 @@ class Diaspora
|
||||
$dob = DateTimeFormat::utc($year . '-' . $month . '-'. $day, 'Y-m-d');
|
||||
}
|
||||
|
||||
$about = $profile['about'];
|
||||
$about = strip_tags(BBCode::convert($about));
|
||||
$about = BBCode::toMarkdown($profile['about']);
|
||||
|
||||
$location = Profile::formatLocation($profile);
|
||||
$tags = '';
|
||||
|
||||
Reference in New Issue
Block a user