#include "hash.h"
#include "ircd.h"
#include "ircd_features.h"
-#include "ircd_policy.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"
#include "supported.h"
#include "version.h"
-#include <assert.h>
+/* #include <assert.h> -- Now using assert in ircd_log.h */
/*
* m_version - generic message handler
*
* parv[0] = sender prefix
- * parv[1] = remote server
+ * parv[1] = servername
*/
int m_version(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
+{
+ 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 - oper message handler
+ *
+ * parv[0] = sender prefix
+ * parv[1] = servername
+ */
+int mo_version(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
{
struct Client *acptr;
parv[1] = cli_name(acptr);
}
- if (hunt_server_cmd(sptr, CMD_VERSION, cptr, HEAD_IN_SAND_REMOTE, ":%C", 1,
- parc, parv) == HUNTED_ISME)
+ if (hunt_server_cmd(sptr, CMD_VERSION, cptr, feature_int(FEAT_HIS_REMOTE),
+ ":%C", 1,
+ parc, parv)
+ == HUNTED_ISME)
{
- char featurebuf[512];
-
- ircd_snprintf(0, featurebuf, sizeof(featurebuf), FEATURES, FEATURESVALUES);
-
send_reply(sptr, RPL_VERSION, version, debugmode, cli_name(&me),
debug_serveropts());
- send_reply(sptr, RPL_ISUPPORT, featurebuf);
+ send_supported(sptr);
}
return 0;
* ms_version - server message handler
*
* parv[0] = sender prefix
- * parv[1] = remote server
+ * parv[1] = servername
*/
int ms_version(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
{