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`);
if (this.channeltopics.has(ch)) {
const topic = this.channeltopics.get(ch);
if (this.clientIsWebTV(socket)) {
await this.sendThrottled(socket, [`:${this.servername} 332 ${socket.nickname} ${ch} :${topic}\r\n`]);
} else {
if (topic) {
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);
if (users.length > 0) {
@@ -2139,14 +2131,10 @@ class WTVIRC {
return `${user}!${username}@${host}`;
});
socket.write(`:${this.servername} 353 ${socket.nickname} = ${ch} :${userHosts.join(' ')}\r\n`);
} else {
if (this.clientIsWebTV(socket)) {
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`);
const ops = this.channelops.get(ch) || new Set();
const halfops = this.channelhalfops.get(ch) || new Set();