Added to show pgp fingerprint

This commit is contained in:
defnax 2026-08-12 17:53:35 +02:00
parent 88aaf7cf92
commit f670319331
2 changed files with 14 additions and 0 deletions

View File

@ -100,6 +100,7 @@ Data.refreshGpgDetails = async function () {
if (details[gpgId] === undefined) {
details[gpgId] = {
name: data.name,
fingerprint: data.fpr || '',
isSearched: true,
isOnline,
locations: [loc],
@ -110,6 +111,9 @@ Data.refreshGpgDetails = async function () {
};
} else {
details[gpgId].locations.push(loc);
if (!details[gpgId].fingerprint && data.fpr) {
details[gpgId].fingerprint = data.fpr;
}
if (avatar) {
details[gpgId].avatar = avatar;
}

View File

@ -5,6 +5,13 @@ const Data = require('network/network_data');
const peopleUtil = require('people/people_util');
const { State, startDirectChat, getOnlineSslId } = require('network/network_state');
function formatFingerprint(fingerprint) {
return String(fingerprint || '')
.replace(/\s/g, '')
.match(/.{1,4}/g)
?.join(' ') || '';
}
const ConfirmRemove = () => {
return {
view: (vnode) => [
@ -38,6 +45,7 @@ const DetailsTab = () => {
const friendGxsId = State.gpgToGxsIdMap[gpgId.toLowerCase()];
const status = Data.getStatusPresentation(friend.statusValue, friend.isOnline);
const fingerprint = formatFingerprint(friend.fingerprint);
return m('.network-detail-view', [
m('.detail-header', [
@ -101,6 +109,8 @@ const DetailsTab = () => {
] : null,
m('.info-label', 'Node GPG Key'),
m('.info-value', gpgId),
m('.info-label', 'PGP Fingerprint'),
m('.info-value', fingerprint || 'Unavailable'),
]),
]),