Change send_msg_to_channels() to remove 'channels' argument and always use PRIVMSG

The 'channels' argument was unnecessary because the channel list passed to it would
always be from get_server_channels(server) anyway.

Changing the message argument from a protocol message format string to a plain payload
string for PRIVMSG means printf-escaping of the argument is avoided in the caller.
This simplifies the callers and means we can remove the last use of quote_it().

This change also switches set_server_away() to use send_msg_to_channels() instead of
open-coding the equivalent, which simplifies that function a lot.

We are changing the signature of a function exported to modules here; however none
of the in-tree modules use this function so it should be OK.
This commit is contained in:
Kevin Easton
2016-10-13 01:36:19 +11:00
parent 08e3c99720
commit 04cf832604
4 changed files with 27 additions and 45 deletions

View File

@@ -569,7 +569,7 @@ extern Function_ptr *global;
#define set_server_trace_kill (*(void (*)(int , int ))global[SET_SERVER_TRACE_KILL])
#define add_server_channels (*(void (*)(int, ChannelList *))global[ADD_SERVER_CHANNELS])
#define set_server_channels (*(void (*)(int, ChannelList *))global[SET_SERVER_CHANNELS])
#define send_msg_to_channels (*(void (*)(ChannelList *, int, char *))global[SEND_MSG_TO_CHANNELS])
#define send_msg_to_channels (*(void (*)(int, const char *))global[SEND_MSG_TO_CHANNELS])
#define send_msg_to_nicks (*(void (*)(ChannelList *, int, char *))global[SEND_MSG_TO_NICKS])
#define is_server_queue (*(int (*)(void ))global[IS_SERVER_QUEUE])