Relay posts with the original protocol
This commit is contained in:
parent
675f54e44f
commit
a43059df27
4 changed files with 41 additions and 18 deletions
|
|
@ -3031,7 +3031,18 @@ class Diaspora
|
|||
$owner['uprvkey'] = $owner['prvkey'];
|
||||
}
|
||||
|
||||
$envelope = self::buildMessage($msg, $owner, $contact, $owner['uprvkey'], $contact['pubkey'], $public_batch);
|
||||
// When sending content to Friendica contacts using the Diaspora protocol
|
||||
// we have to fetch the public key from the fcontact.
|
||||
// This is due to the fact that legacy DFRN had unique keys for every contact.
|
||||
$pubkey = $contact['pubkey'];
|
||||
if (!empty($contact['addr'])) {
|
||||
$fcontact = FContact::getByURL($contact['addr']);
|
||||
if (!empty($fcontact)) {
|
||||
$pubkey = $fcontact['pubkey'];
|
||||
}
|
||||
}
|
||||
|
||||
$envelope = self::buildMessage($msg, $owner, $contact, $owner['uprvkey'], $pubkey, $public_batch);
|
||||
|
||||
$return_code = self::transmit($owner, $contact, $envelope, $public_batch, $guid);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue