-#ifdef NODEFAULTMOTD
- send_reply(cptr, RPL_MOTDSTART, cli_name(&me));
- send_reply(cptr, SND_EXPLICIT | RPL_MOTD, ":\002Type /MOTD to read the AUP "
- "before continuing using this service.\002");
- send_reply(cptr, SND_EXPLICIT | RPL_MOTD, ":The message of the day was last "
- "changed: %d-%d-%d %d:%d", cache->modtime.tm_year + 1900,
- cache->modtime.tm_mon + 1, cache->modtime.tm_mday,
- cache->modtime.tm_hour, cache->modtime.tm_min);
- send_reply(cptr, RPL_ENDOFMOTD);
-#else
- motd_forward(cptr, cache);
-#endif
+ if (!feature_bool(FEAT_NODEFAULTMOTD) || !cache)
+ motd_forward(cptr, cache);
+ else {
+ send_reply(cptr, RPL_MOTDSTART, cli_name(&me));
+ if ((banner = feature_str(FEAT_MOTD_BANNER)))
+ send_reply(cptr, SND_EXPLICIT | RPL_MOTD, ":%s", banner);
+ send_reply(cptr, SND_EXPLICIT | RPL_MOTD, ":\002Type /MOTD to read the "
+ "AUP before continuing using this service.\002");
+ send_reply(cptr, SND_EXPLICIT | RPL_MOTD, ":The message of the day was "
+ "last changed: %d-%d-%d %d:%d", cache->modtime.tm_year + 1900,
+ cache->modtime.tm_mon + 1, cache->modtime.tm_mday,
+ cache->modtime.tm_hour, cache->modtime.tm_min);
+ send_reply(cptr, RPL_ENDOFMOTD);
+ }