mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-16 07:28:06 +02:00
Working on htp
This commit is contained in:
parent
7faf1fba8b
commit
410207f3ca
2 changed files with 22778 additions and 6 deletions
22776
server.mjs
Normal file
22776
server.mjs
Normal file
File diff suppressed because one or more lines are too long
|
@ -73,11 +73,7 @@ export const handleOlmRegisterMessage: MessageHandler = async (context) => {
|
||||||
.set({
|
.set({
|
||||||
pubKey: publicKey
|
pubKey: publicKey
|
||||||
})
|
})
|
||||||
.where(eq(clients.clientId, olm.clientId))
|
.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;
|
|
||||||
|
|
||||||
// Get all sites data
|
// Get all sites data
|
||||||
const sitesData = await db
|
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 public key changed, delete old peer from this site
|
||||||
if (pubKeyChanged) {
|
if (client.pubKey && client.pubKey != publicKey) {
|
||||||
logger.info(
|
logger.info(
|
||||||
`Public key mismatch. Deleting old peer from site ${site.siteId}...`
|
`Public key mismatch. Deleting old peer from site ${site.siteId}...`
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue