Merge pull request #4961 from annando/direct-dfrn

Direct Relay is now working with DFRN as well
This commit is contained in:
Hypolite Petovan 2018-04-30 14:06:35 -04:00 committed by GitHub
commit 352e136132
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 71 additions and 36 deletions

View file

@ -70,9 +70,11 @@ function wk_social_relay()
}
$relay = [
"subscribe" => $subscribe,
"scope" => $scope,
"tags" => $taglist
'subscribe' => $subscribe,
'scope' => $scope,
'tags' => $taglist,
'protocols' => ['diaspora' => System::baseUrl() . '/receive/public',
'dfrn' => System::baseUrl() . '/dfrn_notify']
];
header('Content-type: application/json; charset=utf-8');

View file

@ -208,7 +208,7 @@ function dfrn_dispatch_public($postdata)
$contact = Contact::getDetailsByAddr($msg['author'], 0);
if (!$contact) {
logger('Contact not found for address ' . $msg['author']);
System::xmlExit(3, 'Contact not found');
System::xmlExit(3, 'Contact ' . $msg['author'] . ' not found');
}
// We now have some contact, so we fetch it
@ -222,7 +222,7 @@ function dfrn_dispatch_public($postdata)
// This should never fail
if (!DBM::is_result($importer)) {
logger('Contact not found for address ' . $msg['author']);
System::xmlExit(3, 'Contact not found');
System::xmlExit(3, 'Contact ' . $msg['author'] . ' not found');
}
logger('Importing post from ' . $msg['author'] . ' with the public envelope.', LOGGER_DEBUG);
@ -246,7 +246,7 @@ function dfrn_dispatch_private($user, $postdata)
$cid = Contact::getIdForURL($msg['author']);
if (!$cid) {
logger('Contact not found for address ' . $msg['author']);
System::xmlExit(3, 'Contact not found');
System::xmlExit(3, 'Contact ' . $msg['author'] . ' not found');
}
}
@ -259,7 +259,7 @@ function dfrn_dispatch_private($user, $postdata)
// This should never fail
if (!DBM::is_result($importer)) {
logger('Contact not found for address ' . $msg['author']);
System::xmlExit(3, 'Contact not found');
System::xmlExit(3, 'Contact ' . $msg['author'] . ' not found');
}
// Set the user id. This is important if this is a public contact