X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=ircd%2Fm_version.c;h=656332e3a5bdc8e931975ff8166591c73b2fd992;hb=1570a04e15bec6b2945e4351b1e05211aecdcacc;hp=a4d9c5532065335b666f045ecbeb7486068e11af;hpb=5ba09703da9f8f21f3278dc0222cd6fe077cfe31;p=ircu2.10.12-pk.git diff --git a/ircd/m_version.c b/ircd/m_version.c index a4d9c55..656332e 100644 --- a/ircd/m_version.c +++ b/ircd/m_version.c @@ -85,9 +85,11 @@ #include "hash.h" #include "ircd.h" #include "ircd_features.h" +#include "ircd_log.h" #include "ircd_reply.h" #include "ircd_snprintf.h" #include "ircd_string.h" +#include "match.h" #include "msg.h" #include "numeric.h" #include "numnicks.h" @@ -97,7 +99,7 @@ #include "supported.h" #include "version.h" -#include +/* #include -- Now using assert in ircd_log.h */ /* * m_version - generic message handler @@ -107,20 +109,17 @@ */ int m_version(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) { - struct Client *acptr; - if (parc > 1 && (!(acptr = find_match_server(parv[1])) || !IsMe(acptr))) - send_reply(sptr, ERR_NOPRIVILEGES); - else - { - send_reply(sptr, RPL_VERSION, version, debugmode, cli_name(&me), - debug_serveropts()); - send_supported(sptr); - } + if (parc > 1 && match(parv[1], cli_name(&me))) + return send_reply(sptr, ERR_NOPRIVILEGES); + + send_reply(sptr, RPL_VERSION, version, debugmode, cli_name(&me), + debug_serveropts()); + send_supported(sptr); return 0; } /* - * mo_version - generic message handler + * mo_version - oper message handler * * parv[0] = sender prefix * parv[1] = servername