diff --git a/Changes b/Changes index 30e77a1f9..cafeacc64 100644 --- a/Changes +++ b/Changes @@ -2269,3 +2269,5 @@ you can use deny link { } blocks if you want to deny older versions than this release. - Fix documentation about channel mode +t and halfops, thanks warg (#4007). +- Fix empty/nonexistent short MOTD being shown instead of the full + MOTD on user registration. Thanks WakiMiko (#4011). diff --git a/src/s_serv.c b/src/s_serv.c index 03c3d23d2..5b4a9f08c 100644 --- a/src/s_serv.c +++ b/src/s_serv.c @@ -909,26 +909,24 @@ int short_motd(aClient *sptr) tld = Find_tld(sptr, userhost); /* - Try different sources of short MOTDs, falling back to - the long MOTD. + * Try different sources of short MOTDs, falling back to the + * long MOTD. */ - themotd = NULL; - if (tld) + themotd = &smotd; + if (tld && tld->smotd.lines) themotd = &tld->smotd; - if (!themotd) - themotd = &smotd; /* try long MOTDs */ - if (!themotd) + if (!themotd->lines) { is_short = 0; - if (tld) + if (tld && tld->motd.lines) themotd = &tld->motd; + else + themotd = &motd; } - if (!themotd) - themotd = &motd; - if (!themotd) + if (!themotd->lines) { sendto_one(sptr, err_str(ERR_NOMOTD), me.name, sptr->name); return 0;