diff options
| author | Adam <Adam@anope.org> | 2010-08-17 19:27:37 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2010-08-17 19:27:37 -0400 |
| commit | e65d8b2f3dfdb40858259b3bb48ef6998c31e62f (patch) | |
| tree | fd845bdef5664d025ab19c262ae2c5e9d23d7bb2 /include/extern.h | |
| parent | 2575008baa5c9d0ca789680da1a3b81dc74786f7 (diff) | |
Rewrote the config reader to better handle invalid configs.
This prevents Anope from exploding when /os reload has errors.
Diffstat (limited to 'include/extern.h')
| -rw-r--r-- | include/extern.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/include/extern.h b/include/extern.h index f7c488030..b2dd30b79 100644 --- a/include/extern.h +++ b/include/extern.h @@ -94,7 +94,12 @@ E Entry *elist_match_user(EList *list, User *u); E Entry *elist_find_mask(EList *list, const Anope::string &mask); E long get_memuse(EList *list); -#define whosends(ci) (!(ci) || !((ci)->botflags.HasFlag(BS_SYMBIOSIS)) || !(ci)->bi || !(ci)->c || (ci)->c->FindUser((ci)->bi) ? findbot(Config.s_ChanServ) : (ci)->bi) +inline BotInfo *whosends(ChannelInfo *ci) +{ + if (!ci || !ci->bi || !ci->c || !ci->botflags.HasFlag(BS_SYMBIOSIS) || !ci->c->FindUser(ci->bi)) + return ChanServ; + return ci->bi; +} /**** chanserv.c ****/ @@ -130,8 +135,7 @@ E Anope::string get_mlock_modes(ChannelInfo *ci, int complete); /**** config.c ****/ E Anope::string services_conf; -E ServerConfig Config; -E int read_config(int reload); +E ServerConfig *Config; /* hostserv.c */ E void do_on_id(User *u); @@ -297,7 +301,7 @@ E Flags<ChannelModeName> DefMLockOff; E std::map<ChannelModeName, Anope::string> DefMLockParams; /* Modes to set on bots when they join the channel */ E std::list<ChannelModeStatus *> BotModes; -E void SetDefaultMLock(); +E void SetDefaultMLock(ServerConfig *config); /**** nickserv.c ****/ |
