From 3d8e96491bb5a228b260e76c1bc9b16d8e960db4 Mon Sep 17 00:00:00 2001 From: Reto Brunner Date: Mon, 9 Feb 2026 08:08:15 +0100 Subject: [PATCH] topic: display topic when no arguments are given That's what the help says that we do, so do it. Fixes: https://github.com/thelounge/thelounge/issues/5026 --- server/plugins/inputs/topic.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/plugins/inputs/topic.ts b/server/plugins/inputs/topic.ts index 5fb76994..15a1be4e 100644 --- a/server/plugins/inputs/topic.ts +++ b/server/plugins/inputs/topic.ts @@ -19,6 +19,14 @@ const input: PluginInputHandler = function ({irc}, chan, cmd, args) { return; } + const cleanArgs = args.map((s) => s.trim()).filter((s) => s !== ""); + + if (cleanArgs.length === 0) { + irc.raw("TOPIC", chan.name); + return; + } + + // we use the non trimmed args here, the user may have added white space on purpose irc.setTopic(chan.name, args.join(" ")); return true; };