From 92ccabaafdd0f24752924dc4ce7b1e932dced561 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Thu, 13 Feb 2020 05:05:53 -0500 Subject: Refactor windows into array and add /move Oof. --- command.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'command.c') diff --git a/command.c b/command.c index 8166e2b..f801666 100644 --- a/command.c +++ b/command.c @@ -159,6 +159,17 @@ static void commandWindow(size_t id, char *params) { } } +static void commandMove(size_t id, char *params) { + if (!params) return; + char *name = strsep(¶ms, " "); + if (params) { + id = idFind(name); + if (id) uiMoveID(id, strtoul(params, NULL, 10)); + } else { + uiMoveID(id, strtoul(name, NULL, 10)); + } +} + static void commandClose(size_t id, char *params) { if (!params) { uiCloseID(id); @@ -213,6 +224,7 @@ static const struct Handler { { "/join", .fn = commandJoin, .restricted = true }, { "/list", .fn = commandList }, { "/me", .fn = commandMe }, + { "/move", .fn = commandMove }, { "/msg", .fn = commandMsg, .restricted = true }, { "/names", .fn = commandNames }, { "/nick", .fn = commandNick }, -- cgit 1.4.1