Add a sendq_cleared hook

This commit is contained in:
Ed Kellett 2020-06-04 02:22:46 +01:00
parent b6058dee01
commit 9f25def02a
No known key found for this signature in database
GPG key ID: CB9986DEF342FABC
3 changed files with 8 additions and 0 deletions

View file

@ -46,6 +46,7 @@ extern int h_conf_read_end;
extern int h_outbound_msgbuf;
extern int h_rehash;
extern int h_cap_change;
extern int h_sendq_cleared;
void init_hook(void);
int register_hook(const char *name);

View file

@ -72,6 +72,7 @@ int h_conf_read_end;
int h_outbound_msgbuf;
int h_rehash;
int h_cap_change;
int h_sendq_cleared;
void
init_hook(void)
@ -97,6 +98,7 @@ init_hook(void)
h_outbound_msgbuf = register_hook("outbound_msgbuf");
h_rehash = register_hook("rehash");
h_cap_change = register_hook("cap_change");
h_sendq_cleared = register_hook("sendq_cleared");
}
/* grow_hooktable()

View file

@ -182,7 +182,12 @@ send_queued(struct Client *to)
send_queued_write, to);
}
else
{
hook_data_client hdata;
hdata.client = to;
ClearFlush(to);
call_hook(h_sendq_cleared, &hdata);
}
}
void