Merge pull request #2471 from annando/1604-diaspora-always-on

Diaspora: Comments and Likes are now signed at any time
This commit is contained in:
Tobias Diekershoff 2016-04-21 08:39:42 +02:00
commit 778935eb48
2 changed files with 6 additions and 22 deletions

View file

@ -3122,12 +3122,6 @@ class diaspora {
*/ */
public static function store_like_signature($contact, $post_id) { public static function store_like_signature($contact, $post_id) {
$enabled = intval(get_config('system','diaspora_enabled'));
if (!$enabled) {
logger('Diaspora support disabled, not storing like signature', LOGGER_DEBUG);
return false;
}
// Is the contact the owner? Then fetch the private key // Is the contact the owner? Then fetch the private key
if (!$contact['self'] OR ($contact['uid'] == 0)) { if (!$contact['self'] OR ($contact['uid'] == 0)) {
logger("No owner post, so not storing signature", LOGGER_DEBUG); logger("No owner post, so not storing signature", LOGGER_DEBUG);
@ -3191,12 +3185,6 @@ class diaspora {
return false; return false;
} }
$enabled = intval(get_config('system','diaspora_enabled'));
if (!$enabled) {
logger('Diaspora support disabled, not storing comment signature', LOGGER_DEBUG);
return false;
}
$contact["uprvkey"] = $uprvkey; $contact["uprvkey"] = $uprvkey;
$message = self::construct_comment($item, $contact); $message = self::construct_comment($item, $contact);

View file

@ -29,16 +29,12 @@ function xrd_init(&$a) {
header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Origin: *');
header("Content-type: text/xml"); header("Content-type: text/xml");
if(get_config('system','diaspora_enabled')) {
$tpl = get_markup_template('xrd_diaspora.tpl'); $tpl = get_markup_template('xrd_diaspora.tpl');
$dspr = replace_macros($tpl,array( $dspr = replace_macros($tpl,array(
'$baseurl' => $a->get_baseurl(), '$baseurl' => $a->get_baseurl(),
'$dspr_guid' => $r[0]['guid'], '$dspr_guid' => $r[0]['guid'],
'$dspr_key' => base64_encode(pemtorsa($r[0]['pubkey'])) '$dspr_key' => base64_encode(pemtorsa($r[0]['pubkey']))
)); ));
}
else
$dspr = '';
$tpl = get_markup_template('xrd_person.tpl'); $tpl = get_markup_template('xrd_person.tpl');