| … | … | @@ -1006,9 +1006,13 @@ async function handleAPI(req, res, url) { |
| 1006 | 1006 | const profileNode = await metaBee.get('profile') |
| 1007 | 1007 | const profile = (profileNode && profileNode.value) || {} |
| 1008 | 1008 | |
| 1009 | const pubkey = anprotoKeypair |
| 1010 | ? b4a.toString(anprotoKeypair.publicKey, 'base64') |
| 1011 | : b4a.toString(identity.identityPublicKey, 'hex') |
| 1012 | |
| 1009 | 1013 | res.writeHead(200, { 'Content-Type': 'application/json' }) |
| 1010 | 1014 | res.end(JSON.stringify({ |
| 1011 | | pubkey: b4a.toString(identity.identityPublicKey, 'hex'), |
| 1015 | pubkey, |
| 1012 | 1016 | username: profile.username || null |
| 1013 | 1017 | })) |
| 1014 | 1018 | } else if (req.method === 'POST') { |
| … | … | @@ -1287,10 +1291,14 @@ async function getTimelineMessages(limit) { |
| 1287 | 1291 | // Use username from post if available, otherwise "You" |
| 1288 | 1292 | const displayName = entry.username || 'You' |
| 1289 | 1293 | |
| 1294 | const ownPublicKey = anprotoKeypair |
| 1295 | ? b4a.toString(anprotoKeypair.publicKey, 'base64') |
| 1296 | : b4a.toString(identity.identityPublicKey, 'hex') |
| 1297 | |
| 1290 | 1298 | messages.push({ |
| 1291 | 1299 | ...entry, |
| 1292 | 1300 | author: displayName, |
| 1293 | | publicKey: b4a.toString(identity.identityPublicKey, 'hex'), |
| 1301 | publicKey: ownPublicKey, |
| 1294 | 1302 | isOwn: true |
| 1295 | 1303 | }) |
| 1296 | 1304 | } catch (err) { |