From afe9a8cc9da5ab0798b93fd7f20d6a1b8140dab5 Mon Sep 17 00:00:00 2001 From: zefie Date: Fri, 27 Jun 2025 20:43:42 -0400 Subject: [PATCH] add talkcity/microsoft chat server #channel msg intro --- zefie_wtvp_minisrv/includes/classes/WTVIRC.js | 13 +++++++++++++ zefie_wtvp_minisrv/includes/config.json | 10 ++++++++++ 2 files changed, 23 insertions(+) diff --git a/zefie_wtvp_minisrv/includes/classes/WTVIRC.js b/zefie_wtvp_minisrv/includes/classes/WTVIRC.js index bb633ee1..20e6ac1f 100644 --- a/zefie_wtvp_minisrv/includes/classes/WTVIRC.js +++ b/zefie_wtvp_minisrv/includes/classes/WTVIRC.js @@ -1913,6 +1913,19 @@ class WTVIRC { var channelObj = this.channelData.get(ch); channelObj.users.add(socket.nickname); await this.broadcastChannelJoin(ch, socket); + if ( + this.irc_config && + Array.isArray(this.irc_config.channels) + ) { + const channel_data = this.irc_config.channels.find(cfg => cfg.name === ch); + if (channel_data && channel_data.intro) { + // Send intro messages (array of lines) to the joining user only + for (const line of channel_data.intro) { + await this.safeWriteToSocket(socket, `:${ch}!system@${this.servername} PRIVMSG ${ch} :${line}\r\n`); + } + } + } + let modes = channelObj.modes; let prefix = ''; if (channelObj.ops.has(socket.nickname)) { diff --git a/zefie_wtvp_minisrv/includes/config.json b/zefie_wtvp_minisrv/includes/config.json index 5c36f47a..7056b9a2 100644 --- a/zefie_wtvp_minisrv/includes/config.json +++ b/zefie_wtvp_minisrv/includes/config.json @@ -78,6 +78,9 @@ "name": "#general", "modes": ["n","t"], "topic": "General Chat Channel", + "intro": [ + "Welcome to the general chat channel!" + ], "ops": [ "*!*@127.0.0.1" ] @@ -86,6 +89,9 @@ "name": "#WebTV", "modes": ["n", "t", "c", "C", "T"], "topic": "Welcome to the WebTV channel", + "intro": [ + "Welcome to the WebTV channel!" + ], "ops": [ "*!*@127.0.0.1" ] @@ -94,6 +100,10 @@ "name": "#secure", "modes": ["n", "t", "S", "Z"], "topic": "SSL only chat", + "intro": [ + "Welcome to zefie's secure hangout", + "Here, all traffic is SSL encrypted." + ], "ops": [ "*!*@127.0.0.1" ]