mirror of
https://github.com/thelounge/thelounge
synced 2024-11-24 21:13:06 +00:00
client: id is always a string, not a number
This commit is contained in:
parent
c869ea9a73
commit
b89b0cad53
2 changed files with 5 additions and 5 deletions
|
@ -93,7 +93,7 @@ class Client {
|
|||
[socketId: string]: {token: string; openChannel: number};
|
||||
};
|
||||
config!: UserConfig;
|
||||
id!: number;
|
||||
id: string;
|
||||
idMsg!: number;
|
||||
idChan!: number;
|
||||
name!: string;
|
||||
|
@ -108,12 +108,12 @@ class Client {
|
|||
fileHash!: string;
|
||||
|
||||
constructor(manager: ClientManager, name?: string, config = {} as UserConfig) {
|
||||
this.id = uuidv4();
|
||||
_.merge(this, {
|
||||
awayMessage: "",
|
||||
lastActiveChannel: -1,
|
||||
attachedClients: {},
|
||||
config: config,
|
||||
id: uuidv4(),
|
||||
idChan: 1,
|
||||
idMsg: 1,
|
||||
name: name,
|
||||
|
@ -226,7 +226,7 @@ class Client {
|
|||
|
||||
emit(event: string, data?: any) {
|
||||
if (this.manager !== null) {
|
||||
this.manager.sockets.in(this.id.toString()).emit(event, data);
|
||||
this.manager.sockets.in(this.id).emit(event, data);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -771,7 +771,7 @@ class Client {
|
|||
|
||||
quit(signOut?: boolean) {
|
||||
const sockets = this.manager.sockets.sockets;
|
||||
const room = sockets.adapter.rooms.get(this.id.toString());
|
||||
const room = sockets.adapter.rooms.get(this.id);
|
||||
|
||||
if (room) {
|
||||
for (const user of room) {
|
||||
|
|
|
@ -818,7 +818,7 @@ function initializeClient(
|
|||
});
|
||||
|
||||
// socket.join is a promise depending on the adapter.
|
||||
void socket.join(client.id?.toString());
|
||||
void socket.join(client.id);
|
||||
|
||||
const sendInitEvent = (tokenToSend: string | null) => {
|
||||
socket.emit("init", {
|
||||
|
|
Loading…
Reference in a new issue