From d2fb0efcd197bf0d581a0f7b1e27223d095cb339 Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 8 Dec 2015 01:10:31 +0000 Subject: Add hooks infrastructure, basic commands (set-hook, show-hooks) and a couple of not very useful client hooks. This will eventually let commands be run at various points and on notifications. Joint work with Thomas Adam. --- cmd-detach-client.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'cmd-detach-client.c') diff --git a/cmd-detach-client.c b/cmd-detach-client.c index f7369df0..d8128eae 100644 --- a/cmd-detach-client.c +++ b/cmd-detach-client.c @@ -72,9 +72,8 @@ cmd_detach_client_exec(struct cmd *self, struct cmd_q *cmdq) return (CMD_RETURN_ERROR); TAILQ_FOREACH(cloop, &clients, entry) { - if (cloop->session != s) - continue; - proc_send_s(cloop->peer, msgtype, cloop->session->name); + if (cloop->session == s) + server_client_detach(cloop, msgtype); } return (CMD_RETURN_STOP); } @@ -85,13 +84,12 @@ cmd_detach_client_exec(struct cmd *self, struct cmd_q *cmdq) if (args_has(args, 'a')) { TAILQ_FOREACH(cloop, &clients, entry) { - if (cloop->session == NULL || cloop == c) - continue; - proc_send_s(cloop->peer, msgtype, cloop->session->name); + if (cloop->session != NULL && cloop != c) + server_client_detach(cloop, msgtype); } return (CMD_RETURN_NORMAL); } - proc_send_s(c->peer, msgtype, c->session->name); + server_client_detach(c, msgtype); return (CMD_RETURN_STOP); } -- cgit v1.2.3