Modularise handling of DCC offers

There's several different types of DCC offers, all of which need slightly
different handling.  Previously they were all handled by the monster function
register_dcc_type() - this breaks them out into seperate functions for handling
SEND, RESEND, CHAT and BOT offers, moves common code into static helper
functions and renames the entry point from ctcp.c to handle_dcc_offer().

This will allow adding a way for modules to register DCC offer types that
they're interested in.

This also moves rename_file() from misc.c into dcc.c, where its only user is.
This commit is contained in:
Kevin Easton
2015-10-28 21:46:38 +11:00
parent af3b0c920a
commit a2e8e103e0
5 changed files with 434 additions and 288 deletions

View File

@@ -128,7 +128,7 @@
void dcc_bot_transmit(char *, char *, char *);
void dcc_raw_transmit(char *, char *, char *);
void register_dcc_type(char *, char *, char *, char *, char *, char *, char *, char *, void (*func)(int));
void handle_dcc_offer(char *, char *, char *, char *, char *, char *, char *, char *);
void dcc_reject(char *, char *, char *);
char *dcc_raw_connect(char *, unsigned short);