X-Git-Url: https://jfr.im/git/irc/evilnet/x3.git/blobdiff_plain/3a196bdbc4782e5437d23085a01e24e237a04e0e..0b401fb654b69fd9649954a9bdd5ff041971e62d:/src/proto-common.c diff --git a/src/proto-common.c b/src/proto-common.c index 9b1ccfe..3505f5e 100644 --- a/src/proto-common.c +++ b/src/proto-common.c @@ -26,6 +26,7 @@ #include "spamserv.h" #include "shun.h" #include "timeq.h" +#include "version.h" #ifdef HAVE_SYS_SOCKET_H #include #endif @@ -370,7 +371,7 @@ static CMD_FUNC(cmd_version) log_module(MAIN_LOG, LOG_ERROR, "Could not find VERSION origin user %s", origin); return 0; } - irc_numeric(user, 351, "%s %s %s", PACKAGE_TARNAME, PACKAGE_VERSION, self->name); + irc_numeric(user, 351, "%s %s+[%s] %s", PACKAGE_TARNAME, PACKAGE_VERSION, cvs_version, self->name); return 1; } @@ -520,21 +521,25 @@ get_chanmsg_bot(unsigned char prefix) } static mode_change_func_t *mcf_list; +static void **mcf_list_extra; static unsigned int mcf_size = 0, mcf_used = 0; void -reg_mode_change_func(mode_change_func_t handler) +reg_mode_change_func(mode_change_func_t handler, void *extra) { if (mcf_used == mcf_size) { if (mcf_size) { mcf_size <<= 1; mcf_list = realloc(mcf_list, mcf_size*sizeof(mode_change_func_t)); + mcf_list_extra = realloc(mcf_list_extra, mcf_size*sizeof(void*)); } else { mcf_size = 8; mcf_list = malloc(mcf_size*sizeof(mode_change_func_t)); + mcf_list_extra = malloc(mcf_size*sizeof(void*)); } } - mcf_list[mcf_used++] = handler; + mcf_list[mcf_used] = handler; + mcf_list_extra[mcf_used++] = extra; } static oper_func_t *of_list; @@ -749,7 +754,7 @@ mod_chanmode(struct userNode *who, struct chanNode *channel, char **modes, unsig mod_chanmode_apply(who, channel, change); if (flags & MC_NOTIFY) for (ii = 0; ii < mcf_used; ++ii) - mcf_list[ii](channel, who, change); + mcf_list[ii](channel, who, change, mcf_list_extra[ii]); mod_chanmode_free(change); return 1; } @@ -825,7 +830,7 @@ reg_channel_mode_func(channel_mode_func_t handler, void *extra) } else { cm_size = 8; cm_list = malloc(cm_size*sizeof(channel_mode_func_t)); - cm_list = malloc(cm_size*sizeof(void*)); + cm_list_extra = malloc(cm_size*sizeof(void*)); } } cm_list[cm_used] = handler; @@ -899,10 +904,10 @@ generate_hostmask(struct userNode *user, int options) if (data) style = atoi(data); - if ((style == 1) && user->handle_info && hidden_host_suffix && !(options & GENMASK_NO_HIDING)) { + if (((style == 1) || (style == 3)) && user->handle_info && hidden_host_suffix && !(options & GENMASK_NO_HIDING)) { hostname = alloca(strlen(user->handle_info->handle) + strlen(hidden_host_suffix) + 2); sprintf(hostname, "%s.%s", user->handle_info->handle, hidden_host_suffix); - } else if ((style == 2) && !(options & GENMASK_NO_HIDING)) { + } else if (((style == 2) || (style == 3)) && !(options & GENMASK_NO_HIDING)) { hostname = alloca(strlen(user->crypthost)); sprintf(hostname, "%s", user->crypthost); }