Add a queue of notifys and a way to turn them off and on (we do not want

notifys to happen during some commands). Based on code from George
Nachman.
This commit is contained in:
Nicholas Marriott
2012-07-13 06:27:41 +00:00
parent 35a8a61254
commit 5385a9bb34
3 changed files with 146 additions and 11 deletions

View File

@ -91,6 +91,8 @@ cmd_list_exec(struct cmd_list *cmdlist, struct cmd_ctx *ctx)
if (c != NULL && c->session != NULL)
guards = c->flags & CLIENT_CONTROL;
notify_disable();
retval = 0;
TAILQ_FOREACH(cmd, &cmdlist->list, qentry) {
if (guards)
@ -128,6 +130,8 @@ cmd_list_exec(struct cmd_list *cmdlist, struct cmd_ctx *ctx)
break;
}
}
notify_enable();
return (retval);
}