Allow notes to be sent to other instances of the same participant on separate sockets

This commit is contained in:
Hri7566 2024-09-02 15:17:29 -04:00
parent 062c6bedea
commit 4733ca5139
2 changed files with 12 additions and 9 deletions

View File

@ -66,6 +66,7 @@ This has always been the future intention of this project.
## TODO ## TODO
- Change `socketsBySocketID` to `socketsByUUID`
- Channel data saving - Channel data saving
- Permission groups and permissions - Permission groups and permissions
- Probable permission groups: owner, admin, mod, trialmod, default - Probable permission groups: owner, admin, mod, trialmod, default

View File

@ -842,15 +842,17 @@ export class Channel extends EventEmitter {
let sentSocketIDs = new Array<string>(); let sentSocketIDs = new Array<string>();
for (const p of this.ppl) { for (const p of this.ppl) {
socketLoop: for (const socket of socketsBySocketID.values()) { socketLoop: for (const sock of socketsBySocketID.values()) {
if (socket.isDestroyed()) continue socketLoop; this.logger.debug(`Socket ${sock.getUUID()}`);
if (!socket.socketID) continue socketLoop; if (sock.isDestroyed()) continue socketLoop;
if (socket.getParticipantID() != p.id) continue socketLoop; if (!sock.socketID) continue socketLoop;
if (socket.getParticipantID() == part.id) continue socketLoop; if (sock.getUUID() == socket.getUUID()) continue socketLoop;
if (sentSocketIDs.includes(socket.socketID)) if (sock.getParticipantID() != p.id) continue socketLoop;
continue socketLoop; //if (socket.getParticipantID() == part.id) continue socketLoop;
socket.sendArray([clientMsg]); if (sentSocketIDs.includes(sock.socketID)) continue socketLoop;
sentSocketIDs.push(socket.socketID);
sock.sendArray([clientMsg]);
sentSocketIDs.push(sock.socketID);
} }
} }
} }