#include "numeric.h"
#include "numnicks.h"
#include "s_conf.h"
+#include "class.h"
#include "s_user.h"
#include "send.h"
+#include <stdlib.h>
#include <assert.h>
/*
struct TRecord *ptr;
int count;
struct MotdItem *temp;
+ int class = get_client_class(sptr);
#ifdef NODEFAULTMOTD
int no_motd;
{
no_motd = 0;
#endif
- if (hunt_server_cmd(sptr, CMD_MODE, cptr, 0, "%C", 1, parc, parv) !=
+ if (hunt_server_cmd(sptr, CMD_MOTD, cptr, 0, "%C", 1, parc, parv) !=
HUNTED_ISME)
return 0;
#ifdef NODEFAULTMOTD
no_motd = 1;
}
#endif
-
- /*
- * Find out if this is a remote query or if we have a T line for our hostname
+ /* 2.10.11: Allow per Class T:'s
+ * -- Isomer 2000-11-19
*/
- if (IsServer(cptr))
- {
- tm = 0; /* Remote MOTD */
- temp = rmotd;
- }
- else
+ for (ptr = tdata; ptr; ptr = ptr->next)
{
- for (ptr = tdata; ptr; ptr = ptr->next)
- {
- if (!match(ptr->hostmask, cptr->sockhost))
+ if (IsDigit(*ptr->hostmask)) {
+ if (atoi(ptr->hostmask)==class)
break;
}
- if (ptr)
- {
- temp = ptr->tmotd;
- tm = &ptr->tmotd_tm;
- }
- else
- temp = motd;
+ else if (!match(ptr->hostmask, cptr->sockhost))
+ break;
+ }
+ if (ptr)
+ {
+ temp = ptr->tmotd;
+ tm = &ptr->tmotd_tm;
}
+ else
+ temp = motd;
if (temp == 0)
{
send_reply(sptr, ERR_NOMOTD);
if (tm) /* Not remote? */
{
send_reply(sptr, RPL_MOTDSTART, me.name);
- send_reply(sptr, SND_EXPLICIT | RPL_MOTD, "- %d/%d/%d %d:%02d",
+ send_reply(sptr, SND_EXPLICIT | RPL_MOTD, ":- %d/%d/%d %d:%02d",
tm->tm_mday, tm->tm_mon + 1, 1900 + tm->tm_year, tm->tm_hour,
tm->tm_min);
count = 100;