aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/Libzot.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2023-04-13 10:45:36 +0200
committerMario Vavti <mario@mariovavti.com>2023-04-13 10:45:36 +0200
commit6ddf1a57867689caffb6513afe73aeea1f2ed906 (patch)
tree6abc67e4c6ac4b5f53c4b9430ca695e112905e02 /Zotlabs/Lib/Libzot.php
parentb9827dfe02266707d6b1eccc1024e4db1756d8b6 (diff)
downloadvolse-hubzilla-6ddf1a57867689caffb6513afe73aeea1f2ed906.tar.gz
volse-hubzilla-6ddf1a57867689caffb6513afe73aeea1f2ed906.tar.bz2
volse-hubzilla-6ddf1a57867689caffb6513afe73aeea1f2ed906.zip
update zotinfo to use as much info as possible from channel since in some cases the xchan might be history already
Diffstat (limited to 'Zotlabs/Lib/Libzot.php')
-rw-r--r--Zotlabs/Lib/Libzot.php20
1 files changed, 7 insertions, 13 deletions
diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php
index bf6d02a72..8cd2718f4 100644
--- a/Zotlabs/Lib/Libzot.php
+++ b/Zotlabs/Lib/Libzot.php
@@ -678,15 +678,11 @@ class Libzot {
$sig_methods = ((array_key_exists('signing', $arr) && is_array($arr['signing'])) ? $arr['signing'] : ['sha256']);
$verified = false;
- if (!self::verify($arr['id'], $arr['id_sig'], $arr['public_key'])) {
- logger('Unable to verify channel signature for ' . $arr['primary_location']['address']);
- return $ret;
- }
- else {
+ if (self::verify($arr['id'], $arr['id_sig'], $arr['public_key'])) {
$verified = true;
}
-
- if (!$verified) {
+ else {
+ logger('Unable to verify channel signature for ' . $xchan_hash . ' (' . $arr['primary_location']['address']) . ')';
$ret['message'] = t('Unable to verify channel signature');
return $ret;
}
@@ -968,11 +964,9 @@ class Libzot {
}
}
-
// update updates if anything changed bump the ud_date
Libzotdir::update($xchan_hash, $address, $changed);
-
if (empty($ret['message'])) {
$ret['success'] = true;
$ret['hash'] = $xchan_hash;
@@ -2800,8 +2794,8 @@ class Libzot {
// Communication details
- $ret['id'] = $e['xchan_guid'];
- $ret['id_sig'] = self::sign($e['xchan_guid'], $e['channel_prvkey']);
+ $ret['id'] = $e['channel_guid'];
+ $ret['id_sig'] = self::sign($e['channel_guid'], $e['channel_prvkey']);
$ret['primary_location'] = [
'address' => $e['xchan_addr'],
@@ -2810,10 +2804,10 @@ class Libzot {
'follow_url' => $e['xchan_follow'],
];
- $ret['public_key'] = $e['xchan_pubkey'];
+ $ret['public_key'] = $e['channel_pubkey'];
$ret['signing_algorithm'] = 'rsa-sha256';
$ret['username'] = $e['channel_address'];
- $ret['name'] = $e['xchan_name'];
+ $ret['name'] = $e['channel_name'];
$ret['name_updated'] = $e['xchan_name_date'];
$ret['photo'] = [
'url' => $e['xchan_photo_l'],