From 6028020854220b7d2c35d01b74d9253c27696380 Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Sat, 29 Aug 2026 00:57:18 +0200 Subject: [PATCH] message author --- src/app/app.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/app/app.ts b/src/app/app.ts index 180ec41..c1f3a8b 100644 --- a/src/app/app.ts +++ b/src/app/app.ts @@ -30,6 +30,7 @@ ed.hashes.sha512 = sha512; */ export default class Enclave

{ public accounts?: AccountsFile; + public publicKey?: string; public server?: EnclaveServer; public serverList: ServerList; public isSettingsOpen: boolean; @@ -55,7 +56,15 @@ export default class Enclave

{ } public getAccount(): Account | null { - return this.accounts?.accounts[this.accounts.activeAccount] || null; + const account = this.accounts?.accounts[this.accounts.activeAccount]; + + if (account) { + this.publicKey = base58.encode( + ed.getPublicKey(base58.decode(account.privateKey)), + ); + } + + return account || null; } public getClientSecretKey() { @@ -259,7 +268,8 @@ export default class Enclave

{ return messages.map((message) => { if ( Math.abs(currentTimestamp - message.timestamp) < 1000 && - (isInvisibleChannel || document.visibilityState === "hidden") + (isInvisibleChannel || document.visibilityState === "hidden") && + message.author !== this.publicKey ) { shouldPlaySfx = true; }