Skip to content
This repository was archived by the owner on Jun 24, 2021. It is now read-only.

Commit 34d26ee

Browse files
committed
Add a sendq_cleared hook
1 parent 892e320 commit 34d26ee

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

include/hook.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ extern int h_conf_read_end;
3636
extern int h_outbound_msgbuf;
3737
extern int h_rehash;
3838
extern int h_cap_change;
39+
extern int h_sendq_cleared;
3940

4041
void init_hook(void);
4142
int register_hook(const char *name);

ircd/hook.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ int h_conf_read_end;
6565
int h_outbound_msgbuf;
6666
int h_rehash;
6767
int h_cap_change;
68+
int h_sendq_cleared;
6869

6970
void
7071
init_hook(void)
@@ -90,6 +91,7 @@ init_hook(void)
9091
h_outbound_msgbuf = register_hook("outbound_msgbuf");
9192
h_rehash = register_hook("rehash");
9293
h_cap_change = register_hook("cap_change");
94+
h_sendq_cleared = register_hook("sendq_cleared");
9395
}
9496

9597
/* grow_hooktable()

ircd/send.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,12 @@ send_queued(struct Client *to)
182182
send_queued_write, to);
183183
}
184184
else
185+
{
186+
hook_data_client hdata;
187+
hdata.client = to;
185188
ClearFlush(to);
189+
call_hook(h_sendq_cleared, &hdata);
190+
}
186191
}
187192

188193
void

0 commit comments

Comments
 (0)