dont send 332 if there is no channel topic

This commit is contained in:
zefie
2025-06-17 18:55:08 -04:00
parent 929040caae
commit f8f6ea2f3d

View File

@@ -2097,17 +2097,9 @@ class WTVIRC {
this.broadcastToAllServers(`:${this.serverId} SJOIN ${this.getDate()} ${ch} +${modes.join('')} :${prefix}${socket.uniqueId}\r\n`); this.broadcastToAllServers(`:${this.serverId} SJOIN ${this.getDate()} ${ch} +${modes.join('')} :${prefix}${socket.uniqueId}\r\n`);
if (this.channeltopics.has(ch)) { if (this.channeltopics.has(ch)) {
const topic = this.channeltopics.get(ch); const topic = this.channeltopics.get(ch);
if (this.clientIsWebTV(socket)) { if (topic) {
await this.sendThrottled(socket, [`:${this.servername} 332 ${socket.nickname} ${ch} :${topic}\r\n`]);
} else {
socket.write(`:${this.servername} 332 ${socket.nickname} ${ch} :${topic}\r\n`); socket.write(`:${this.servername} 332 ${socket.nickname} ${ch} :${topic}\r\n`);
} }
} else {
if (this.clientIsWebTV(socket)) {
await this.sendThrottled(socket, [`:${this.servername} 331 ${socket.nickname} ${ch} :\r\n`]);
} else {
socket.write(`:${this.servername} 331 ${socket.nickname} ${ch} :\r\n`);
}
} }
var users = this.getUsersInChannel(ch); var users = this.getUsersInChannel(ch);
if (users.length > 0) { if (users.length > 0) {
@@ -2140,11 +2132,7 @@ class WTVIRC {
}); });
socket.write(`:${this.servername} 353 ${socket.nickname} = ${ch} :${userHosts.join(' ')}\r\n`); socket.write(`:${this.servername} 353 ${socket.nickname} = ${ch} :${userHosts.join(' ')}\r\n`);
} else { } else {
if (this.clientIsWebTV(socket)) { socket.write(`:${this.servername} 353 ${socket.nickname} = ${ch} :${users.join(' ')}\r\n`);
await this.sendThrottled(socket, [`:${this.servername} 353 ${socket.nickname} = ${ch} :${users.join(' ')}\r\n`]);
} else {
socket.write(`:${this.servername} 353 ${socket.nickname} = ${ch} :${users.join(' ')}\r\n`);
}
} }
} }
socket.write(`:${this.servername} 366 ${socket.nickname} ${ch} :End of /NAMES list\r\n`); socket.write(`:${this.servername} 366 ${socket.nickname} ${ch} :End of /NAMES list\r\n`);