Working on htp

This commit is contained in:
Owen 2025-04-04 10:59:22 -04:00
parent 7faf1fba8b
commit 410207f3ca
No known key found for this signature in database
GPG key ID: 8271FDFFD9E0CCBD
2 changed files with 22778 additions and 6 deletions

View file

@ -73,11 +73,7 @@ export const handleOlmRegisterMessage: MessageHandler = async (context) => {
.set({
pubKey: publicKey
})
.where(eq(clients.clientId, olm.clientId))
.returning();
// Check if public key changed and handle old peer deletion later
const pubKeyChanged = client.pubKey && client.pubKey !== publicKey;
.where(eq(clients.clientId, olm.clientId));
// Get all sites data
const sitesData = await db
@ -112,7 +108,7 @@ export const handleOlmRegisterMessage: MessageHandler = async (context) => {
}
// If public key changed, delete old peer from this site
if (pubKeyChanged) {
if (client.pubKey && client.pubKey != publicKey) {
logger.info(
`Public key mismatch. Deleting old peer from site ${site.siteId}...`
);