diff options
Diffstat (limited to 'modules')
61 files changed, 329 insertions, 758 deletions
diff --git a/modules/Makefile.am b/modules/Makefile.am index 21eadb4..2b81b97 100644 --- a/modules/Makefile.am +++ b/modules/Makefile.am @@ -50,8 +50,6 @@ modules_LTLIBRARIES = m_accept.la \ m_svsmode.la \ m_svsnick.la \ m_tburst.la \ - m_testline.la \ - m_testmask.la \ m_time.la \ m_topic.la \ m_trace.la \ @@ -113,8 +111,6 @@ m_svinfo_la_LDFLAGS = $(MODULE_FLAGS) m_svsmode_la_LDFLAGS = $(MODULE_FLAGS) m_svsnick_la_LDFLAGS = $(MODULE_FLAGS) m_tburst_la_LDFLAGS = $(MODULE_FLAGS) -m_testline_la_LDFLAGS = $(MODULE_FLAGS) -m_testmask_la_LDFLAGS = $(MODULE_FLAGS) m_time_la_LDFLAGS = $(MODULE_FLAGS) m_topic_la_LDFLAGS = $(MODULE_FLAGS) m_trace_la_LDFLAGS = $(MODULE_FLAGS) @@ -175,8 +171,6 @@ m_svinfo_la_SOURCES = m_svinfo.c m_svsmode_la_SOURCES = m_svsmode.c m_svsnick_la_SOURCES = m_svsnick.c m_tburst_la_SOURCES = m_tburst.c -m_testline_la_SOURCES = m_testline.c -m_testmask_la_SOURCES = m_testmask.c m_time_la_SOURCES = m_time.c m_topic_la_SOURCES = m_topic.c m_trace_la_SOURCES = m_trace.c diff --git a/modules/Makefile.in b/modules/Makefile.in index 43e7ec2..93b1a14 100644 --- a/modules/Makefile.in +++ b/modules/Makefile.in @@ -366,18 +366,6 @@ m_tburst_la_OBJECTS = $(am_m_tburst_la_OBJECTS) m_tburst_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(m_tburst_la_LDFLAGS) $(LDFLAGS) -o $@ -m_testline_la_LIBADD = -am_m_testline_la_OBJECTS = m_testline.lo -m_testline_la_OBJECTS = $(am_m_testline_la_OBJECTS) -m_testline_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(m_testline_la_LDFLAGS) $(LDFLAGS) -o $@ -m_testmask_la_LIBADD = -am_m_testmask_la_OBJECTS = m_testmask.lo -m_testmask_la_OBJECTS = $(am_m_testmask_la_OBJECTS) -m_testmask_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(m_testmask_la_LDFLAGS) $(LDFLAGS) -o $@ m_time_la_LIBADD = am_m_time_la_OBJECTS = m_time.lo m_time_la_OBJECTS = $(am_m_time_la_OBJECTS) @@ -517,8 +505,7 @@ SOURCES = $(m_accept_la_SOURCES) $(m_admin_la_SOURCES) \ $(m_services_la_SOURCES) $(m_set_la_SOURCES) \ $(m_stats_la_SOURCES) $(m_svinfo_la_SOURCES) \ $(m_svsmode_la_SOURCES) $(m_svsnick_la_SOURCES) \ - $(m_tburst_la_SOURCES) $(m_testline_la_SOURCES) \ - $(m_testmask_la_SOURCES) $(m_time_la_SOURCES) \ + $(m_tburst_la_SOURCES) $(m_time_la_SOURCES) \ $(m_topic_la_SOURCES) $(m_trace_la_SOURCES) \ $(m_user_la_SOURCES) $(m_userhost_la_SOURCES) \ $(m_users_la_SOURCES) $(m_version_la_SOURCES) \ @@ -547,8 +534,7 @@ DIST_SOURCES = $(m_accept_la_SOURCES) $(m_admin_la_SOURCES) \ $(m_services_la_SOURCES) $(m_set_la_SOURCES) \ $(m_stats_la_SOURCES) $(m_svinfo_la_SOURCES) \ $(m_svsmode_la_SOURCES) $(m_svsnick_la_SOURCES) \ - $(m_tburst_la_SOURCES) $(m_testline_la_SOURCES) \ - $(m_testmask_la_SOURCES) $(m_time_la_SOURCES) \ + $(m_tburst_la_SOURCES) $(m_time_la_SOURCES) \ $(m_topic_la_SOURCES) $(m_trace_la_SOURCES) \ $(m_user_la_SOURCES) $(m_userhost_la_SOURCES) \ $(m_users_la_SOURCES) $(m_version_la_SOURCES) \ @@ -814,8 +800,6 @@ modules_LTLIBRARIES = m_accept.la \ m_svsmode.la \ m_svsnick.la \ m_tburst.la \ - m_testline.la \ - m_testmask.la \ m_time.la \ m_topic.la \ m_trace.la \ @@ -876,8 +860,6 @@ m_svinfo_la_LDFLAGS = $(MODULE_FLAGS) m_svsmode_la_LDFLAGS = $(MODULE_FLAGS) m_svsnick_la_LDFLAGS = $(MODULE_FLAGS) m_tburst_la_LDFLAGS = $(MODULE_FLAGS) -m_testline_la_LDFLAGS = $(MODULE_FLAGS) -m_testmask_la_LDFLAGS = $(MODULE_FLAGS) m_time_la_LDFLAGS = $(MODULE_FLAGS) m_topic_la_LDFLAGS = $(MODULE_FLAGS) m_trace_la_LDFLAGS = $(MODULE_FLAGS) @@ -937,8 +919,6 @@ m_svinfo_la_SOURCES = m_svinfo.c m_svsmode_la_SOURCES = m_svsmode.c m_svsnick_la_SOURCES = m_svsnick.c m_tburst_la_SOURCES = m_tburst.c -m_testline_la_SOURCES = m_testline.c -m_testmask_la_SOURCES = m_testmask.c m_time_la_SOURCES = m_time.c m_topic_la_SOURCES = m_topic.c m_trace_la_SOURCES = m_trace.c @@ -1112,10 +1092,6 @@ m_svsnick.la: $(m_svsnick_la_OBJECTS) $(m_svsnick_la_DEPENDENCIES) $(EXTRA_m_svs $(AM_V_CCLD)$(m_svsnick_la_LINK) -rpath $(modulesdir) $(m_svsnick_la_OBJECTS) $(m_svsnick_la_LIBADD) $(LIBS) m_tburst.la: $(m_tburst_la_OBJECTS) $(m_tburst_la_DEPENDENCIES) $(EXTRA_m_tburst_la_DEPENDENCIES) $(AM_V_CCLD)$(m_tburst_la_LINK) -rpath $(modulesdir) $(m_tburst_la_OBJECTS) $(m_tburst_la_LIBADD) $(LIBS) -m_testline.la: $(m_testline_la_OBJECTS) $(m_testline_la_DEPENDENCIES) $(EXTRA_m_testline_la_DEPENDENCIES) - $(AM_V_CCLD)$(m_testline_la_LINK) -rpath $(modulesdir) $(m_testline_la_OBJECTS) $(m_testline_la_LIBADD) $(LIBS) -m_testmask.la: $(m_testmask_la_OBJECTS) $(m_testmask_la_DEPENDENCIES) $(EXTRA_m_testmask_la_DEPENDENCIES) - $(AM_V_CCLD)$(m_testmask_la_LINK) -rpath $(modulesdir) $(m_testmask_la_OBJECTS) $(m_testmask_la_LIBADD) $(LIBS) m_time.la: $(m_time_la_OBJECTS) $(m_time_la_DEPENDENCIES) $(EXTRA_m_time_la_DEPENDENCIES) $(AM_V_CCLD)$(m_time_la_LINK) -rpath $(modulesdir) $(m_time_la_OBJECTS) $(m_time_la_LIBADD) $(LIBS) m_topic.la: $(m_topic_la_OBJECTS) $(m_topic_la_DEPENDENCIES) $(EXTRA_m_topic_la_DEPENDENCIES) @@ -1196,8 +1172,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m_svsmode.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m_svsnick.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m_tburst.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m_testline.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m_testmask.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m_time.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m_topic.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m_trace.Plo@am__quote@ diff --git a/modules/core/m_die.c b/modules/core/m_die.c index b47c92c..7c466dc 100644 --- a/modules/core/m_die.c +++ b/modules/core/m_die.c @@ -45,7 +45,7 @@ mo_die(struct Client *client_p, struct Client *source_p, if (!HasOFlag(source_p, OPER_FLAG_DIE)) { - sendto_one(source_p, form_str(ERR_NOPRIVS), + sendto_one(source_p, ERR_NOPRIVS, me.name, source_p->name, "die"); return; } diff --git a/modules/core/m_join.c b/modules/core/m_join.c index c5b21e4..730385f 100644 --- a/modules/core/m_join.c +++ b/modules/core/m_join.c @@ -96,6 +96,7 @@ m_join(struct Client *client_p, struct Client *source_p, char *key_list = NULL; char *chan_list = NULL; char *chan = NULL; + const char *s = NULL; struct Channel *chptr = NULL; struct MaskItem *conf = NULL; int i = 0; @@ -103,7 +104,7 @@ m_join(struct Client *client_p, struct Client *source_p, if (EmptyString(parv[1])) { - sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), + sendto_one(source_p, ERR_NEEDMOREPARAMS, me.name, source_p->name, "JOIN"); return; } @@ -128,7 +129,7 @@ m_join(struct Client *client_p, struct Client *source_p, if (!check_channel_name(chan, 1)) { - sendto_one(source_p, form_str(ERR_BADCHANNAME), + sendto_one(source_p, ERR_BADCHANNAME, me.name, source_p->name, chan); continue; } @@ -139,7 +140,7 @@ m_join(struct Client *client_p, struct Client *source_p, { if (conf) ++conf->count; - sendto_one(source_p, form_str(ERR_BADCHANNAME), + sendto_one(source_p, ERR_BADCHANNAME, me.name, source_p->name, chan); sendto_realops_flags(UMODE_SPY, L_ALL, SEND_NOTICE, "Forbidding reserved channel [%s] from user %s", @@ -152,7 +153,7 @@ m_join(struct Client *client_p, struct Client *source_p, ConfigChannel.max_chans_per_oper : ConfigChannel.max_chans_per_user)) { - sendto_one(source_p, form_str(ERR_TOOMANYCHANNELS), + sendto_one(source_p, ERR_TOOMANYCHANNELS, me.name, source_p->name, chan); break; } @@ -165,7 +166,7 @@ m_join(struct Client *client_p, struct Client *source_p, if (splitmode && !HasUMode(source_p, UMODE_OPER) && ConfigChannel.no_join_on_split) { - sendto_one(source_p, form_str(ERR_UNAVAILRESOURCE), + sendto_one(source_p, ERR_UNAVAILRESOURCE, me.name, source_p->name, chan); continue; } @@ -173,9 +174,9 @@ m_join(struct Client *client_p, struct Client *source_p, /* * can_join checks for +i key, bans. */ - if ((i = can_join(source_p, chptr, key))) + if ((s = can_join(source_p, chptr, key))) { - sendto_one(source_p, form_str(i), me.name, + sendto_one(source_p, s, me.name, source_p->name, chptr->chname); continue; } @@ -194,7 +195,7 @@ m_join(struct Client *client_p, struct Client *source_p, if (splitmode && !HasUMode(source_p, UMODE_OPER) && (ConfigChannel.no_create_on_split || ConfigChannel.no_join_on_split)) { - sendto_one(source_p, form_str(ERR_UNAVAILRESOURCE), + sendto_one(source_p, ERR_UNAVAILRESOURCE, me.name, source_p->name, chan); continue; } @@ -265,10 +266,10 @@ m_join(struct Client *client_p, struct Client *source_p, if (chptr->topic[0]) { - sendto_one(source_p, form_str(RPL_TOPIC), me.name, + sendto_one(source_p, RPL_TOPIC, me.name, source_p->name, chptr->chname, chptr->topic); - sendto_one(source_p, form_str(RPL_TOPICWHOTIME), + sendto_one(source_p, RPL_TOPICWHOTIME, me.name, source_p->name, chptr->chname, chptr->topic_info, chptr->topic_time); } diff --git a/modules/core/m_kick.c b/modules/core/m_kick.c index f800136..ef4d464 100644 --- a/modules/core/m_kick.c +++ b/modules/core/m_kick.c @@ -72,7 +72,7 @@ m_kick(struct Client *client_p, struct Client *source_p, if (EmptyString(parv[2])) { - sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), + sendto_one(source_p, ERR_NEEDMOREPARAMS, from, to, "KICK"); return; } @@ -95,7 +95,7 @@ m_kick(struct Client *client_p, struct Client *source_p, if ((chptr = hash_find_channel(name)) == NULL) { - sendto_one(source_p, form_str(ERR_NOSUCHCHANNEL), + sendto_one(source_p, ERR_NOSUCHCHANNEL, from, to, name); return; } @@ -106,7 +106,7 @@ m_kick(struct Client *client_p, struct Client *source_p, { if (MyConnect(source_p)) { - sendto_one(source_p, form_str(ERR_NOTONCHANNEL), + sendto_one(source_p, ERR_NOTONCHANNEL, me.name, source_p->name, name); return; } @@ -118,7 +118,7 @@ m_kick(struct Client *client_p, struct Client *source_p, if (MyConnect(source_p)) { /* user on _my_ server, with no chanops.. so go away */ - sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED), + sendto_one(source_p, ERR_CHANOPRIVSNEEDED, me.name, source_p->name, name); return; } @@ -126,7 +126,7 @@ m_kick(struct Client *client_p, struct Client *source_p, if (chptr->channelts == 0) { /* If its a TS 0 channel, do it the old way */ - sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED), + sendto_one(source_p, ERR_CHANOPRIVSNEEDED, from, to, name); return; } @@ -177,7 +177,7 @@ m_kick(struct Client *client_p, struct Client *source_p, if (((chptr->mode.mode & MODE_PRIVATE) && has_member_flags(ms_target, CHFL_CHANOP|CHFL_HALFOP)) || has_member_flags(ms_target, CHFL_CHANOP)) { - sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED), + sendto_one(source_p, ERR_CHANOPRIVSNEEDED, me.name, source_p->name, name); return; } @@ -209,7 +209,7 @@ m_kick(struct Client *client_p, struct Client *source_p, remove_user_from_channel(ms_target); } else - sendto_one(source_p, form_str(ERR_USERNOTINCHANNEL), + sendto_one(source_p, ERR_USERNOTINCHANNEL, from, to, user, name); } diff --git a/modules/core/m_kill.c b/modules/core/m_kill.c index 434c906..73968b9 100644 --- a/modules/core/m_kill.c +++ b/modules/core/m_kill.c @@ -87,14 +87,14 @@ mo_kill(struct Client *client_p, struct Client *source_p, if (*user == '\0') { - sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), + sendto_one(source_p, ERR_NEEDMOREPARAMS, me.name, source_p->name, "KILL"); return; } if (!HasOFlag(source_p, OPER_FLAG_GLOBAL_KILL|OPER_FLAG_K)) { - sendto_one(source_p, form_str(ERR_NOPRIVILEGES), + sendto_one(source_p, ERR_NOPRIVILEGES, me.name, source_p->name); return; } @@ -118,7 +118,7 @@ mo_kill(struct Client *client_p, struct Client *source_p, (time_t)ConfigFileEntry.kill_chase_time_limit)) == NULL) { - sendto_one(source_p, form_str(ERR_NOSUCHNICK), + sendto_one(source_p, ERR_NOSUCHNICK, me.name, source_p->name, user); return; } @@ -129,7 +129,7 @@ mo_kill(struct Client *client_p, struct Client *source_p, if (IsServer(target_p) || IsMe(target_p)) { - sendto_one(source_p, form_str(ERR_CANTKILLSERVER), + sendto_one(source_p, ERR_CANTKILLSERVER, me.name, source_p->name); return; } @@ -195,7 +195,7 @@ ms_kill(struct Client *client_p, struct Client *source_p, if (EmptyString(parv[1])) { - sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), + sendto_one(source_p, ERR_NEEDMOREPARAMS, me.name, source_p->name, "KILL"); return; } @@ -234,7 +234,7 @@ ms_kill(struct Client *client_p, struct Client *source_p, (time_t)ConfigFileEntry.kill_chase_time_limit)) == NULL) { - sendto_one(source_p, form_str(ERR_NOSUCHNICK), + sendto_one(source_p, ERR_NOSUCHNICK, me.name, source_p->name, user); return; } @@ -245,7 +245,7 @@ ms_kill(struct Client *client_p, struct Client *source_p, if (IsServer(target_p) || IsMe(target_p)) { - sendto_one(source_p, form_str(ERR_CANTKILLSERVER), + sendto_one(source_p, ERR_CANTKILLSERVER, me.name, source_p->name); return; } diff --git a/modules/core/m_message.c b/modules/core/m_message.c index 7fadaba..4414c36 100644 --- a/modules/core/m_message.c +++ b/modules/core/m_message.c @@ -146,7 +146,7 @@ m_message(int p_or_n, const char *command, struct Client *client_p, if (parc < 2 || EmptyString(parv[1])) { if (p_or_n != NOTICE) - sendto_one(source_p, form_str(ERR_NORECIPIENT), + sendto_one(source_p, ERR_NORECIPIENT, ID_or_name(&me, client_p), ID_or_name(source_p, client_p), command); return; @@ -155,7 +155,7 @@ m_message(int p_or_n, const char *command, struct Client *client_p, if (parc < 3 || EmptyString(parv[2])) { if (p_or_n != NOTICE) - sendto_one(source_p, form_str(ERR_NOTEXTTOSEND), + sendto_one(source_p, ERR_NOTEXTTOSEND, ID_or_name(&me, client_p), ID_or_name(source_p, client_p)); return; @@ -238,7 +238,7 @@ build_target_list(int p_or_n, const char *command, struct Client *client_p, { if (ntargets >= ConfigFileEntry.max_targets) { - sendto_one(source_p, form_str(ERR_TOOMANYTARGETS), + sendto_one(source_p, ERR_TOOMANYTARGETS, ID_or_name(&me, client_p), ID_or_name(source_p, client_p), nick, ConfigFileEntry.max_targets); @@ -251,7 +251,7 @@ build_target_list(int p_or_n, const char *command, struct Client *client_p, else { if (p_or_n != NOTICE) - sendto_one(source_p, form_str(ERR_NOSUCHNICK), + sendto_one(source_p, ERR_NOSUCHNICK, ID_or_name(&me, client_p), ID_or_name(source_p, client_p), nick); } @@ -265,7 +265,7 @@ build_target_list(int p_or_n, const char *command, struct Client *client_p, { if (ntargets >= ConfigFileEntry.max_targets) { - sendto_one(source_p, form_str(ERR_TOOMANYTARGETS), + sendto_one(source_p, ERR_TOOMANYTARGETS, ID_or_name(&me, client_p), ID_or_name(source_p, client_p), nick, ConfigFileEntry.max_targets); @@ -303,7 +303,7 @@ build_target_list(int p_or_n, const char *command, struct Client *client_p, /* suggested by Mortiis */ if (*nick == '\0') /* if its a '\0' dump it, there is no recipient */ { - sendto_one(source_p, form_str(ERR_NORECIPIENT), + sendto_one(source_p, ERR_NORECIPIENT, ID_or_name(&me, client_p), ID_or_name(source_p, client_p), command); continue; @@ -320,7 +320,7 @@ build_target_list(int p_or_n, const char *command, struct Client *client_p, if (!has_member_flags(find_channel_link(source_p, chptr), CHFL_CHANOP|CHFL_HALFOP|CHFL_VOICE)) { - sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED), + sendto_one(source_p, ERR_CHANOPRIVSNEEDED, ID_or_name(&me, client_p), ID_or_name(source_p, client_p), with_prefix); return(-1); @@ -331,7 +331,7 @@ build_target_list(int p_or_n, const char *command, struct Client *client_p, { if (ntargets >= ConfigFileEntry.max_targets) { - sendto_one(source_p, form_str(ERR_TOOMANYTARGETS), + sendto_one(source_p, ERR_TOOMANYTARGETS, ID_or_name(&me, client_p), ID_or_name(source_p, client_p), nick, ConfigFileEntry.max_targets); @@ -345,7 +345,7 @@ build_target_list(int p_or_n, const char *command, struct Client *client_p, else { if (p_or_n != NOTICE) - sendto_one(source_p, form_str(ERR_NOSUCHNICK), + sendto_one(source_p, ERR_NOSUCHNICK, ID_or_name(&me, client_p), ID_or_name(source_p, client_p), nick); } @@ -361,7 +361,7 @@ build_target_list(int p_or_n, const char *command, struct Client *client_p, if (p_or_n != NOTICE) { if (!IsDigit(*nick) || MyClient(source_p)) - sendto_one(source_p, form_str(ERR_NOSUCHNICK), + sendto_one(source_p, ERR_NOSUCHNICK, ID_or_name(&me, client_p), ID_or_name(source_p, client_p), nick); } @@ -429,7 +429,7 @@ msg_channel(int p_or_n, const char *command, struct Client *client_p, else { if (p_or_n != NOTICE) - sendto_one(source_p, form_str(ERR_CANNOTSENDTOCHAN), + sendto_one(source_p, ERR_CANNOTSENDTOCHAN, ID_or_name(&me, client_p), ID_or_name(source_p, client_p), chptr->chname); } @@ -505,7 +505,7 @@ msg_client(int p_or_n, const char *command, struct Client *source_p, source_p->localClient->last_privmsg = CurrentTime; if ((p_or_n != NOTICE) && target_p->away[0]) - sendto_one(source_p, form_str(RPL_AWAY), me.name, + sendto_one(source_p, RPL_AWAY, me.name, source_p->name, target_p->name, target_p->away); if (HasUMode(target_p, UMODE_REGONLY) && target_p != source_p) @@ -513,7 +513,7 @@ msg_client(int p_or_n, const char *command, struct Client *source_p, if (!HasUMode(source_p, UMODE_REGISTERED|UMODE_OPER)) { if (p_or_n != NOTICE) - sendto_one(source_p, form_str(ERR_NONONREG), me.name, source_p->name, + sendto_one(source_p, ERR_NONONREG, me.name, source_p->name, target_p->name); return; } @@ -536,7 +536,7 @@ msg_client(int p_or_n, const char *command, struct Client *source_p, { /* check for accept, flag recipient incoming message */ if (p_or_n != NOTICE) - sendto_one(source_p, form_str(RPL_TARGUMODEG), + sendto_one(source_p, RPL_TARGUMODEG, ID_or_name(&me, source_p->from), ID_or_name(source_p, source_p->from), target_p->name); @@ -544,11 +544,11 @@ msg_client(int p_or_n, const char *command, struct Client *source_p, ConfigFileEntry.caller_id_wait) < CurrentTime) { if (p_or_n != NOTICE) - sendto_one(source_p, form_str(RPL_TARGNOTIFY), + sendto_one(source_p, RPL_TARGNOTIFY, ID_or_name(&me, source_p->from), ID_or_name(source_p, source_p->from), target_p->name); - sendto_one(target_p, form_str(RPL_UMODEGMSG), + sendto_one(target_p, RPL_UMODEGMSG, me.name, target_p->name, get_client_name(source_p, HIDE_IP)); @@ -738,7 +738,7 @@ handle_special(int p_or_n, const char *command, struct Client *client_p, if ((host = strchr(nick, '%')) && !HasUMode(source_p, UMODE_OPER)) { - sendto_one(source_p, form_str(ERR_NOPRIVILEGES), + sendto_one(source_p, ERR_NOPRIVILEGES, ID_or_name(&me, client_p), ID_or_name(source_p, client_p)); return; @@ -787,18 +787,18 @@ handle_special(int p_or_n, const char *command, struct Client *client_p, source_p->localClient->last_privmsg = CurrentTime; } else - sendto_one(source_p, form_str(ERR_TOOMANYTARGETS), + sendto_one(source_p, ERR_TOOMANYTARGETS, ID_or_name(&me, client_p), ID_or_name(source_p, client_p), nick, ConfigFileEntry.max_targets); } } else if (server && *(server+1) && (target_p == NULL)) - sendto_one(source_p, form_str(ERR_NOSUCHSERVER), + sendto_one(source_p, ERR_NOSUCHSERVER, ID_or_name(&me, client_p), ID_or_name(source_p, client_p), server+1); else if (server && (target_p == NULL)) - sendto_one(source_p, form_str(ERR_NOSUCHNICK), + sendto_one(source_p, ERR_NOSUCHNICK, ID_or_name(&me, client_p), ID_or_name(source_p, client_p), nick); return; @@ -806,7 +806,7 @@ handle_special(int p_or_n, const char *command, struct Client *client_p, if (!HasUMode(source_p, UMODE_OPER)) { - sendto_one(source_p, form_str(ERR_NOPRIVILEGES), + sendto_one(source_p, ERR_NOPRIVILEGES, ID_or_name(&me, client_p), ID_or_name(source_p, client_p)); return; @@ -832,7 +832,7 @@ handle_special(int p_or_n, const char *command, struct Client *client_p, if ((s = strrchr(nick, '.')) == NULL) { - sendto_one(source_p, form_str(ERR_NOTOPLEVEL), + sendto_one(source_p, ERR_NOTOPLEVEL, me.name, source_p->name, nick); return; } @@ -843,7 +843,7 @@ handle_special(int p_or_n, const char *command, struct Client *client_p, if (*s == '*' || *s == '?') { - sendto_one(source_p, form_str(ERR_WILDTOPLEVEL), + sendto_one(source_p, ERR_WILDTOPLEVEL, ID_or_name(&me, client_p), ID_or_name(source_p, client_p), nick); return; diff --git a/modules/core/m_mode.c b/modules/core/m_mode.c index 897ce59..6e115b8 100644 --- a/modules/core/m_mode.c +++ b/modules/core/m_mode.c @@ -56,7 +56,7 @@ m_mode(struct Client *client_p, struct Client *source_p, if (EmptyString(parv[1])) { - sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), + sendto_one(source_p, ERR_NEEDMOREPARAMS, me.name, source_p->name, "MODE"); return; } @@ -71,7 +71,7 @@ m_mode(struct Client *client_p, struct Client *source_p, if ((chptr = hash_find_channel(parv[1])) == NULL) { - sendto_one(source_p, form_str(ERR_NOSUCHCHANNEL), + sendto_one(source_p, ERR_NOSUCHCHANNEL, ID_or_name(&me, source_p->from), ID_or_name(source_p, source_p->from), parv[1]); @@ -82,9 +82,9 @@ m_mode(struct Client *client_p, struct Client *source_p, if (parc < 3) { channel_modes(chptr, source_p, modebuf, parabuf); - sendto_one(source_p, form_str(RPL_CHANNELMODEIS), + sendto_one(source_p, RPL_CHANNELMODEIS, me.name, source_p->name, chptr->chname, modebuf, parabuf); - sendto_one(source_p, form_str(RPL_CREATIONTIME), + sendto_one(source_p, RPL_CREATIONTIME, me.name, source_p->name, chptr->chname, chptr->channelts); } /* bounce all modes from people we deop on sjoin @@ -133,7 +133,7 @@ ms_tmode(struct Client *client_p, struct Client *source_p, int parc, char *parv[ if ((chptr = hash_find_channel(parv[2])) == NULL) { - sendto_one(source_p, form_str(ERR_NOSUCHCHANNEL), + sendto_one(source_p, ERR_NOSUCHCHANNEL, ID_or_name(&me, client_p), ID_or_name(source_p, client_p), parv[2]); return; } diff --git a/modules/core/m_nick.c b/modules/core/m_nick.c index a490292..747b479 100644 --- a/modules/core/m_nick.c +++ b/modules/core/m_nick.c @@ -171,7 +171,7 @@ change_local_nick(struct Client *source_p, const char *nick) fd_note(&source_p->localClient->fd, "Nick: %s", nick); } else - sendto_one(source_p, form_str(ERR_NICKTOOFAST), + sendto_one(source_p, ERR_NICKTOOFAST, me.name, source_p->name, source_p->name, nick, ConfigFileEntry.max_nick_time); } @@ -201,7 +201,7 @@ mr_nick(struct Client *client_p, struct Client *source_p, if (parc < 2 || EmptyString(parv[1])) { - sendto_one(source_p, form_str(ERR_NONICKNAMEGIVEN), me.name, + sendto_one(source_p, ERR_NONICKNAMEGIVEN, me.name, source_p->name[0] ? source_p->name : "*"); return; } @@ -216,7 +216,7 @@ mr_nick(struct Client *client_p, struct Client *source_p, /* check the nickname is ok */ if (!valid_nickname(nick, 1)) { - sendto_one(source_p, form_str(ERR_ERRONEUSNICKNAME), me.name, + sendto_one(source_p, ERR_ERRONEUSNICKNAME, me.name, source_p->name[0] ? source_p->name : "*", parv[1]); return; } @@ -225,7 +225,7 @@ mr_nick(struct Client *client_p, struct Client *source_p, if ((conf = find_matching_name_conf(CONF_NRESV, nick, NULL, NULL, 0))) { ++conf->count; - sendto_one(source_p, form_str(ERR_ERRONEUSNICKNAME), me.name, + sendto_one(source_p, ERR_ERRONEUSNICKNAME, me.name, source_p->name[0] ? source_p->name : "*", nick); sendto_realops_flags(UMODE_REJ, L_ALL, SEND_NOTICE, "Forbidding reserved nick [%s] from user %s", @@ -238,7 +238,7 @@ mr_nick(struct Client *client_p, struct Client *source_p, else if (source_p == target_p) strlcpy(source_p->name, nick, sizeof(source_p->name)); else - sendto_one(source_p, form_str(ERR_NICKNAMEINUSE), me.name, "*", nick); + sendto_one(source_p, ERR_NICKNAMEINUSE, me.name, "*", nick); } @@ -268,7 +268,7 @@ m_nick(struct Client *client_p, struct Client *source_p, if (parc < 2 || EmptyString(parv[1])) { - sendto_one(source_p, form_str(ERR_NONICKNAMEGIVEN), + sendto_one(source_p, ERR_NONICKNAMEGIVEN, me.name, source_p->name); return; } @@ -283,7 +283,7 @@ m_nick(struct Client *client_p, struct Client *source_p, /* check the nickname is ok */ if (!valid_nickname(nick, 1)) { - sendto_one(source_p, form_str(ERR_ERRONEUSNICKNAME), + sendto_one(source_p, ERR_ERRONEUSNICKNAME, me.name, source_p->name, nick); return; } @@ -294,7 +294,7 @@ m_nick(struct Client *client_p, struct Client *source_p, (conf = find_matching_name_conf(CONF_NRESV, nick, NULL, NULL, 0))) { ++conf->count; - sendto_one(source_p, form_str(ERR_ERRONEUSNICKNAME), + sendto_one(source_p, ERR_ERRONEUSNICKNAME, me.name, source_p->name, nick); sendto_realops_flags(UMODE_REJ, L_ALL, SEND_NOTICE, "Forbidding reserved nick [%s] from user %s", @@ -325,7 +325,7 @@ m_nick(struct Client *client_p, struct Client *source_p, change_local_nick(source_p, nick); } else - sendto_one(source_p, form_str(ERR_NICKNAMEINUSE), me.name, + sendto_one(source_p, ERR_NICKNAMEINUSE, me.name, source_p->name, nick); } @@ -803,7 +803,7 @@ perform_nick_collides(struct Client *source_p, struct Client *client_p, "%s (Nick collision (new))", me.name); ++ServerStats.is_kill; - sendto_one(target_p, form_str(ERR_NICKCOLLISION), + sendto_one(target_p, ERR_NICKCOLLISION, me.name, target_p->name, target_p->name); AddFlag(target_p, FLAGS_KILLED); @@ -842,7 +842,7 @@ perform_nick_collides(struct Client *source_p, struct Client *client_p, client_p->name); ++ServerStats.is_kill; - sendto_one(target_p, form_str(ERR_NICKCOLLISION), + sendto_one(target_p, ERR_NICKCOLLISION, me.name, target_p->name, target_p->name); /* if it came from a LL server, itd have been source_p, @@ -873,7 +873,7 @@ perform_nick_collides(struct Client *source_p, struct Client *client_p, source_p->name, target_p->name, target_p->from->name, client_p->name); - sendto_one(target_p, form_str(ERR_NICKCOLLISION), me.name, + sendto_one(target_p, ERR_NICKCOLLISION, me.name, target_p->name, target_p->name); ++ServerStats.is_kill; @@ -941,7 +941,7 @@ perform_nick_collides(struct Client *source_p, struct Client *client_p, me.name); ++ServerStats.is_kill; - sendto_one(target_p, form_str(ERR_NICKCOLLISION), + sendto_one(target_p, ERR_NICKCOLLISION, me.name, target_p->name, target_p->name); AddFlag(target_p, FLAGS_KILLED); diff --git a/modules/core/m_part.c b/modules/core/m_part.c index 3d1e83a..2a8b27e 100644 --- a/modules/core/m_part.c +++ b/modules/core/m_part.c @@ -56,14 +56,14 @@ part_one_client(struct Client *client_p, struct Client *source_p, if ((chptr = hash_find_channel(name)) == NULL) { - sendto_one(source_p, form_str(ERR_NOSUCHCHANNEL), + sendto_one(source_p, ERR_NOSUCHCHANNEL, me.name, source_p->name, name); return; } if ((ms = find_channel_link(source_p, chptr)) == NULL) { - sendto_one(source_p, form_str(ERR_NOTONCHANNEL), + sendto_one(source_p, ERR_NOTONCHANNEL, me.name, source_p->name, name); return; } @@ -122,7 +122,7 @@ m_part(struct Client *client_p, struct Client *source_p, if (EmptyString(parv[1])) { - sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), + sendto_one(source_p, ERR_NEEDMOREPARAMS, me.name, source_p->name, "PART"); return; } diff --git a/modules/core/m_squit.c b/modules/core/m_squit.c index 6fef291..122794e 100644 --- a/modules/core/m_squit.c +++ b/modules/core/m_squit.c @@ -55,7 +55,7 @@ mo_squit(struct Client *client_p, struct Client *source_p, if (parc < 2 || EmptyString(parv[1])) { - sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), + sendto_one(source_p, ERR_NEEDMOREPARAMS, me.name, source_p->name, "SQUIT"); return; } @@ -81,14 +81,14 @@ mo_squit(struct Client *client_p, struct Client *source_p, if ((target_p == NULL) || IsMe(target_p)) { - sendto_one(source_p, form_str(ERR_NOSUCHSERVER), + sendto_one(source_p, ERR_NOSUCHSERVER, me.name, source_p->name, server); return; } if (!MyConnect(target_p) && !HasOFlag(source_p, OPER_FLAG_REMOTE)) { - sendto_one(source_p, form_str(ERR_NOPRIVILEGES), + sendto_one(source_p, ERR_NOPRIVILEGES, me.name, source_p->name); return; } diff --git a/modules/m_accept.c b/modules/m_accept.c index 84cec49..c6dc26e 100644 --- a/modules/m_accept.c +++ b/modules/m_accept.c @@ -63,7 +63,7 @@ list_accepts(struct Client *source_p) if ((t - nicks) + masklen + len > IRCD_BUFSIZE) { *(t - 1) = '\0'; - sendto_one(source_p, form_str(RPL_ACCEPTLIST), + sendto_one(source_p, RPL_ACCEPTLIST, me.name, source_p->name, nicks); t = nicks; } @@ -76,11 +76,11 @@ list_accepts(struct Client *source_p) if (nicks[0] != '\0') { *(t - 1) = '\0'; - sendto_one(source_p, form_str(RPL_ACCEPTLIST), + sendto_one(source_p, RPL_ACCEPTLIST, me.name, source_p->name, nicks); } - sendto_one(source_p, form_str(RPL_ENDOFACCEPT), + sendto_one(source_p, RPL_ENDOFACCEPT, me.name, source_p->name); } @@ -153,7 +153,7 @@ m_accept(struct Client *client_p, struct Client *source_p, if ((accept_p = find_accept(nick, user, host, source_p, 0)) == NULL) { - sendto_one(source_p, form_str(ERR_ACCEPTNOT), + sendto_one(source_p, ERR_ACCEPTNOT, me.name, source_p->name, nick, user, host); continue; } @@ -165,7 +165,7 @@ m_accept(struct Client *client_p, struct Client *source_p, if (dlink_list_length(&source_p->localClient->acceptlist) >= ConfigFileEntry.max_accept) { - sendto_one(source_p, form_str(ERR_ACCEPTFULL), + sendto_one(source_p, ERR_ACCEPTFULL, me.name, source_p->name); return; } @@ -183,7 +183,7 @@ m_accept(struct Client *client_p, struct Client *source_p, if ((accept_p = find_accept(nick, user, host, source_p, 0)) != NULL) { - sendto_one(source_p, form_str(ERR_ACCEPTEXIST), + sendto_one(source_p, ERR_ACCEPTEXIST, me.name, source_p->name, nick, user, host); continue; } diff --git a/modules/m_admin.c b/modules/m_admin.c index 9db6fa9..cf13149 100644 --- a/modules/m_admin.c +++ b/modules/m_admin.c @@ -52,17 +52,17 @@ do_admin(struct Client *source_p) source_p->name, source_p->username, source_p->host, source_p->servptr->name); - sendto_one(source_p, form_str(RPL_ADMINME), + sendto_one(source_p, RPL_ADMINME, me_name, nick, me.name); if (AdminInfo.name != NULL) - sendto_one(source_p, form_str(RPL_ADMINLOC1), + sendto_one(source_p, RPL_ADMINLOC1, me_name, nick, AdminInfo.name); if (AdminInfo.description != NULL) - sendto_one(source_p, form_str(RPL_ADMINLOC2), + sendto_one(source_p, RPL_ADMINLOC2, me_name, nick, AdminInfo.description); if (AdminInfo.email != NULL) - sendto_one(source_p, form_str(RPL_ADMINEMAIL), + sendto_one(source_p, RPL_ADMINEMAIL, me_name, nick, AdminInfo.email); } @@ -88,7 +88,7 @@ m_admin(struct Client *client_p, struct Client *source_p, if ((last_used + ConfigFileEntry.pace_wait_simple) > CurrentTime) { - sendto_one(source_p,form_str(RPL_LOAD2HI), + sendto_one(source_p, RPL_LOAD2HI, me.name, source_p->name); return; } diff --git a/modules/m_away.c b/modules/m_away.c index 644d1d5..f2f3060 100644 --- a/modules/m_away.c +++ b/modules/m_away.c @@ -65,20 +65,20 @@ m_away(struct Client *client_p, struct Client *source_p, source_p->host); } - sendto_one(source_p, form_str(RPL_UNAWAY), + sendto_one(source_p, RPL_UNAWAY, me.name, source_p->name); return; } if ((CurrentTime - source_p->localClient->last_away) < ConfigFileEntry.pace_wait) { - sendto_one(source_p, form_str(RPL_LOAD2HI), + sendto_one(source_p, RPL_LOAD2HI, me.name, source_p->name); return; } source_p->localClient->last_away = CurrentTime; - sendto_one(source_p, form_str(RPL_NOWAWAY), me.name, source_p->name); + sendto_one(source_p, RPL_NOWAWAY, me.name, source_p->name); if (!strncmp(source_p->away, parv[1], sizeof(source_p->away) - 1)) return; diff --git a/modules/m_cap.c b/modules/m_cap.c index 842c1c9..a7a9aad 100644 --- a/modules/m_cap.c +++ b/modules/m_cap.c @@ -396,7 +396,7 @@ m_cap(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) sizeof(cmdlist) / sizeof(struct subcmd), sizeof(struct subcmd), (bqcmp)subcmd_search))) { - sendto_one(source_p, form_str(ERR_INVALIDCAPCMD), me.name, + sendto_one(source_p, ERR_INVALIDCAPCMD, me.name, source_p->name[0] ? source_p->name : "*", subcmd); return; } diff --git a/modules/m_challenge.c b/modules/m_challenge.c index 9965b8e..8b9fcfb 100644 --- a/modules/m_challenge.c +++ b/modules/m_challenge.c @@ -82,7 +82,7 @@ m_challenge(struct Client *client_p, struct Client *source_p, if (irccmp(source_p->localClient->response, ++parv[1])) { - sendto_one(source_p, form_str(ERR_PASSWDMISMATCH), me.name, + sendto_one(source_p, ERR_PASSWDMISMATCH, me.name, source_p->name); failed_challenge_notice(source_p, source_p->localClient->auth_oper, "challenge failed"); @@ -94,7 +94,7 @@ m_challenge(struct Client *client_p, struct Client *source_p, if (conf == NULL) { /* XXX: logging */ - sendto_one (source_p, form_str(ERR_NOOPERHOST), me.name, source_p->name); + sendto_one (source_p, ERR_NOOPERHOST, me.name, source_p->name); return; } @@ -128,7 +128,7 @@ m_challenge(struct Client *client_p, struct Client *source_p, if (!conf) { - sendto_one (source_p, form_str(ERR_NOOPERHOST), me.name, source_p->name); + sendto_one (source_p, ERR_NOOPERHOST, me.name, source_p->name); conf = find_exact_name_conf(CONF_OPER, NULL, parv[1], NULL, NULL); failed_challenge_notice(source_p, parv[1], (conf != NULL) ? "host mismatch" : "no oper {} block"); @@ -145,7 +145,7 @@ m_challenge(struct Client *client_p, struct Client *source_p, if (!generate_challenge(&challenge, &(source_p->localClient->response), conf->rsa_public_key)) - sendto_one(source_p, form_str(RPL_RSACHALLENGE), + sendto_one(source_p, RPL_RSACHALLENGE, me.name, source_p->name, challenge); source_p->localClient->auth_oper = xstrdup(conf->name); @@ -156,7 +156,7 @@ static void mo_challenge(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { - sendto_one(source_p, form_str(RPL_YOUREOPER), + sendto_one(source_p, RPL_YOUREOPER, me.name, source_p->name); } diff --git a/modules/m_close.c b/modules/m_close.c index 4395935..929f16b 100644 --- a/modules/m_close.c +++ b/modules/m_close.c @@ -48,7 +48,7 @@ mo_close(struct Client *client_p, struct Client *source_p, { struct Client *target_p = ptr->data; - sendto_one(source_p, form_str(RPL_CLOSING), me.name, source_p->name, + sendto_one(source_p, RPL_CLOSING, me.name, source_p->name, get_client_name(target_p, SHOW_IP), target_p->status); /* @@ -58,7 +58,7 @@ mo_close(struct Client *client_p, struct Client *source_p, exit_client(target_p, target_p, "Oper Closing"); } - sendto_one(source_p, form_str(RPL_CLOSEEND), + sendto_one(source_p, RPL_CLOSEEND, me.name, source_p->name, closed); } diff --git a/modules/m_connect.c b/modules/m_connect.c index 1d27f53..4e67cd6 100644 --- a/modules/m_connect.c +++ b/modules/m_connect.c @@ -60,7 +60,7 @@ mo_connect(struct Client *client_p, struct Client *source_p, if (EmptyString(parv[1])) { - sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), + sendto_one(source_p, ERR_NEEDMOREPARAMS, me.name, source_p->name, "CONNECT"); return; } @@ -69,7 +69,7 @@ mo_connect(struct Client *client_p, struct Client *source_p, { if (!HasOFlag(source_p, OPER_FLAG_REMOTE)) { - sendto_one(source_p, form_str(ERR_NOPRIVS), + sendto_one(source_p, ERR_NOPRIVS, me.name, source_p->name, "connect"); return; } @@ -189,7 +189,7 @@ ms_connect(struct Client *client_p, struct Client *source_p, if (EmptyString(parv[1])) { - sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), + sendto_one(source_p, ERR_NEEDMOREPARAMS, me.name, source_p->name, "CONNECT"); return; } diff --git a/modules/m_dline.c b/modules/m_dline.c index b1d4ab4..dba9323 100644 --- a/modules/m_dline.c +++ b/modules/m_dline.c @@ -154,7 +154,7 @@ mo_dline(struct Client *client_p, struct Client *source_p, if (!HasOFlag(source_p, OPER_FLAG_DLINE)) { - sendto_one(source_p, form_str(ERR_NOPRIVS), + sendto_one(source_p, ERR_NOPRIVS, me.name, source_p->name, "dline"); return; } @@ -408,14 +408,14 @@ mo_undline(struct Client *client_p, struct Client *source_p, if (!HasOFlag(source_p, OPER_FLAG_UNDLINE)) { - sendto_one(source_p, form_str(ERR_NOPRIVS), + sendto_one(source_p, ERR_NOPRIVS, me.name, source_p->name, "undline"); return; } if (parc < 2 || EmptyString(parv[1])) { - sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), + sendto_one(source_p, ERR_NEEDMOREPARAMS, me.name, source_p->name, "UNDLINE"); return; } diff --git a/modules/m_etrace.c b/modules/m_etrace.c index d7d0efa..123a169 100644 --- a/modules/m_etrace.c +++ b/modules/m_etrace.c @@ -94,7 +94,7 @@ do_etrace(struct Client *source_p, int parc, char *parv[]) if (target_p && MyClient(target_p)) report_this_status(source_p, target_p, full_etrace); - sendto_one(source_p, form_str(RPL_ENDOFTRACE), me.name, + sendto_one(source_p, RPL_ENDOFTRACE, me.name, source_p->name, tname); return; } @@ -112,7 +112,7 @@ do_etrace(struct Client *source_p, int parc, char *parv[]) report_this_status(source_p, target_p, full_etrace); } - sendto_one(source_p, form_str(RPL_ENDOFTRACE), me.name, + sendto_one(source_p, RPL_ENDOFTRACE, me.name, source_p->name, tname); } @@ -144,7 +144,7 @@ report_this_status(struct Client *source_p, struct Client *target_p, if (full_etrace) { if (ConfigFileEntry.hide_spoof_ips) - sendto_one(source_p, form_str(RPL_ETRACE_FULL), + sendto_one(source_p, RPL_ETRACE_FULL, me.name, source_p->name, HasUMode(target_p, UMODE_OPER) ? "Oper" : "User", @@ -157,7 +157,7 @@ report_this_status(struct Client *source_p, struct Client *target_p, IsIPSpoof(target_p) ? "<hidden>" : target_p->localClient->client_server, target_p->info); else - sendto_one(source_p, form_str(RPL_ETRACE_FULL), + sendto_one(source_p, RPL_ETRACE_FULL, me.name, source_p->name, HasUMode(target_p, UMODE_OPER) ? "Oper" : "User", @@ -173,7 +173,7 @@ report_this_status(struct Client *source_p, struct Client *target_p, else { if (ConfigFileEntry.hide_spoof_ips) - sendto_one(source_p, form_str(RPL_ETRACE), + sendto_one(source_p, RPL_ETRACE, me.name, source_p->name, HasUMode(target_p, UMODE_OPER) ? "Oper" : "User", @@ -184,7 +184,7 @@ report_this_status(struct Client *source_p, struct Client *target_p, IsIPSpoof(target_p) ? "255.255.255.255" : target_p->sockhost, target_p->info); else - sendto_one(source_p, form_str(RPL_ETRACE), + sendto_one(source_p, RPL_ETRACE, me.name, source_p->name, HasUMode(target_p, UMODE_OPER) ? "Oper" : "User", diff --git a/modules/m_gline.c b/modules/m_gline.c index 2bec753..78d861b 100644 --- a/modules/m_gline.c +++ b/modules/m_gline.c @@ -343,7 +343,7 @@ mo_gline(struct Client *client_p, struct Client *source_p, if (!HasOFlag(source_p, OPER_FLAG_GLINE)) { - sendto_one(source_p, form_str(ERR_NOPRIVS), + sendto_one(source_p, ERR_NOPRIVS, me.name, source_p->name, "gline"); return; } @@ -510,7 +510,7 @@ mo_gungline(struct Client *client_p, struct Client *source_p, if (!HasOFlag(source_p, OPER_FLAG_GLINE)) { - sendto_one(source_p, form_str(ERR_NOPRIVS), + sendto_one(source_p, ERR_NOPRIVS, me.name, source_p->name, "gline"); return; } diff --git a/modules/m_globops.c b/modules/m_globops.c index 8cf3ed7..24be8ff 100644 --- a/modules/m_globops.c +++ b/modules/m_globops.c @@ -47,14 +47,14 @@ mo_globops(struct Client *client_p, struct Client *source_p, if (!HasOFlag(source_p, OPER_FLAG_GLOBOPS)) { - sendto_one(source_p, form_str(ERR_NOPRIVS), + sendto_one(source_p, ERR_NOPRIVS, me.name, source_p->name, "globops"); return; } if (EmptyString(message)) { - sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), + sendto_one(source_p, ERR_NEEDMOREPARAMS, me.name, source_p->name, "GLOBOPS"); return; } diff --git a/modules/m_help.c b/modules/m_help.c index c104f0c..4601860 100644 --- a/modules/m_help.c +++ b/modules/m_help.c @@ -52,7 +52,7 @@ m_help(struct Client *client_p, struct Client *source_p, if ((last_used + ConfigFileEntry.pace_wait_simple) > CurrentTime) { /* safe enough to give this on a local connect only */ - sendto_one(source_p,form_str(RPL_LOAD2HI), + sendto_one(source_p, RPL_LOAD2HI, me.name, source_p->name); return; } @@ -101,14 +101,14 @@ dohelp(struct Client *source_p, const char *hpath, char *topic) if (strpbrk(topic, "/\\")) { - sendto_one(source_p, form_str(ERR_HELPNOTFOUND), + sendto_one(source_p, ERR_HELPNOTFOUND, me.name, source_p->name, topic); return; } if (strlen(hpath) + strlen(topic) + 1 > HYB_PATH_MAX) { - sendto_one(source_p, form_str(ERR_HELPNOTFOUND), + sendto_one(source_p, ERR_HELPNOTFOUND, me.name, source_p->name, topic); return; } @@ -117,14 +117,14 @@ dohelp(struct Client *source_p, const char *hpath, char *topic) if (stat(path, &sb) < 0) { - sendto_one(source_p, form_str(ERR_HELPNOTFOUND), + sendto_one(source_p, ERR_HELPNOTFOUND, me.name, source_p->name, topic); return; } if (!S_ISREG(sb.st_mode)) { - sendto_one(source_p, form_str(ERR_HELPNOTFOUND), + sendto_one(source_p, ERR_HELPNOTFOUND, me.name, source_p->name, topic); return; } @@ -140,32 +140,32 @@ sendhelpfile(struct Client *source_p, const char *path, const char *topic) if ((file = fopen(path, "r")) == NULL) { - sendto_one(source_p, form_str(ERR_HELPNOTFOUND), + sendto_one(source_p, ERR_HELPNOTFOUND, me.name, source_p->name, topic); return; } if (fgets(line, sizeof(line), file) == NULL) { - sendto_one(source_p, form_str(ERR_HELPNOTFOUND), + sendto_one(source_p, ERR_HELPNOTFOUND, me.name, source_p->name, topic); return; } line[strlen(line) - 1] = '\0'; - sendto_one(source_p, form_str(RPL_HELPSTART), + sendto_one(source_p, RPL_HELPSTART, me.name, source_p->name, topic, line); while (fgets(line, sizeof(line), file)) { line[strlen(line) - 1] = '\0'; - sendto_one(source_p, form_str(RPL_HELPTXT), + sendto_one(source_p, RPL_HELPTXT, me.name, source_p->name, topic, line); } fclose(file); - sendto_one(source_p, form_str(RPL_ENDOFHELP), + sendto_one(source_p, RPL_ENDOFHELP, me.name, source_p->name, topic); } diff --git a/modules/m_info.c b/modules/m_info.c index cab6f84..8eafc1f 100644 --- a/modules/m_info.c +++ b/modules/m_info.c @@ -633,7 +633,7 @@ send_conf_options(struct Client *source_p) } } - sendto_one(source_p, form_str(RPL_INFO), + sendto_one(source_p, RPL_INFO, from, to, ""); } @@ -667,7 +667,7 @@ send_info_text(struct Client *source_p) if (*line == '\0') line = " "; - sendto_one(source_p, form_str(RPL_INFO), + sendto_one(source_p, RPL_INFO, source, target, line); } @@ -676,7 +676,7 @@ send_info_text(struct Client *source_p) send_birthdate_online_time(source_p); - sendto_one(source_p, form_str(RPL_ENDOFINFO), + sendto_one(source_p, RPL_ENDOFINFO, me.name, source_p->name); } @@ -694,7 +694,7 @@ m_info(struct Client *client_p, struct Client *source_p, if ((last_used + ConfigFileEntry.pace_wait) > CurrentTime) { /* safe enough to give this on a local connect only */ - sendto_one(source_p, form_str(RPL_LOAD2HI), + sendto_one(source_p, RPL_LOAD2HI, me.name, source_p->name); return; } diff --git a/modules/m_invite.c b/modules/m_invite.c index 21c9ac9..6cceded 100644 --- a/modules/m_invite.c +++ b/modules/m_invite.c @@ -59,7 +59,7 @@ m_invite(struct Client *client_p, struct Client *source_p, if (EmptyString(parv[2])) { - sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), + sendto_one(source_p, ERR_NEEDMOREPARAMS, me.name, source_p->name, "INVITE"); return; } @@ -69,46 +69,46 @@ m_invite(struct Client *client_p, struct Client *source_p, if ((target_p = find_person(client_p, parv[1])) == NULL) { - sendto_one(source_p, form_str(ERR_NOSUCHNICK), + sendto_one(source_p, ERR_NOSUCHNICK, me.name, source_p->name, parv[1]); return; } if ((chptr = hash_find_channel(parv[2])) == NULL) { - sendto_one(source_p, form_str(ERR_NOSUCHCHANNEL), + sendto_one(source_p, ERR_NOSUCHCHANNEL, me.name, source_p->name, parv[2]); return; } if (MyConnect(source_p) && (ms = find_channel_link(source_p, chptr)) == NULL) { - sendto_one(source_p, form_str(ERR_NOTONCHANNEL), + sendto_one(source_p, ERR_NOTONCHANNEL, me.name, source_p->name, chptr->chname); return; } if (MyConnect(source_p) && !has_member_flags(ms, CHFL_CHANOP)) { - sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED), + sendto_one(source_p, ERR_CHANOPRIVSNEEDED, me.name, source_p->name, chptr->chname); return; } if (IsMember(target_p, chptr)) { - sendto_one(source_p, form_str(ERR_USERONCHANNEL), + sendto_one(source_p, ERR_USERONCHANNEL, me.name, source_p->name, target_p->name, chptr->chname); return; } if (MyConnect(source_p)) { - sendto_one(source_p, form_str(RPL_INVITING), me.name, + sendto_one(source_p, RPL_INVITING, me.name, source_p->name, target_p->name, chptr->chname); if (target_p->away[0]) - sendto_one(source_p, form_str(RPL_AWAY), + sendto_one(source_p, RPL_AWAY, me.name, source_p->name, target_p->name, target_p->away); } diff --git a/modules/m_ison.c b/modules/m_ison.c index 0e67287..88158b4 100644 --- a/modules/m_ison.c +++ b/modules/m_ison.c @@ -45,7 +45,7 @@ do_ison(struct Client *client_p, struct Client *source_p, int i; int done = 0; - len = snprintf(buf, sizeof(buf), form_str(RPL_ISON), me.name, source_p->name); + len = snprintf(buf, sizeof(buf), RPL_ISON, me.name, source_p->name); current_insert_point = buf + len; /* diff --git a/modules/m_kline.c b/modules/m_kline.c index b41e21c..8ef3785 100644 --- a/modules/m_kline.c +++ b/modules/m_kline.c @@ -75,7 +75,7 @@ mo_kline(struct Client *client_p, struct Client *source_p, if (!HasOFlag(source_p, OPER_FLAG_K)) { - sendto_one(source_p, form_str(ERR_NOPRIVS), + sendto_one(source_p, ERR_NOPRIVS, me.name, source_p->name, "kline"); return; } @@ -308,14 +308,14 @@ mo_unkline(struct Client *client_p,struct Client *source_p, if (!HasOFlag(source_p, OPER_FLAG_UNKLINE)) { - sendto_one(source_p, form_str(ERR_NOPRIVS), + sendto_one(source_p, ERR_NOPRIVS, me.name, source_p->name, "unkline"); return; } if (EmptyString(parv[1])) { - sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), + sendto_one(source_p, ERR_NEEDMOREPARAMS, me.name, source_p->name, "UNKLINE"); return; } diff --git a/modules/m_knock.c b/modules/m_knock.c index 51bb53d..54ebf61 100644 --- a/modules/m_knock.c +++ b/modules/m_knock.c @@ -61,14 +61,14 @@ m_knock(struct Client *client_p, struct Client *source_p, if (EmptyString(parv[1])) { - sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), + sendto_one(source_p, ERR_NEEDMOREPARAMS, me.name, source_p->name, "KNOCK"); return; } if ((chptr = hash_find_channel(parv[1])) == NULL) { - sendto_one(source_p, form_str(ERR_NOSUCHCHANNEL), + sendto_one(source_p, ERR_NOSUCHCHANNEL, me.name, source_p->name, parv[1]); return; } @@ -76,7 +76,7 @@ m_knock(struct Client *client_p, struct Client *source_p, /* Normal channel, just be sure they aren't on it */ if (IsMember(source_p, chptr)) { - sendto_one(source_p, form_str(ERR_KNOCKONCHAN), me.name, + sendto_one(source_p, ERR_KNOCKONCHAN, me.name, source_p->name, chptr->chname); return; } @@ -85,7 +85,7 @@ m_knock(struct Client *client_p, struct Client *source_p, (chptr->mode.limit && dlink_list_length(&chptr->members) >= chptr->mode.limit))) { - sendto_one(source_p, form_str(ERR_CHANOPEN), me.name, + sendto_one(source_p, ERR_CHANOPEN, me.name, source_p->name, chptr->chname); return; } @@ -97,7 +97,7 @@ m_knock(struct Client *client_p, struct Client *source_p, */ if (PrivateChannel(chptr) || is_banned(chptr, source_p)) { - sendto_one(source_p, form_str(ERR_CANNOTSENDTOCHAN), + sendto_one(source_p, ERR_CANNOTSENDTOCHAN, me.name, source_p->name, chptr->chname); return; } @@ -112,21 +112,21 @@ m_knock(struct Client *client_p, struct Client *source_p, if ((source_p->localClient->last_knock + ConfigChannel.knock_delay) > CurrentTime) { - sendto_one(source_p, form_str(ERR_TOOMANYKNOCK), me.name, + sendto_one(source_p, ERR_TOOMANYKNOCK, me.name, source_p->name, chptr->chname, "user"); return; } if ((chptr->last_knock + ConfigChannel.knock_delay_channel) > CurrentTime) { - sendto_one(source_p, form_str(ERR_TOOMANYKNOCK), me.name, + sendto_one(source_p, ERR_TOOMANYKNOCK, me.name, source_p->name, chptr->chname, "channel"); return; } source_p->localClient->last_knock = CurrentTime; - sendto_one(source_p, form_str(RPL_KNOCKDLVR), me.name, + sendto_one(source_p, RPL_KNOCKDLVR, me.name, source_p->name, chptr->chname); } diff --git a/modules/m_links.c b/modules/m_links.c index 631d1d1..fc9dbd7 100644 --- a/modules/m_links.c +++ b/modules/m_links.c @@ -69,13 +69,13 @@ do_links(struct Client *source_p, int parc, char *parv[]) * We just send the reply, as if they are here there's either no SHIDE, * or they're an oper.. */ - sendto_one(source_p, form_str(RPL_LINKS), + sendto_one(source_p, RPL_LINKS, me_name, nick, target_p->name, target_p->servptr->name, target_p->hopcount, target_p->info); } - sendto_one(source_p, form_str(RPL_ENDOFLINKS), + sendto_one(source_p, RPL_ENDOFLINKS, me_name, nick, EmptyString(mask) ? "*" : mask); } @@ -85,12 +85,12 @@ do_links(struct Client *source_p, int parc, char *parv[]) * Print our own info so at least it looks like a normal links * then print out the file (which may or may not be empty) */ - sendto_one(source_p, form_str(RPL_LINKS), + sendto_one(source_p, RPL_LINKS, ID_or_name(&me, source_p->from), ID_or_name(source_p, source_p->from), me.name, me.name, 0, me.info); send_message_file(source_p, &ConfigFileEntry.linksfile); - sendto_one(source_p, form_str(RPL_ENDOFLINKS), + sendto_one(source_p, RPL_ENDOFLINKS, ID_or_name(&me, source_p->from), ID_or_name(source_p, source_p->from), "*"); } @@ -126,7 +126,7 @@ m_links(struct Client *client_p, struct Client *source_p, if ((last_used + ConfigFileEntry.pace_wait) > CurrentTime) { - sendto_one(source_p, form_str(RPL_LOAD2HI), + sendto_one(source_p, RPL_LOAD2HI, me.name, source_p->name); return; } diff --git a/modules/m_list.c b/modules/m_list.c index c2a33b8..ec6638e 100644 --- a/modules/m_list.c +++ b/modules/m_list.c @@ -49,7 +49,7 @@ do_list(struct Client *source_p, int parc, char *parv[]) if (source_p->localClient->list_task != NULL) { free_list_task(source_p->localClient->list_task, source_p); - sendto_one(source_p, form_str(RPL_LISTEND), me.name, source_p->name); + sendto_one(source_p, RPL_LISTEND, me.name, source_p->name); return; } @@ -141,7 +141,7 @@ do_list(struct Client *source_p, int parc, char *parv[]) if (errors) { free_list_task(lt, source_p); - sendto_one(source_p, form_str(ERR_LISTSYNTAX), + sendto_one(source_p, ERR_LISTSYNTAX, me.name, source_p->name); return; } @@ -150,7 +150,7 @@ do_list(struct Client *source_p, int parc, char *parv[]) dlinkAdd(source_p, make_dlink_node(), &listing_client_list); - sendto_one(source_p, form_str(RPL_LISTSTART), + sendto_one(source_p, RPL_LISTSTART, me.name, source_p->name); safe_list_channels(source_p, lt, no_masked_channels && lt->show_mask.head != NULL); diff --git a/modules/m_locops.c b/modules/m_locops.c index fd40ef3..013040d 100644 --- a/modules/m_locops.c +++ b/modules/m_locops.c @@ -50,7 +50,7 @@ mo_locops(struct Client *client_p, struct Client *source_p, if (EmptyString(message)) { - sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), + sendto_one(source_p, ERR_NEEDMOREPARAMS, me.name, source_p->name, "LOCOPS"); return; } diff --git a/modules/m_lusers.c b/modules/m_lusers.c index c7c41c5..2b9ed22 100644 --- a/modules/m_lusers.c +++ b/modules/m_lusers.c @@ -53,7 +53,7 @@ m_lusers(struct Client *client_p, struct Client *source_p, if ((last_used + ConfigFileEntry.pace_wait_simple) > CurrentTime) { /* safe enough to give this on a local connect only */ - sendto_one(source_p, form_str(RPL_LOAD2HI), me.name, source_p->name); + sendto_one(source_p, RPL_LOAD2HI, me.name, source_p->name); return; } diff --git a/modules/m_map.c b/modules/m_map.c index 4d5c9ab..58497ba 100644 --- a/modules/m_map.c +++ b/modules/m_map.c @@ -76,7 +76,7 @@ dump_map(struct Client *client_p, const struct Client *root_p, sprintf(pb, " Users: %5d (%1.1f%%)", users, 100 * (float)users / (float)Count.total); - sendto_one(client_p, form_str(RPL_MAP), me.name, client_p->name, buf); + sendto_one(client_p, RPL_MAP, me.name, client_p->name, buf); if (root_p->serv->server_list.head) { @@ -133,7 +133,7 @@ m_map(struct Client *client_p, struct Client *source_p, if ((last_used + ConfigFileEntry.pace_wait) > CurrentTime) { /* safe enough to give this on a local connect only */ - sendto_one(source_p, form_str(RPL_LOAD2HI), + sendto_one(source_p, RPL_LOAD2HI, me.name, source_p->name); return; } @@ -141,7 +141,7 @@ m_map(struct Client *client_p, struct Client *source_p, last_used = CurrentTime; dump_map(source_p, &me, 0, buf); - sendto_one(source_p, form_str(RPL_MAPEND), me.name, source_p->name); + sendto_one(source_p, RPL_MAPEND, me.name, source_p->name); } /* mo_map() @@ -152,7 +152,7 @@ mo_map(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { dump_map(source_p, &me, 0, buf); - sendto_one(source_p, form_str(RPL_MAPEND), me.name, source_p->name); + sendto_one(source_p, RPL_MAPEND, me.name, source_p->name); } static struct Message map_msgtab = { diff --git a/modules/m_module.c b/modules/m_module.c index b8ec8dd..913ae0c 100644 --- a/modules/m_module.c +++ b/modules/m_module.c @@ -64,14 +64,14 @@ mo_module(struct Client *client_p, struct Client *source_p, if (!HasOFlag(source_p, OPER_FLAG_MODULE)) { - sendto_one(source_p, form_str(ERR_NOPRIVILEGES), + sendto_one(source_p, ERR_NOPRIVILEGES, me.name, source_p->name); return; } if (EmptyString(parv[1])) { - sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), + sendto_one(source_p, ERR_NEEDMOREPARAMS, me.name, source_p->name, "MODULE"); return; } @@ -80,7 +80,7 @@ mo_module(struct Client *client_p, struct Client *source_p, { if (EmptyString(parv[2])) { - sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), + sendto_one(source_p, ERR_NEEDMOREPARAMS, me.name, source_p->name, "MODULE"); return; } @@ -100,7 +100,7 @@ mo_module(struct Client *client_p, struct Client *source_p, { if (EmptyString(parv[2])) { - sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), + sendto_one(source_p, ERR_NEEDMOREPARAMS, me.name, source_p->name, "MODULE"); return; } @@ -138,7 +138,7 @@ mo_module(struct Client *client_p, struct Client *source_p, { if (EmptyString(parv[2])) { - sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), + sendto_one(source_p, ERR_NEEDMOREPARAMS, me.name, source_p->name, "MODULE"); return; } @@ -220,12 +220,12 @@ mo_module(struct Client *client_p, struct Client *source_p, if (!EmptyString(parv[2]) && match(parv[2], modp->name)) continue; - sendto_one(source_p, form_str(RPL_MODLIST), me.name, source_p->name, + sendto_one(source_p, RPL_MODLIST, me.name, source_p->name, modp->name, modp->handle, modp->version, (modp->flags & MODULE_FLAG_CORE) ?"(core)":""); } - sendto_one(source_p, form_str(RPL_ENDOFMODLIST), + sendto_one(source_p, RPL_ENDOFMODLIST, me.name, source_p->name); return; } diff --git a/modules/m_motd.c b/modules/m_motd.c index 805840f..6943867 100644 --- a/modules/m_motd.c +++ b/modules/m_motd.c @@ -59,7 +59,7 @@ m_motd(struct Client *client_p, struct Client *source_p, if ((last_used + ConfigFileEntry.pace_wait) > CurrentTime) { /* safe enough to give this on a local connect only */ - sendto_one(source_p, form_str(RPL_LOAD2HI), + sendto_one(source_p, RPL_LOAD2HI, me.name, source_p->name); return; } diff --git a/modules/m_names.c b/modules/m_names.c index f1b9409..7947d77 100644 --- a/modules/m_names.c +++ b/modules/m_names.c @@ -74,7 +74,7 @@ names_non_public_non_secret(struct Client *source_p) char buf[IRCD_BUFSIZE]; char *t; - mlen = snprintf(buf, sizeof(buf), form_str(RPL_NAMREPLY), + mlen = snprintf(buf, sizeof(buf), RPL_NAMREPLY, me.name, source_p->name, "*", "*"); cur_len = mlen; t = buf + mlen; @@ -155,14 +155,14 @@ m_names(struct Client *client_p, struct Client *source_p, if ((chptr = hash_find_channel(para)) != NULL) channel_member_names(source_p, chptr, 1); else - sendto_one(source_p, form_str(RPL_ENDOFNAMES), + sendto_one(source_p, RPL_ENDOFNAMES, me.name, source_p->name, para); } else { names_all_visible_channels(source_p); names_non_public_non_secret(source_p); - sendto_one(source_p, form_str(RPL_ENDOFNAMES), + sendto_one(source_p, RPL_ENDOFNAMES, me.name, source_p->name, "*"); } } diff --git a/modules/m_oper.c b/modules/m_oper.c index 9aef1bc..c76117f 100644 --- a/modules/m_oper.c +++ b/modules/m_oper.c @@ -77,7 +77,7 @@ m_oper(struct Client *client_p, struct Client *source_p, if (EmptyString(password)) { - sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), + sendto_one(source_p, ERR_NEEDMOREPARAMS, me.name, source_p->name, "OPER"); return; } @@ -88,7 +88,7 @@ m_oper(struct Client *client_p, struct Client *source_p, if ((conf = find_exact_name_conf(CONF_OPER, source_p, name, NULL, NULL)) == NULL) { - sendto_one(source_p, form_str(ERR_NOOPERHOST), me.name, source_p->name); + sendto_one(source_p, ERR_NOOPERHOST, me.name, source_p->name); conf = find_exact_name_conf(CONF_OPER, NULL, name, NULL, NULL); failed_oper_notice(source_p, name, (conf != NULL) ? "host mismatch" : "no oper {} block"); @@ -112,7 +112,7 @@ m_oper(struct Client *client_p, struct Client *source_p, } else { - sendto_one(source_p, form_str(ERR_PASSWDMISMATCH), me.name, source_p->name); + sendto_one(source_p, ERR_PASSWDMISMATCH, me.name, source_p->name); failed_oper_notice(source_p, name, "password mismatch"); } } @@ -127,7 +127,7 @@ static void mo_oper(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { - sendto_one(source_p, form_str(RPL_YOUREOPER), + sendto_one(source_p, RPL_YOUREOPER, me.name, source_p->name); } diff --git a/modules/m_operwall.c b/modules/m_operwall.c index 4d81f1c..6a8b277 100644 --- a/modules/m_operwall.c +++ b/modules/m_operwall.c @@ -48,14 +48,14 @@ mo_operwall(struct Client *client_p, struct Client *source_p, if (!HasOFlag(source_p, OPER_FLAG_OPERWALL)) { - sendto_one(source_p, form_str(ERR_NOPRIVS), + sendto_one(source_p, ERR_NOPRIVS, me.name, source_p->name, "operwall"); return; } if (EmptyString(message)) { - sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), + sendto_one(source_p, ERR_NEEDMOREPARAMS, me.name, source_p->name, "OPERWALL"); return; } diff --git a/modules/m_pass.c b/modules/m_pass.c index eda2ad0..4c6907b 100644 --- a/modules/m_pass.c +++ b/modules/m_pass.c @@ -53,7 +53,7 @@ mr_pass(struct Client *client_p, struct Client *source_p, if (EmptyString(parv[1])) { - sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, + sendto_one(source_p, ERR_NEEDMOREPARAMS, me.name, source_p->name[0] ? source_p->name : "*", "PASS"); return; } diff --git a/modules/m_ping.c b/modules/m_ping.c index 520b00a..9976078 100644 --- a/modules/m_ping.c +++ b/modules/m_ping.c @@ -50,7 +50,7 @@ m_ping(struct Client *client_p, struct Client *source_p, if (parc < 2 || EmptyString(parv[1])) { - sendto_one(source_p, form_str(ERR_NOORIGIN), + sendto_one(source_p, ERR_NOORIGIN, me.name, source_p->name); return; } @@ -77,7 +77,7 @@ m_ping(struct Client *client_p, struct Client *source_p, } else { - sendto_one(source_p, form_str(ERR_NOSUCHSERVER), + sendto_one(source_p, ERR_NOSUCHSERVER, me.name, source_p->name, destination); return; } @@ -96,7 +96,7 @@ ms_ping(struct Client *client_p, struct Client *source_p, if (parc < 2 || EmptyString(parv[1])) { - sendto_one(source_p, form_str(ERR_NOORIGIN), + sendto_one(source_p, ERR_NOORIGIN, me.name, source_p->name); return; } @@ -111,7 +111,7 @@ ms_ping(struct Client *client_p, struct Client *source_p, origin, destination); else { - sendto_one(source_p, form_str(ERR_NOSUCHSERVER), + sendto_one(source_p, ERR_NOSUCHSERVER, ID_or_name(&me, client_p), source_p->name, destination); return; } diff --git a/modules/m_pong.c b/modules/m_pong.c index 6d472f7..e68cbd7 100644 --- a/modules/m_pong.c +++ b/modules/m_pong.c @@ -44,7 +44,7 @@ ms_pong(struct Client *client_p, struct Client *source_p, if (parc < 2 || EmptyString(parv[1])) { - sendto_one(source_p, form_str(ERR_NOORIGIN), + sendto_one(source_p, ERR_NOORIGIN, me.name, source_p->name); return; } @@ -67,7 +67,7 @@ ms_pong(struct Client *client_p, struct Client *source_p, source_p->name, origin, destination); else { - sendto_one(source_p, form_str(ERR_NOSUCHSERVER), + sendto_one(source_p, ERR_NOSUCHSERVER, me.name, source_p->name, destination); return; } @@ -95,7 +95,7 @@ mr_pong(struct Client *client_p, struct Client *source_p, } else { - sendto_one(source_p, form_str(ERR_WRONGPONG), me.name, + sendto_one(source_p, ERR_WRONGPONG, me.name, source_p->name, source_p->localClient->random_ping); return; } @@ -103,7 +103,7 @@ mr_pong(struct Client *client_p, struct Client *source_p, } } else - sendto_one(source_p, form_str(ERR_NOORIGIN), + sendto_one(source_p, ERR_NOORIGIN, me.name, source_p->name); } diff --git a/modules/m_rehash.c b/modules/m_rehash.c index 77f5633..5e36fe7 100644 --- a/modules/m_rehash.c +++ b/modules/m_rehash.c @@ -48,7 +48,7 @@ mo_rehash(struct Client *client_p, struct Client *source_p, if (!HasOFlag(source_p, OPER_FLAG_REHASH)) { - sendto_one(source_p, form_str(ERR_NOPRIVS), + sendto_one(source_p, ERR_NOPRIVS, me.name, source_p->name, "rehash"); return; } @@ -57,7 +57,7 @@ mo_rehash(struct Client *client_p, struct Client *source_p, { if (irccmp(parv[1], "DNS") == 0) { - sendto_one(source_p, form_str(RPL_REHASHING), me.name, source_p->name, "DNS"); + sendto_one(source_p, RPL_REHASHING, me.name, source_p->name, "DNS"); sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "%s is rehashing DNS", get_oper_name(source_p)); @@ -90,7 +90,7 @@ mo_rehash(struct Client *client_p, struct Client *source_p, } else { - sendto_one(source_p, form_str(RPL_REHASHING), + sendto_one(source_p, RPL_REHASHING, me.name, source_p->name, ConfigFileEntry.configfile); sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "%s is rehashing server config file", diff --git a/modules/m_restart.c b/modules/m_restart.c index 50e91ea..16361b2 100644 --- a/modules/m_restart.c +++ b/modules/m_restart.c @@ -46,7 +46,7 @@ mo_restart(struct Client *client_p, struct Client *source_p, if (!HasOFlag(source_p, OPER_FLAG_RESTART)) { - sendto_one(source_p, form_str(ERR_NOPRIVS), + sendto_one(source_p, ERR_NOPRIVS, me.name, source_p->name, "restart"); return; } diff --git a/modules/m_services.c b/modules/m_services.c index d8881f4..12b52f5 100644 --- a/modules/m_services.c +++ b/modules/m_services.c @@ -56,7 +56,7 @@ m_nickserv(struct Client *client_p, struct Client *source_p, if (EmptyString(parv[1])) { - sendto_one(source_p, form_str(ERR_NOTEXTTOSEND), + sendto_one(source_p, ERR_NOTEXTTOSEND, me.name, source_p->name); return; } @@ -68,7 +68,7 @@ m_nickserv(struct Client *client_p, struct Client *source_p, return; } - sendto_one(source_p, form_str(ERR_SERVICESDOWN), + sendto_one(source_p, ERR_SERVICESDOWN, me.name, source_p->name, "NickServ"); } @@ -83,7 +83,7 @@ m_chanserv(struct Client *client_p, struct Client *source_p, if (EmptyString(parv[1])) { - sendto_one(source_p, form_str(ERR_NOTEXTTOSEND), + sendto_one(source_p, ERR_NOTEXTTOSEND, me.name, source_p->name); return; } @@ -95,7 +95,7 @@ m_chanserv(struct Client *client_p, struct Client *source_p, return; } - sendto_one(source_p, form_str(ERR_SERVICESDOWN), + sendto_one(source_p, ERR_SERVICESDOWN, me.name, source_p->name, "ChanServ"); } @@ -110,7 +110,7 @@ m_memoserv(struct Client *client_p, struct Client *source_p, if (EmptyString(parv[1])) { - sendto_one(source_p, form_str(ERR_NOTEXTTOSEND), + sendto_one(source_p, ERR_NOTEXTTOSEND, me.name, source_p->name); return; } @@ -122,7 +122,7 @@ m_memoserv(struct Client *client_p, struct Client *source_p, return; } - sendto_one(source_p, form_str(ERR_SERVICESDOWN), + sendto_one(source_p, ERR_SERVICESDOWN, me.name, source_p->name, "MemoServ"); } @@ -137,7 +137,7 @@ m_operserv(struct Client *client_p, struct Client *source_p, if (EmptyString(parv[1])) { - sendto_one(source_p, form_str(ERR_NOTEXTTOSEND), + sendto_one(source_p, ERR_NOTEXTTOSEND, me.name, source_p->name); return; } @@ -149,7 +149,7 @@ m_operserv(struct Client *client_p, struct Client *source_p, return; } - sendto_one(source_p, form_str(ERR_SERVICESDOWN), + sendto_one(source_p, ERR_SERVICESDOWN, me.name, source_p->name, "OperServ"); } @@ -164,7 +164,7 @@ m_statserv(struct Client *client_p, struct Client *source_p, if (EmptyString(parv[1])) { - sendto_one(source_p, form_str(ERR_NOTEXTTOSEND), + sendto_one(source_p, ERR_NOTEXTTOSEND, me.name, source_p->name); return; } @@ -176,7 +176,7 @@ m_statserv(struct Client *client_p, struct Client *source_p, return; } - sendto_one(source_p, form_str(ERR_SERVICESDOWN), + sendto_one(source_p, ERR_SERVICESDOWN, me.name, source_p->name, "StatServ"); } @@ -191,7 +191,7 @@ m_helpserv(struct Client *client_p, struct Client *source_p, if (EmptyString(parv[1])) { - sendto_one(source_p, form_str(ERR_NOTEXTTOSEND), + sendto_one(source_p, ERR_NOTEXTTOSEND, me.name, source_p->name); return; } @@ -203,7 +203,7 @@ m_helpserv(struct Client *client_p, struct Client *source_p, return; } - sendto_one(source_p, form_str(ERR_SERVICESDOWN), + sendto_one(source_p, ERR_SERVICESDOWN, me.name, source_p->name, "HelpServ"); } @@ -218,7 +218,7 @@ m_botserv(struct Client *client_p, struct Client *source_p, if (EmptyString(parv[1])) { - sendto_one(source_p, form_str(ERR_NOTEXTTOSEND), + sendto_one(source_p, ERR_NOTEXTTOSEND, me.name, source_p->name); return; } @@ -230,7 +230,7 @@ m_botserv(struct Client *client_p, struct Client *source_p, return; } - sendto_one(source_p, form_str(ERR_SERVICESDOWN), + sendto_one(source_p, ERR_SERVICESDOWN, me.name, source_p->name, "BotServ"); } diff --git a/modules/m_set.c b/modules/m_set.c index 4fa1970..fbbf932 100644 --- a/modules/m_set.c +++ b/modules/m_set.c @@ -58,7 +58,6 @@ static void quote_autoconnall(struct Client *, int); static void quote_floodcount(struct Client *, int); static void quote_identtimeout(struct Client *, int); static void quote_max(struct Client *, int); -static void quote_msglocale(struct Client *, char *); static void quote_spamnum(struct Client *, int); static void quote_spamtime(struct Client *, int); static void quote_splitmode(struct Client *, char *); @@ -85,7 +84,6 @@ static const struct SetStruct set_cmd_table[] = { "FLOODCOUNT", quote_floodcount, 0, 1 }, { "IDENTTIMEOUT", quote_identtimeout, 0, 1 }, { "MAX", quote_max, 0, 1 }, - { "MSGLOCALE", quote_msglocale, 1, 0 }, { "SPAMNUM", quote_spamnum, 0, 1 }, { "SPAMTIME", quote_spamtime, 0, 1 }, { "SPLITMODE", quote_splitmode, 1, 0 }, @@ -208,7 +206,7 @@ quote_identtimeout(struct Client *source_p, int newval) { if (!HasUMode(source_p, UMODE_ADMIN)) { - sendto_one(source_p, form_str(ERR_NOPRIVS), + sendto_one(source_p, ERR_NOPRIVS, me.name, source_p->name, "set"); return; } @@ -258,22 +256,6 @@ quote_max(struct Client *source_p, int newval) me.name, source_p->name, ServerInfo.max_clients, Count.local); } -/* SET MSGLOCALE */ -static void -quote_msglocale(struct Client *source_p, char *locale) -{ - if (locale != NULL) - { - set_locale(locale); - rebuild_isupport_message_line(); - sendto_one(source_p, ":%s NOTICE %s :Set MSGLOCALE to '%s'", - me.name, source_p->name, get_locale()); - } - else - sendto_one(source_p, ":%s NOTICE %s :MSGLOCALE is currently '%s'", - me.name, source_p->name, get_locale()); -} - /* SET SPAMNUM */ static void quote_spamnum(struct Client *source_p, int newval) @@ -477,7 +459,7 @@ mo_set(struct Client *client_p, struct Client *source_p, if (!HasOFlag(source_p, OPER_FLAG_SET)) { - sendto_one(source_p, form_str(ERR_NOPRIVS), + sendto_one(source_p, ERR_NOPRIVS, me.name, source_p->name, "set"); return; } @@ -521,7 +503,7 @@ mo_set(struct Client *client_p, struct Client *source_p, if (!strcmp(tab->name, "AUTOCONN") && (parc < 4)) { - sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), + sendto_one(source_p, ERR_NEEDMOREPARAMS, me.name, source_p->name, "SET"); return; } diff --git a/modules/m_stats.c b/modules/m_stats.c index 1edeba0..b7f2fd5 100644 --- a/modules/m_stats.c +++ b/modules/m_stats.c @@ -411,7 +411,7 @@ stats_deny(struct Client *source_p, int parc, char *parv[]) if (conf->until) continue; - sendto_one(source_p, form_str(RPL_STATSDLINE), + sendto_one(source_p, RPL_STATSDLINE, from, to, 'D', conf->host, conf->reason); } } @@ -446,7 +446,7 @@ stats_tdeny(struct Client *source_p, int parc, char *parv[]) if (!conf->until) continue; - sendto_one(source_p, form_str(RPL_STATSDLINE), + sendto_one(source_p, RPL_STATSDLINE, from, to, 'd', conf->host, conf->reason); } } @@ -467,12 +467,11 @@ stats_exempt(struct Client *source_p, int parc, char *parv[]) if (ConfigFileEntry.stats_e_disabled) { - sendto_one(source_p, form_str(ERR_NOPRIVILEGES), + sendto_one(source_p, ERR_NOPRIVILEGES, from, to); return; } - for (i = 0; i < ATABLE_SIZE; ++i) { DLINK_FOREACH(ptr, atable[i].head) @@ -484,7 +483,7 @@ stats_exempt(struct Client *source_p, int parc, char *parv[]) conf = arec->conf; - sendto_one(source_p, form_str(RPL_STATSDLINE), + sendto_one(source_p, RPL_STATSDLINE, from, to, 'e', conf->host, conf->reason /* XXX */); } } @@ -614,7 +613,7 @@ stats_glines(struct Client *source_p, int parc, char *parv[]) { const struct MaskItem *conf = arec->conf; - sendto_one(source_p, form_str(RPL_STATSKLINE), + sendto_one(source_p, RPL_STATSKLINE, from, to, "G", conf->host ? conf->host : "*", conf->user ? conf->user : "*", @@ -701,7 +700,7 @@ report_auth(struct Client *client_p, int parc, char *parv[]) * sender, so prepare the strings for comparing --fl_ */ if (ConfigFileEntry.hide_spoof_ips) - sendto_one(client_p, form_str(RPL_STATSILINE), me.name, + sendto_one(client_p, RPL_STATSILINE, me.name, client_p->name, 'I', conf->name == NULL ? "*" : conf->name, show_iline_prefix(client_p, conf), @@ -710,7 +709,7 @@ report_auth(struct Client *client_p, int parc, char *parv[]) conf->class ? conf->class->name : "<default>"); else - sendto_one(client_p, form_str(RPL_STATSILINE), me.name, + sendto_one(client_p, RPL_STATSILINE, me.name, client_p->name, 'I', conf->name == NULL ? "*" : conf->name, show_iline_prefix(client_p, conf), @@ -725,7 +724,7 @@ stats_auth(struct Client *source_p, int parc, char *parv[]) { /* Oper only, if unopered, return ERR_NOPRIVILEGES */ if ((ConfigFileEntry.stats_i_oper_only == 2) && !HasUMode(source_p, UMODE_OPER)) - sendto_one(source_p, form_str(ERR_NOPRIVILEGES), + sendto_one(source_p, ERR_NOPRIVILEGES, from, to); /* If unopered, Only return matching auth blocks */ @@ -747,7 +746,7 @@ stats_auth(struct Client *source_p, int parc, char *parv[]) if (conf == NULL) return; - sendto_one(source_p, form_str(RPL_STATSILINE), from, + sendto_one(source_p, RPL_STATSILINE, from, to, 'I', "*", show_iline_prefix(source_p, conf), conf->host, conf->port, @@ -794,11 +793,11 @@ report_Klines(struct Client *client_p, int tkline) continue; if (HasUMode(client_p, UMODE_OPER)) - sendto_one(client_p, form_str(RPL_STATSKLINE), me.name, + sendto_one(client_p, RPL_STATSKLINE, me.name, client_p->name, p, conf->host, conf->user, conf->reason); else - sendto_one(client_p, form_str(RPL_STATSKLINE), me.name, + sendto_one(client_p, RPL_STATSKLINE, me.name, client_p->name, p, conf->host, conf->user, conf->reason); } @@ -810,7 +809,7 @@ stats_tklines(struct Client *source_p, int parc, char *parv[]) { /* Oper only, if unopered, return ERR_NOPRIVILEGES */ if ((ConfigFileEntry.stats_k_oper_only == 2) && !HasUMode(source_p, UMODE_OPER)) - sendto_one(source_p, form_str(ERR_NOPRIVILEGES), + sendto_one(source_p, ERR_NOPRIVILEGES, from, to); /* If unopered, Only return matching klines */ @@ -835,7 +834,7 @@ stats_tklines(struct Client *source_p, int parc, char *parv[]) if (!conf->until) return; - sendto_one(source_p, form_str(RPL_STATSKLINE), from, + sendto_one(source_p, RPL_STATSKLINE, from, to, "k", conf->host, conf->user, conf->reason); } /* Theyre opered, or allowed to see all klines */ @@ -849,7 +848,7 @@ stats_klines(struct Client *source_p, int parc, char *parv[]) { /* Oper only, if unopered, return ERR_NOPRIVILEGES */ if ((ConfigFileEntry.stats_k_oper_only == 2) && !HasUMode(source_p, UMODE_OPER)) - sendto_one(source_p, form_str(ERR_NOPRIVILEGES), + sendto_one(source_p, ERR_NOPRIVILEGES, from, to); /* If unopered, Only return matching klines */ @@ -875,7 +874,7 @@ stats_klines(struct Client *source_p, int parc, char *parv[]) if (conf->until) return; - sendto_one(source_p, form_str(RPL_STATSKLINE), from, + sendto_one(source_p, RPL_STATSKLINE, from, to, "K", conf->host, conf->user, conf->reason); } /* Theyre opered, or allowed to see all klines */ @@ -895,7 +894,7 @@ static void stats_oper(struct Client *source_p, int parc, char *parv[]) { if (!HasUMode(source_p, UMODE_OPER) && ConfigFileEntry.stats_o_oper_only) - sendto_one(source_p, form_str(ERR_NOPRIVILEGES), + sendto_one(source_p, ERR_NOPRIVILEGES, from, to); else report_confitem_types(source_p, CONF_OPER); @@ -942,7 +941,7 @@ static void stats_ports(struct Client *source_p, int parc, char *parv[]) { if (!HasUMode(source_p, UMODE_OPER) && ConfigFileEntry.stats_P_oper_only) - sendto_one(source_p, form_str(ERR_NOPRIVILEGES), + sendto_one(source_p, ERR_NOPRIVILEGES, from, to); else show_ports(source_p); @@ -1036,11 +1035,11 @@ stats_uptime(struct Client *source_p, int parc, char *parv[]) { time_t now = CurrentTime - me.localClient->since; - sendto_one(source_p, form_str(RPL_STATSUPTIME), from, to, + sendto_one(source_p, RPL_STATSUPTIME, from, to, now / 86400, (now / 3600) % 24, (now / 60) % 60, now % 60); if (!ConfigFileEntry.disable_remote || HasUMode(source_p, UMODE_OPER)) - sendto_one(source_p, form_str(RPL_STATSCONN), from, to, + sendto_one(source_p, RPL_STATSCONN, from, to, Count.max_loc_con, Count.max_loc_cli, Count.totalrestartcount); } @@ -1097,7 +1096,7 @@ stats_servlinks(struct Client *source_p, int parc, char *parv[]) if (ConfigServerHide.flatten_links && !HasUMode(source_p, UMODE_OPER)) { - sendto_one(source_p, form_str(ERR_NOPRIVILEGES), + sendto_one(source_p, ERR_NOPRIVILEGES, from, to); return; } @@ -1110,7 +1109,7 @@ stats_servlinks(struct Client *source_p, int parc, char *parv[]) recvB += target_p->localClient->recv.bytes; /* ":%s 211 %s %s %u %u %llu %u %llu :%u %u %s" */ - sendto_one(source_p, form_str(RPL_STATSLINKINFO), + sendto_one(source_p, RPL_STATSLINKINFO, from, to, get_client_name(target_p, HasUMode(source_p, UMODE_ADMIN) ? SHOW_IP : MASK_IP), dbuf_length(&target_p->localClient->buf_sendq), @@ -1217,7 +1216,7 @@ stats_L_list(struct Client *source_p,char *name, int doall, int wilds, (!IsServer(target_p) && !HasUMode(target_p, UMODE_ADMIN) && !IsHandshake(target_p) && !IsConnecting(target_p)))) { - sendto_one(source_p, form_str(RPL_STATSLINKINFO), + sendto_one(source_p, RPL_STATSLINKINFO, from, to, (IsUpper(statchar)) ? get_client_name(target_p, SHOW_IP) : @@ -1236,7 +1235,7 @@ stats_L_list(struct Client *source_p,char *name, int doall, int wilds, /* If its a hidden ip, an admin, or a server, mask the real IP */ if(IsIPSpoof(target_p) || IsServer(target_p) || HasUMode(target_p, UMODE_ADMIN) || IsHandshake(target_p) || IsConnecting(target_p)) - sendto_one(source_p, form_str(RPL_STATSLINKINFO), + sendto_one(source_p, RPL_STATSLINKINFO, from, to, get_client_name(target_p, MASK_IP), dbuf_length(&target_p->localClient->buf_sendq), @@ -1248,7 +1247,7 @@ stats_L_list(struct Client *source_p,char *name, int doall, int wilds, (CurrentTime > target_p->localClient->since) ? (unsigned)(CurrentTime - target_p->localClient->since):0, IsServer(target_p) ? show_capabilities(target_p) : "-"); else /* show the real IP */ - sendto_one(source_p, form_str(RPL_STATSLINKINFO), + sendto_one(source_p, RPL_STATSLINKINFO, from, to, (IsUpper(statchar)) ? get_client_name(target_p, SHOW_IP) : @@ -1298,7 +1297,7 @@ stats_ltrace(struct Client *source_p, int parc, char *parv[]) stats_L(source_p, name, doall, wilds, statchar); } else - sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), + sendto_one(source_p, ERR_NEEDMOREPARAMS, from, to, "STATS"); } @@ -1363,7 +1362,7 @@ do_stats(struct Client *source_p, int parc, char *parv[]) if (statchar == '\0') { - sendto_one(source_p, form_str(RPL_ENDOFSTATS), + sendto_one(source_p, RPL_ENDOFSTATS, from, to, '*'); return; } @@ -1376,7 +1375,7 @@ do_stats(struct Client *source_p, int parc, char *parv[]) if ((tab->need_admin && !HasUMode(source_p, UMODE_ADMIN)) || (tab->need_oper && !HasUMode(source_p, UMODE_OPER))) { - sendto_one(source_p, form_str(ERR_NOPRIVILEGES), + sendto_one(source_p, ERR_NOPRIVILEGES, from, to); break; } @@ -1390,7 +1389,7 @@ do_stats(struct Client *source_p, int parc, char *parv[]) } } - sendto_one(source_p, form_str(RPL_ENDOFSTATS), + sendto_one(source_p, RPL_ENDOFSTATS, from, to, statchar); } @@ -1429,7 +1428,7 @@ m_stats(struct Client *client_p, struct Client *source_p, /* Check the user is actually allowed to do /stats, and isnt flooding */ if ((last_used + ConfigFileEntry.pace_wait) > CurrentTime) { - sendto_one(source_p,form_str(RPL_LOAD2HI), + sendto_one(source_p, RPL_LOAD2HI, from, to); return; } diff --git a/modules/m_testline.c b/modules/m_testline.c deleted file mode 100644 index b79665c..0000000 --- a/modules/m_testline.c +++ /dev/null @@ -1,248 +0,0 @@ -/* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_testline.c: Tests a hostmask to see what will happen to it. - * - * Copyright (C) 2002 by the past and present ircd coders, and others. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA - * - * $Id$ - */ - -#include "stdinc.h" -#include "client.h" -#include "irc_string.h" -#include "ircd_defs.h" -#include "ircd.h" -#include "restart.h" -#include "conf.h" -#include "send.h" -#include "hostmask.h" -#include "numeric.h" -#include "parse.h" -#include "resv.h" -#include "hash.h" -#include "modules.h" - - -/* mo_testline() - * - * inputs - pointer to physical connection request is coming from - * - pointer to source connection request is coming from - * - parc arg count - * - parv actual arguments - * - * output - NONE - * side effects - command to test I/K lines on server - * - * i.e. /quote testline user@host,ip [password] - * - */ -static void -mo_testline(struct Client *client_p, struct Client *source_p, - int parc, char *parv[]) -{ - /* IRCD_BUFSIZE to allow things like *u*s*e*r*n*a*m*e* etc. */ - char given_name[IRCD_BUFSIZE]; - char given_host[IRCD_BUFSIZE]; - char parv1_copy[IRCD_BUFSIZE]; - struct MaskItem *conf = NULL; - struct irc_ssaddr ip; - int host_mask; - enum hostmask_type t; - int matches = 0; - char userhost[HOSTLEN + USERLEN + 2]; - struct split_nuh_item nuh; - - if (EmptyString(parv[1])) - { - sendto_one(source_p, ":%s NOTICE %s :usage: user@host|ip [password]", - me.name, source_p->name); - return; - } - - if (IsChanPrefix(*parv[1])) /* Might be channel resv */ - { - const struct MaskItem *chptr = NULL; - - if ((chptr = match_find_resv(parv[1]))) - { - sendto_one(source_p, form_str(RPL_TESTLINE), - me.name, source_p->name, 'Q', 0, chptr->name, - chptr->reason ? chptr->reason : CONF_NOREASON); - return; - } - } - - strlcpy(parv1_copy, parv[1], sizeof(parv1_copy)); - - nuh.nuhmask = parv[1]; - nuh.nickptr = NULL; - nuh.userptr = given_name; - nuh.hostptr = given_host; - - nuh.nicksize = 0; - nuh.usersize = sizeof(given_name); - nuh.hostsize = sizeof(given_host); - - split_nuh(&nuh); - - t = parse_netmask(given_host, &ip, &host_mask); - - if (t != HM_HOST) - { - conf = find_dline_conf(&ip, -#ifdef IPV6 - (t == HM_IPV6) ? AF_INET6 : AF_INET -#else - AF_INET -#endif - ); - if (conf != NULL) - { - ++matches; - if (conf->type == CONF_EXEMPT) - sendto_one(source_p, - ":%s NOTICE %s :Exempt D-line host [%s] reason [%s]", - me.name, source_p->name, conf->host, conf->reason); - else - sendto_one(source_p, form_str(RPL_TESTLINE), - me.name, source_p->name, - conf->until ? 'd' : 'D', - conf->until ? ((conf->until - CurrentTime) / 60) - : 0L, - conf->host, conf->reason); - } - } - - if (t != HM_HOST) - conf = find_address_conf(given_host, given_name, &ip, -#ifdef IPV6 - (t == HM_IPV6) ? AF_INET6 : AF_INET, -#else - AF_INET, -#endif - parv[2]); - else - conf = find_address_conf(given_host, given_name, NULL, 0, parv[2]); - - if (conf != NULL) - { - snprintf(userhost, sizeof(userhost), "%s@%s", conf->user, conf->host); - - if (conf->type == CONF_CLIENT) - { - sendto_one(source_p, form_str(RPL_TESTLINE), - me.name, source_p->name, 'I', 0L, userhost, - conf->class ? conf->class->name : "<default>"); - ++matches; - } - else if (conf->type == CONF_KLINE) - { - sendto_one(source_p, form_str(RPL_TESTLINE), - me.name, source_p->name, - conf->until ? 'k' : 'K', - conf->until ? ((conf->until - CurrentTime) / 60) - : 0L, - userhost, conf->reason? conf->reason : CONF_NOREASON); - ++matches; - } - } - - conf = find_matching_name_conf(CONF_NRESV, given_name, NULL, NULL, 0); - - if (conf != NULL) - { - sendto_one(source_p, form_str(RPL_TESTLINE), - me.name, source_p->name, 'Q', 0L, - conf->name, - conf->reason ? conf->reason : CONF_NOREASON); - ++matches; - } - - if (matches == 0) - sendto_one(source_p, form_str(RPL_NOTESTLINE), - me.name, source_p->name, parv1_copy); -} - -/* mo_testgecos() - * - * inputs - pointer to physical connection request is coming from - * - pointer to source connection request is coming from - * - parc arg count - * - parv actual arguments - * - * output - always 0 - * side effects - command to test X lines on server - * - * i.e. /quote testgecos gecos - * - */ -static void -mo_testgecos(struct Client *client_p, struct Client *source_p, - int parc, char *parv[]) -{ - struct MaskItem *conf = NULL; - - if (EmptyString(parv[1])) - { - sendto_one(source_p, ":%s NOTICE %s :usage: gecos", - me.name, source_p->name); - return; - } - - if ((conf = find_matching_name_conf(CONF_XLINE, parv[1], NULL, NULL, 0))) - sendto_one(source_p, form_str(RPL_TESTLINE), - me.name, source_p->name, 'X', 0L, - conf->name, conf->reason ? conf->reason : CONF_NOREASON); - else - sendto_one(source_p, form_str(RPL_NOTESTLINE), - me.name, source_p->name, parv[1]); -} - -static struct Message testline_msgtab = { - "TESTLINE", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, - { m_unregistered, m_not_oper, m_ignore, m_ignore, mo_testline, m_ignore } -}; - -struct Message testgecos_msgtab = { - "TESTGECOS", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, - { m_unregistered, m_not_oper, m_ignore, m_ignore, mo_testgecos, m_ignore } -}; - -static void -module_init(void) -{ - mod_add_cmd(&testline_msgtab); - mod_add_cmd(&testgecos_msgtab); -} - -static void -module_exit(void) -{ - mod_del_cmd(&testline_msgtab); - mod_del_cmd(&testgecos_msgtab); -} - -struct module module_entry = { - .node = { NULL, NULL, NULL }, - .name = NULL, - .version = "$Revision$", - .handle = NULL, - .modinit = module_init, - .modexit = module_exit, - .flags = 0 -}; diff --git a/modules/m_testmask.c b/modules/m_testmask.c deleted file mode 100644 index 78d02d5..0000000 --- a/modules/m_testmask.c +++ /dev/null @@ -1,131 +0,0 @@ -/* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_testmask.c: Counts the birdies err local and remote clients. - * - * Copyright (C) 2005 by Diane Bruce - * Coypright (C) 2005 ircd-hybrid team - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1.Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2.Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3.The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * $Id$ - */ - -#include "stdinc.h" -#include "client.h" -#include "irc_string.h" -#include "ircd_defs.h" -#include "ircd.h" -#include "restart.h" -#include "conf.h" -#include "send.h" -#include "hostmask.h" -#include "numeric.h" -#include "parse.h" -#include "modules.h" - - -/* mo_testmask() - * - * inputs - pointer to physical connection request is coming from - * - pointer to source connection request is coming from - * - parc arg count - * - parv actual arguments - * output - NONE - * side effects - count up clients matching mask - * i.e. /quote testmask user@host - */ -static void -mo_testmask(struct Client *client_p, struct Client *source_p, - int parc, char *parv[]) -{ - struct split_nuh_item nuh; - char given_nick[IRCD_BUFSIZE]; - char given_user[IRCD_BUFSIZE]; - char given_host[IRCD_BUFSIZE]; - unsigned int count[2] = { 0, 0 }; - const dlink_node *ptr = NULL; - - if (EmptyString(parv[1])) - { - sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), - me.name, source_p->name, "TESTMASK"); - return; - } - - nuh.nuhmask = parv[1]; - nuh.nickptr = given_nick; - nuh.userptr = given_user; - nuh.hostptr = given_host; - - nuh.nicksize = sizeof(given_nick); - nuh.usersize = sizeof(given_user); - nuh.hostsize = sizeof(given_host); - - split_nuh(&nuh); - - DLINK_FOREACH(ptr, global_client_list.head) - { - const struct Client *target_p = ptr->data; - - if (!IsClient(target_p) || match(given_nick, target_p->name)) - continue; - - if (!match(given_user, target_p->username)) - if (!match(given_host, target_p->host) || !match(given_host, target_p->sockhost)) - ++count[!MyConnect(target_p)]; - } - - sendto_one(source_p, form_str(RPL_TESTMASK), me.name, - source_p->name, - given_nick, given_user, - given_host, count[0], count[1]); -} - -static struct Message testmask_msgtab = { - "TESTMASK", 0, 0, 2, MAXPARA, MFLG_SLOW, 0, - {m_unregistered, m_not_oper, m_ignore, m_ignore, mo_testmask, m_ignore} -}; - -static void -module_init(void) -{ - mod_add_cmd(&testmask_msgtab); -} - -static void -module_exit(void) -{ - mod_del_cmd(&testmask_msgtab); -} - -struct module module_entry = { - .node = { NULL, NULL, NULL }, - .name = NULL, - .version = "$Revision$", - .handle = NULL, - .modinit = module_init, - .modexit = module_exit, - .flags = 0 -}; diff --git a/modules/m_time.c b/modules/m_time.c index 14705c6..e240c9d 100644 --- a/modules/m_time.c +++ b/modules/m_time.c @@ -53,7 +53,7 @@ m_time(struct Client *client_p, struct Client *source_p, if (hunt_server(client_p, source_p, ":%s TIME :%s", 1, parc, parv) != HUNTED_ISME) return; - sendto_one(source_p, form_str(RPL_TIME), me.name, + sendto_one(source_p, RPL_TIME, me.name, source_p->name, me.name, date(0)); } @@ -67,7 +67,7 @@ mo_time(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { if (hunt_server(client_p, source_p, ":%s TIME :%s", 1, parc, parv) == HUNTED_ISME) - sendto_one(source_p, form_str(RPL_TIME), me.name, + sendto_one(source_p, RPL_TIME, me.name, source_p->name, me.name, date(0)); } diff --git a/modules/m_topic.c b/modules/m_topic.c index 75b3294..aa17b01 100644 --- a/modules/m_topic.c +++ b/modules/m_topic.c @@ -51,7 +51,7 @@ m_topic(struct Client *client_p, struct Client *source_p, if (EmptyString(parv[1])) { - sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), + sendto_one(source_p, ERR_NEEDMOREPARAMS, me.name, source_p->name, "TOPIC"); return; } @@ -61,7 +61,7 @@ m_topic(struct Client *client_p, struct Client *source_p, if ((chptr = hash_find_channel(parv[1])) == NULL) { - sendto_one(source_p, form_str(ERR_NOSUCHCHANNEL), + sendto_one(source_p, ERR_NOSUCHCHANNEL, me.name, source_p->name, parv[1]); return; } @@ -73,7 +73,7 @@ m_topic(struct Client *client_p, struct Client *source_p, if ((ms = find_channel_link(source_p, chptr)) == NULL) { - sendto_one(source_p, form_str(ERR_NOTONCHANNEL), me.name, + sendto_one(source_p, ERR_NOTONCHANNEL, me.name, source_p->name, parv[1]); return; } @@ -103,7 +103,7 @@ m_topic(struct Client *client_p, struct Client *source_p, chptr->chname, chptr->topic); } else - sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED), + sendto_one(source_p, ERR_CHANOPRIVSNEEDED, me.name, source_p->name, chptr->chname); } else /* only asking for topic */ @@ -111,21 +111,21 @@ m_topic(struct Client *client_p, struct Client *source_p, if (!SecretChannel(chptr) || IsMember(source_p, chptr)) { if (chptr->topic[0] == '\0') - sendto_one(source_p, form_str(RPL_NOTOPIC), + sendto_one(source_p, RPL_NOTOPIC, me.name, source_p->name, chptr->chname); else { - sendto_one(source_p, form_str(RPL_TOPIC), + sendto_one(source_p, RPL_TOPIC, me.name, source_p->name, chptr->chname, chptr->topic); - sendto_one(source_p, form_str(RPL_TOPICWHOTIME), + sendto_one(source_p, RPL_TOPICWHOTIME, me.name, source_p->name, chptr->chname, chptr->topic_info, chptr->topic_time); } } else - sendto_one(source_p, form_str(ERR_NOTONCHANNEL), + sendto_one(source_p, ERR_NOTONCHANNEL, me.name, source_p->name, chptr->chname); } } @@ -146,14 +146,14 @@ ms_topic(struct Client *client_p, struct Client *source_p, if (EmptyString(parv[1])) { - sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), + sendto_one(source_p, ERR_NEEDMOREPARAMS, from, to, "TOPIC"); return; } if ((chptr = hash_find_channel(parv[1])) == NULL) { - sendto_one(source_p, form_str(ERR_NOSUCHCHANNEL), + sendto_one(source_p, ERR_NOSUCHCHANNEL, from, to, parv[1]); return; } diff --git a/modules/m_trace.c b/modules/m_trace.c index 3c1be75..03f277b 100644 --- a/modules/m_trace.c +++ b/modules/m_trace.c @@ -71,7 +71,7 @@ m_trace(struct Client *client_p, struct Client *source_p, else tname = me.name; - sendto_one(source_p, form_str(RPL_ENDOFTRACE), + sendto_one(source_p, RPL_ENDOFTRACE, me.name, source_p->name, tname); } @@ -128,10 +128,10 @@ mo_trace(struct Client *client_p, struct Client *source_p, } if (ac2ptr != NULL) - sendto_one(source_p, form_str(RPL_TRACELINK), from, to, + sendto_one(source_p, RPL_TRACELINK, from, to, ircd_version, tname, ac2ptr->from->name); else - sendto_one(source_p, form_str(RPL_TRACELINK), from, to, + sendto_one(source_p, RPL_TRACELINK, from, to, ircd_version, tname, "ac2ptr_is_NULL!!"); return; } @@ -214,7 +214,7 @@ do_actual_trace(struct Client *source_p, int parc, char *parv[]) if (HasUMode(target_p, UMODE_OPER)) { - sendto_one(source_p, form_str(RPL_TRACEOPERATOR), + sendto_one(source_p, RPL_TRACEOPERATOR, from, to, get_client_class(&target_p->localClient->confs), name, IsIPSpoof(target_p) ? "255.255.255.255" : target_p->sockhost, CurrentTime - target_p->localClient->lasttime, @@ -222,7 +222,7 @@ do_actual_trace(struct Client *source_p, int parc, char *parv[]) } else { - sendto_one(source_p,form_str(RPL_TRACEUSER), + sendto_one(source_p, RPL_TRACEUSER, from, to, get_client_class(&target_p->localClient->confs), name, IsIPSpoof(target_p) ? "255.255.255.255" : target_p->sockhost, CurrentTime - target_p->localClient->lasttime, @@ -230,7 +230,7 @@ do_actual_trace(struct Client *source_p, int parc, char *parv[]) } } - sendto_one(source_p, form_str(RPL_ENDOFTRACE), + sendto_one(source_p, RPL_ENDOFTRACE, from, to, tname); return; } @@ -282,11 +282,11 @@ do_actual_trace(struct Client *source_p, int parc, char *parv[]) const struct ClassItem *class = ptr->data; if (class->ref_count > 0) - sendto_one(source_p, form_str(RPL_TRACECLASS), + sendto_one(source_p, RPL_TRACECLASS, from, to, class->name, class->ref_count); } - sendto_one(source_p, form_str(RPL_ENDOFTRACE), from, to, tname); + sendto_one(source_p, RPL_ENDOFTRACE, from, to, tname); } /* report_this_status() @@ -322,12 +322,12 @@ report_this_status(struct Client *source_p, struct Client *target_p, int dow) switch (target_p->status) { case STAT_CONNECTING: - sendto_one(source_p, form_str(RPL_TRACECONNECTING), + sendto_one(source_p, RPL_TRACECONNECTING, from, to, class_name, HasUMode(source_p, UMODE_ADMIN) ? name : target_p->name); break; case STAT_HANDSHAKE: - sendto_one(source_p, form_str(RPL_TRACEHANDSHAKE), + sendto_one(source_p, RPL_TRACEHANDSHAKE, from, to, class_name, HasUMode(source_p, UMODE_ADMIN) ? name : target_p->name); break; @@ -335,7 +335,7 @@ report_this_status(struct Client *source_p, struct Client *target_p, int dow) break; case STAT_UNKNOWN: /* added time -Taner */ - sendto_one(source_p, form_str(RPL_TRACEUNKNOWN), + sendto_one(source_p, RPL_TRACEUNKNOWN, from, to, class_name, name, target_p->sockhost, target_p->localClient->firsttime ? /* TBD: can't be 0 */ CurrentTime - target_p->localClient->firsttime : -1); @@ -350,7 +350,7 @@ report_this_status(struct Client *source_p, struct Client *target_p, int dow) || !dow || HasUMode(target_p, UMODE_OPER)) { if (HasUMode(target_p, UMODE_ADMIN) && !ConfigFileEntry.hide_spoof_ips) - sendto_one(source_p, form_str(RPL_TRACEOPERATOR), + sendto_one(source_p, RPL_TRACEOPERATOR, from, to, class_name, name, HasUMode(source_p, UMODE_ADMIN) ? target_p->sockhost : "255.255.255.255", CurrentTime - target_p->localClient->lasttime, @@ -359,13 +359,13 @@ report_this_status(struct Client *source_p, struct Client *target_p, int dow) else if (HasUMode(target_p, UMODE_OPER)) { if (ConfigFileEntry.hide_spoof_ips) - sendto_one(source_p, form_str(RPL_TRACEOPERATOR), + sendto_one(source_p, RPL_TRACEOPERATOR, from, to, class_name, name, IsIPSpoof(target_p) ? "255.255.255.255" : target_p->sockhost, CurrentTime - target_p->localClient->lasttime, idle_time_get(source_p, target_p)); else - sendto_one(source_p, form_str(RPL_TRACEOPERATOR), + sendto_one(source_p, RPL_TRACEOPERATOR, from, to, class_name, name, MyOper(source_p) ? target_p->sockhost : (IsIPSpoof(target_p) ? "255.255.255.255" : target_p->sockhost), @@ -375,13 +375,13 @@ report_this_status(struct Client *source_p, struct Client *target_p, int dow) else { if (ConfigFileEntry.hide_spoof_ips) - sendto_one(source_p, form_str(RPL_TRACEUSER), + sendto_one(source_p, RPL_TRACEUSER, from, to, class_name, name, IsIPSpoof(target_p) ? "255.255.255.255" : target_p->sockhost, CurrentTime - target_p->localClient->lasttime, idle_time_get(source_p, target_p)); else - sendto_one(source_p, form_str(RPL_TRACEUSER), + sendto_one(source_p, RPL_TRACEUSER, from, to, class_name, name, MyOper(source_p) ? target_p->sockhost : (IsIPSpoof(target_p) ? "255.255.255.255" : target_p->sockhost), @@ -400,7 +400,7 @@ report_this_status(struct Client *source_p, struct Client *target_p, int dow) if (!HasUMode(source_p, UMODE_ADMIN)) name = get_client_name(target_p, MASK_IP); - sendto_one(source_p, form_str(RPL_TRACESERVER), + sendto_one(source_p, RPL_TRACESERVER, from, to, class_name, servers, clients, name, *(target_p->serv->by) ? target_p->serv->by : "*", "*", @@ -409,7 +409,7 @@ report_this_status(struct Client *source_p, struct Client *target_p, int dow) } default: /* ...we actually shouldn't come here... --msa */ - sendto_one(source_p, form_str(RPL_TRACENEWTYPE), + sendto_one(source_p, RPL_TRACENEWTYPE, from, to, name); break; } diff --git a/modules/m_user.c b/modules/m_user.c index 9db36b4..d12f92f 100644 --- a/modules/m_user.c +++ b/modules/m_user.c @@ -94,7 +94,7 @@ mr_user(struct Client *client_p, struct Client *source_p, if (EmptyString(parv[4])) { - sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, + sendto_one(source_p, ERR_NEEDMOREPARAMS, me.name, source_p->name[0] ? source_p->name : "*", "USER"); return; } diff --git a/modules/m_userhost.c b/modules/m_userhost.c index 1f7c604..46490f5 100644 --- a/modules/m_userhost.c +++ b/modules/m_userhost.c @@ -50,7 +50,7 @@ m_userhost(struct Client *client_p, struct Client *source_p, int cur_len; int rl; - cur_len = snprintf(buf, sizeof(buf), form_str(RPL_USERHOST), me.name, source_p->name, ""); + cur_len = snprintf(buf, sizeof(buf), RPL_USERHOST, me.name, source_p->name, ""); t = buf + cur_len; for (nick = strtoken(&p, parv[1], " "); nick && i++ < 5; diff --git a/modules/m_users.c b/modules/m_users.c index 14ab296..90615fa 100644 --- a/modules/m_users.c +++ b/modules/m_users.c @@ -46,7 +46,7 @@ m_users(struct Client *client_p, struct Client *source_p, if (last_used + ConfigFileEntry.pace_wait_simple > CurrentTime) { - sendto_one(source_p, form_str(RPL_LOAD2HI), + sendto_one(source_p, RPL_LOAD2HI, me.name, source_p->name); return; } @@ -58,13 +58,13 @@ m_users(struct Client *client_p, struct Client *source_p, parc, parv) != HUNTED_ISME) return; - sendto_one(source_p, form_str(RPL_LOCALUSERS), me.name, source_p->name, + sendto_one(source_p, RPL_LOCALUSERS, me.name, source_p->name, ConfigServerHide.hide_servers ? Count.total : Count.local, ConfigServerHide.hide_servers ? Count.max_tot : Count.max_loc, ConfigServerHide.hide_servers ? Count.total : Count.local, ConfigServerHide.hide_servers ? Count.max_tot : Count.max_loc); - sendto_one(source_p, form_str(RPL_GLOBALUSERS), me.name, source_p->name, + sendto_one(source_p, RPL_GLOBALUSERS, me.name, source_p->name, Count.total, Count.max_tot, Count.total, Count.max_tot); } @@ -82,13 +82,13 @@ mo_users(struct Client *client_p, struct Client *source_p, return; if (!HasUMode(source_p, UMODE_OPER) && ConfigServerHide.hide_servers) - sendto_one(source_p, form_str(RPL_LOCALUSERS), me.name, source_p->name, + sendto_one(source_p, RPL_LOCALUSERS, me.name, source_p->name, Count.total, Count.max_tot, Count.total, Count.max_tot); else - sendto_one(source_p, form_str(RPL_LOCALUSERS), me.name, source_p->name, + sendto_one(source_p, RPL_LOCALUSERS, me.name, source_p->name, Count.local, Count.max_loc, Count.local, Count.max_loc); - sendto_one(source_p, form_str(RPL_GLOBALUSERS), me.name, source_p->name, + sendto_one(source_p, RPL_GLOBALUSERS, me.name, source_p->name, Count.total, Count.max_tot, Count.total, Count.max_tot); } diff --git a/modules/m_version.c b/modules/m_version.c index 5a9d9cc..41cea48 100644 --- a/modules/m_version.c +++ b/modules/m_version.c @@ -101,7 +101,7 @@ m_version(struct Client *client_p, struct Client *source_p, if ((last_used + ConfigFileEntry.pace_wait_simple) > CurrentTime) { /* safe enough to give this on a local connect only */ - sendto_one(source_p, form_str(RPL_LOAD2HI), + sendto_one(source_p, RPL_LOAD2HI, me.name, source_p->name); return; } @@ -113,7 +113,7 @@ m_version(struct Client *client_p, struct Client *source_p, 1, parc, parv) != HUNTED_ISME) return; - sendto_one(source_p, form_str(RPL_VERSION), + sendto_one(source_p, RPL_VERSION, me.name, source_p->name, ircd_version, serno, me.name, confopts(source_p), serveropts); show_isupport(source_p); @@ -133,7 +133,7 @@ mo_version(struct Client *client_p, struct Client *source_p, 1, parc, parv) != HUNTED_ISME) return; - sendto_one(source_p, form_str(RPL_VERSION), me.name, + sendto_one(source_p, RPL_VERSION, me.name, source_p->name, ircd_version, serno, me.name, confopts(source_p), serveropts); @@ -152,7 +152,7 @@ ms_version(struct Client *client_p, struct Client *source_p, if (hunt_server(client_p, source_p, ":%s VERSION :%s", 1, parc, parv) == HUNTED_ISME) { - sendto_one(source_p, form_str(RPL_VERSION), + sendto_one(source_p, RPL_VERSION, ID_or_name(&me, client_p), ID_or_name(source_p, client_p), ircd_version, serno, diff --git a/modules/m_wallops.c b/modules/m_wallops.c index c05a56d..af98c48 100644 --- a/modules/m_wallops.c +++ b/modules/m_wallops.c @@ -47,7 +47,7 @@ mo_wallops(struct Client *client_p, struct Client *source_p, if (EmptyString(message)) { - sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), + sendto_one(source_p, ERR_NEEDMOREPARAMS, me.name, source_p->name, "WALLOPS"); return; } diff --git a/modules/m_watch.c b/modules/m_watch.c index fb75aa4..4e0aa55 100644 --- a/modules/m_watch.c +++ b/modules/m_watch.c @@ -44,16 +44,16 @@ */ static void show_watch(struct Client *client_p, const char *name, - unsigned int rpl1, unsigned int rpl2) + const char *rpl1, const char *rpl2) { const struct Client *target_p = NULL; if ((target_p = find_person(client_p, name))) - sendto_one(client_p, form_str(rpl1), me.name, client_p->name, + sendto_one(client_p, rpl1, me.name, client_p->name, target_p->name, target_p->username, target_p->host, target_p->tsinfo); else - sendto_one(client_p, form_str(rpl2), me.name, client_p->name, + sendto_one(client_p, rpl2, me.name, client_p->name, name, "*", "*", 0); } @@ -96,7 +96,7 @@ m_watch(struct Client *client_p, struct Client *source_p, int parc, char *parv[] if (dlink_list_length(&source_p->localClient->watches) >= ConfigFileEntry.max_watch) { - sendto_one(source_p, form_str(ERR_TOOMANYWATCH), me.name, + sendto_one(source_p, ERR_TOOMANYWATCH, me.name, source_p->name, s + 1, ConfigFileEntry.max_watch); continue; } @@ -152,7 +152,7 @@ m_watch(struct Client *client_p, struct Client *source_p, int parc, char *parv[] if ((anptr = watch_find_hash(source_p->name))) count = dlink_list_length(&anptr->watched_by); - sendto_one(source_p, form_str(RPL_WATCHSTAT), + sendto_one(source_p, RPL_WATCHSTAT, me.name, source_p->name, dlink_list_length(&source_p->localClient->watches), count); @@ -162,7 +162,7 @@ m_watch(struct Client *client_p, struct Client *source_p, int parc, char *parv[] */ if ((ptr = source_p->localClient->watches.head) == NULL) { - sendto_one(source_p, form_str(RPL_ENDOFWATCHLIST), + sendto_one(source_p, RPL_ENDOFWATCHLIST, me.name, source_p->name, *s); continue; } @@ -179,7 +179,7 @@ m_watch(struct Client *client_p, struct Client *source_p, int parc, char *parv[] if (count + strlen(anptr->nick) + 1 > IRCD_BUFSIZE - 2) { - sendto_one(source_p, form_str(RPL_WATCHLIST), + sendto_one(source_p, RPL_WATCHLIST, me.name, source_p->name, buf); buf[0] = '\0'; count = strlen(source_p->name) + strlen(me.name) + 10; @@ -190,9 +190,9 @@ m_watch(struct Client *client_p, struct Client *source_p, int parc, char *parv[] count += (strlen(anptr->nick) + 1); } - sendto_one(source_p, form_str(RPL_WATCHLIST), + sendto_one(source_p, RPL_WATCHLIST, me.name, source_p->name, buf); - sendto_one(source_p, form_str(RPL_ENDOFWATCHLIST), + sendto_one(source_p, RPL_ENDOFWATCHLIST, me.name, source_p->name, *s); continue; } @@ -216,7 +216,7 @@ m_watch(struct Client *client_p, struct Client *source_p, int parc, char *parv[] const struct Watch *anptr = ptr->data; if ((target_p = find_person(source_p, anptr->nick))) - sendto_one(source_p, form_str(RPL_NOWON), me.name, source_p->name, + sendto_one(source_p, RPL_NOWON, me.name, source_p->name, target_p->name, target_p->username, target_p->host, target_p->tsinfo); /* @@ -224,12 +224,12 @@ m_watch(struct Client *client_p, struct Client *source_p, int parc, char *parv[] * 'L' (full list wanted). */ else if (*s == 'L') - sendto_one(source_p, form_str(RPL_NOWOFF), me.name, + sendto_one(source_p, RPL_NOWOFF, me.name, source_p->name, anptr->nick, "*", "*", anptr->lasttime); } - sendto_one(source_p, form_str(RPL_ENDOFWATCHLIST), + sendto_one(source_p, RPL_ENDOFWATCHLIST, me.name, source_p->name, *s); continue; } diff --git a/modules/m_who.c b/modules/m_who.c index 09a5495..7939eeb 100644 --- a/modules/m_who.c +++ b/modules/m_who.c @@ -63,7 +63,7 @@ m_who(struct Client *client_p, struct Client *source_p, if (EmptyString(mask)) { who_global(source_p, mask, server_oper); - sendto_one(source_p, form_str(RPL_ENDOFWHO), + sendto_one(source_p, RPL_ENDOFWHO, me.name, source_p->name, "*"); return; } @@ -81,7 +81,7 @@ m_who(struct Client *client_p, struct Client *source_p, server_oper); } - sendto_one(source_p, form_str(RPL_ENDOFWHO), + sendto_one(source_p, RPL_ENDOFWHO, me.name, source_p->name, "*"); return; } @@ -98,7 +98,7 @@ m_who(struct Client *client_p, struct Client *source_p, do_who_on_channel(source_p, chptr, chptr->chname, 0, server_oper); } - sendto_one(source_p, form_str(RPL_ENDOFWHO), + sendto_one(source_p, RPL_ENDOFWHO, me.name, source_p->name, mask); return; } @@ -120,7 +120,7 @@ m_who(struct Client *client_p, struct Client *source_p, else do_who(source_p, target_p, NULL, ""); - sendto_one(source_p, form_str(RPL_ENDOFWHO), + sendto_one(source_p, RPL_ENDOFWHO, me.name, source_p->name, mask); return; } @@ -132,7 +132,7 @@ m_who(struct Client *client_p, struct Client *source_p, who_global(source_p, mask, server_oper); /* Wasn't a nick, wasn't a channel, wasn't a '*' so ... */ - sendto_one(source_p, form_str(RPL_ENDOFWHO), + sendto_one(source_p, RPL_ENDOFWHO, me.name, source_p->name, mask); } @@ -213,7 +213,7 @@ who_global(struct Client *source_p, char *mask, int server_oper) if ((last_used + ConfigFileEntry.pace_wait) > CurrentTime) { /* safe enough to give this on a local connect only */ - sendto_one(source_p, form_str(RPL_LOAD2HI), me.name, source_p->name); + sendto_one(source_p, RPL_LOAD2HI, me.name, source_p->name); return; } @@ -324,7 +324,7 @@ do_who(struct Client *source_p, struct Client *target_p, if (ConfigServerHide.hide_servers) { - sendto_one(source_p, form_str(RPL_WHOREPLY), me.name, source_p->name, + sendto_one(source_p, RPL_WHOREPLY, me.name, source_p->name, (chname) ? (chname) : "*", target_p->username, target_p->host, HasUMode(source_p, UMODE_OPER) ? target_p->servptr->name : "*", @@ -332,7 +332,7 @@ do_who(struct Client *source_p, struct Client *target_p, } else { - sendto_one(source_p, form_str(RPL_WHOREPLY), me.name, source_p->name, + sendto_one(source_p, RPL_WHOREPLY, me.name, source_p->name, (chname) ? (chname) : "*", target_p->username, target_p->host, target_p->servptr->name, target_p->name, status, target_p->hopcount, target_p->info); diff --git a/modules/m_whois.c b/modules/m_whois.c index 6b6d247..3cc9fb0 100644 --- a/modules/m_whois.c +++ b/modules/m_whois.c @@ -58,7 +58,7 @@ m_whois(struct Client *client_p, struct Client *source_p, if (parc < 2 || EmptyString(parv[1])) { - sendto_one(source_p, form_str(ERR_NONICKNAMEGIVEN), + sendto_one(source_p, ERR_NONICKNAMEGIVEN, me.name, source_p->name); return; } @@ -68,7 +68,7 @@ m_whois(struct Client *client_p, struct Client *source_p, /* seeing as this is going across servers, we should limit it */ if ((last_used + ConfigFileEntry.pace_wait_simple) > CurrentTime) { - sendto_one(source_p, form_str(RPL_LOAD2HI), + sendto_one(source_p, RPL_LOAD2HI, me.name, source_p->name); return; } @@ -103,7 +103,7 @@ mo_whois(struct Client *client_p, struct Client *source_p, { if (parc < 2 || EmptyString(parv[1])) { - sendto_one(source_p, form_str(ERR_NONICKNAMEGIVEN), + sendto_one(source_p, ERR_NONICKNAMEGIVEN, me.name, source_p->name); return; } @@ -165,7 +165,7 @@ do_whois(struct Client *source_p, int parc, char *parv[]) { if ((last_used + ConfigFileEntry.pace_wait_simple) > CurrentTime) { - sendto_one(source_p, form_str(RPL_LOAD2HI), + sendto_one(source_p, RPL_LOAD2HI, me.name, source_p->name); return; } @@ -181,11 +181,11 @@ do_whois(struct Client *source_p, int parc, char *parv[]) if (!found) { if (!IsDigit(*nick)) - sendto_one(source_p, form_str(ERR_NOSUCHNICK), + sendto_one(source_p, ERR_NOSUCHNICK, me.name, source_p->name, nick); } - sendto_one(source_p, form_str(RPL_ENDOFWHOIS), + sendto_one(source_p, RPL_ENDOFWHOIS, me.name, source_p->name, parv[1]); } @@ -293,11 +293,11 @@ whois_person(struct Client *source_p, struct Client *target_p) server_p = target_p->servptr; - sendto_one(source_p, form_str(RPL_WHOISUSER), + sendto_one(source_p, RPL_WHOISUSER, me.name, source_p->name, target_p->name, target_p->username, target_p->host, target_p->info); - cur_len = mlen = snprintf(buf, sizeof(buf), form_str(RPL_WHOISCHANNELS), + cur_len = mlen = snprintf(buf, sizeof(buf), RPL_WHOISCHANNELS, me.name, source_p->name, target_p->name, ""); t = buf + mlen; @@ -330,32 +330,32 @@ whois_person(struct Client *source_p, struct Client *target_p) } if (HasUMode(source_p, UMODE_OPER) || !ConfigServerHide.hide_servers || target_p == source_p) - sendto_one(source_p, form_str(RPL_WHOISSERVER), + sendto_one(source_p, RPL_WHOISSERVER, me.name, source_p->name, target_p->name, server_p->name, server_p->info); else - sendto_one(source_p, form_str(RPL_WHOISSERVER), + sendto_one(source_p, RPL_WHOISSERVER, me.name, source_p->name, target_p->name, ConfigServerHide.hidden_name, ServerInfo.network_desc); if (HasUMode(target_p, UMODE_REGISTERED)) - sendto_one(source_p, form_str(RPL_WHOISREGNICK), + sendto_one(source_p, RPL_WHOISREGNICK, me.name, source_p->name, target_p->name); if (target_p->away[0]) - sendto_one(source_p, form_str(RPL_AWAY), + sendto_one(source_p, RPL_AWAY, me.name, source_p->name, target_p->name, target_p->away); if (HasUMode(target_p, UMODE_CALLERID) && !HasUMode(target_p, UMODE_SOFTCALLERID)) - sendto_one(source_p, form_str(RPL_TARGUMODEG), + sendto_one(source_p, RPL_TARGUMODEG, me.name, source_p->name, target_p->name); if (HasUMode(target_p, UMODE_OPER)) if (!HasUMode(target_p, UMODE_HIDDEN) || HasUMode(source_p, UMODE_OPER)) - sendto_one(source_p, form_str(HasUMode(target_p, UMODE_ADMIN) ? RPL_WHOISADMIN : - RPL_WHOISOPERATOR), + sendto_one(source_p, HasUMode(target_p, UMODE_ADMIN) ? RPL_WHOISADMIN : + RPL_WHOISOPERATOR, me.name, source_p->name, target_p->name); if (target_p->sockhost[0] && strcmp(target_p->sockhost, "0")) @@ -367,7 +367,7 @@ whois_person(struct Client *source_p, struct Client *target_p) else show_ip = 1; - sendto_one(source_p, form_str(RPL_WHOISACTUALLY), + sendto_one(source_p, RPL_WHOISACTUALLY, me.name, source_p->name, target_p->name, show_ip ? target_p->sockhost : "255.255.255.255"); } @@ -376,10 +376,10 @@ whois_person(struct Client *source_p, struct Client *target_p) { #ifdef HAVE_LIBCRYPTO if (target_p->localClient->fd.ssl) - sendto_one(source_p, form_str(RPL_WHOISSECURE), + sendto_one(source_p, RPL_WHOISSECURE, me.name, source_p->name, target_p->name); #endif - sendto_one(source_p, form_str(RPL_WHOISIDLE), + sendto_one(source_p, RPL_WHOISIDLE, me.name, source_p->name, target_p->name, idle_time_get(source_p, target_p), target_p->localClient->firsttime); diff --git a/modules/m_whowas.c b/modules/m_whowas.c index 2f6da27..21c4cde 100644 --- a/modules/m_whowas.c +++ b/modules/m_whowas.c @@ -75,17 +75,17 @@ whowas_do(struct Client *client_p, struct Client *source_p, if (!irccmp(nick, temp->name)) { - sendto_one(source_p, form_str(RPL_WHOWASUSER), + sendto_one(source_p, RPL_WHOWASUSER, me.name, source_p->name, temp->name, temp->username, temp->hostname, temp->realname); if (ConfigServerHide.hide_servers && !HasUMode(source_p, UMODE_OPER)) - sendto_one(source_p, form_str(RPL_WHOISSERVER), + sendto_one(source_p, RPL_WHOISSERVER, me.name, source_p->name, temp->name, ServerInfo.network_name, myctime(temp->logoff)); else - sendto_one(source_p, form_str(RPL_WHOISSERVER), + sendto_one(source_p, RPL_WHOISSERVER, me.name, source_p->name, temp->name, temp->servername, myctime(temp->logoff)); ++cur; @@ -96,10 +96,10 @@ whowas_do(struct Client *client_p, struct Client *source_p, } if (!cur) - sendto_one(source_p, form_str(ERR_WASNOSUCHNICK), + sendto_one(source_p, ERR_WASNOSUCHNICK, me.name, source_p->name, nick); - sendto_one(source_p, form_str(RPL_ENDOFWHOWAS), + sendto_one(source_p, RPL_ENDOFWHOWAS, me.name, source_p->name, parv[1]); } @@ -116,14 +116,14 @@ m_whowas(struct Client *client_p, struct Client *source_p, if (parc < 2 || EmptyString(parv[1])) { - sendto_one(source_p, form_str(ERR_NONICKNAMEGIVEN), + sendto_one(source_p, ERR_NONICKNAMEGIVEN, me.name, source_p->name); return; } if ((last_used + ConfigFileEntry.pace_wait) > CurrentTime) { - sendto_one(source_p,form_str(RPL_LOAD2HI), + sendto_one(source_p, RPL_LOAD2HI, me.name, source_p->name); return; } @@ -139,7 +139,7 @@ mo_whowas(struct Client *client_p, struct Client *source_p, { if (parc < 2 || EmptyString(parv[1])) { - sendto_one(source_p, form_str(ERR_NONICKNAMEGIVEN), + sendto_one(source_p, ERR_NONICKNAMEGIVEN, me.name, source_p->name); return; } diff --git a/modules/m_xline.c b/modules/m_xline.c index 9127b08..2841b6d 100644 --- a/modules/m_xline.c +++ b/modules/m_xline.c @@ -74,7 +74,7 @@ mo_xline(struct Client *client_p, struct Client *source_p, if (!HasOFlag(source_p, OPER_FLAG_X)) { - sendto_one(source_p, form_str(ERR_NOPRIVS), + sendto_one(source_p, ERR_NOPRIVS, me.name, source_p->name, "xline"); return; } @@ -232,7 +232,7 @@ mo_unxline(struct Client *client_p, struct Client *source_p, if (!HasOFlag(source_p, OPER_FLAG_X)) { - sendto_one(source_p, form_str(ERR_NOPRIVS), + sendto_one(source_p, ERR_NOPRIVS, me.name, source_p->name, "unxline"); return; } @@ -298,7 +298,7 @@ valid_xline(struct Client *source_p, char *gecos, char *reason, int warn) if (EmptyString(reason)) { if (warn) - sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), + sendto_one(source_p, ERR_NEEDMOREPARAMS, me.name, source_p->name, "XLINE"); return 0; } |