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.
This commit is contained in:
nicm
2015-12-08 01:10:31 +00:00
parent dbfce2a4d8
commit d2fb0efcd1
11 changed files with 364 additions and 13 deletions

View File

@ -108,7 +108,7 @@ cmd_attach_session(struct cmd_q *cmdq, const char *tflag, int dflag, int rflag,
TAILQ_FOREACH(c_loop, &clients, entry) {
if (c_loop->session != s || c == c_loop)
continue;
proc_send_s(c_loop->peer, MSG_DETACH, s->name);
server_client_detach(c, MSG_DETACH);
}
}
@ -139,7 +139,7 @@ cmd_attach_session(struct cmd_q *cmdq, const char *tflag, int dflag, int rflag,
TAILQ_FOREACH(c_loop, &clients, entry) {
if (c_loop->session != s || c == c_loop)
continue;
proc_send_s(c_loop->peer, MSG_DETACH, s->name);
server_client_detach(c_loop, MSG_DETACH);
}
}
@ -159,6 +159,7 @@ cmd_attach_session(struct cmd_q *cmdq, const char *tflag, int dflag, int rflag,
if (~c->flags & CLIENT_CONTROL)
proc_send(c->peer, MSG_READY, -1, NULL, 0);
hooks_run(c->session->hooks, "client-attached", c);
cmdq->client_exit = 0;
}
recalculate_sizes();