diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/regchannel.cpp | 13 | ||||
-rw-r--r-- | src/users.cpp | 4 |
2 files changed, 14 insertions, 3 deletions
diff --git a/src/regchannel.cpp b/src/regchannel.cpp index acfe5cf91..2af652d8e 100644 --- a/src/regchannel.cpp +++ b/src/regchannel.cpp @@ -368,7 +368,9 @@ ChannelInfo::~ChannelInfo() { if (this->bi && this->c->FindUser(this->bi)) this->bi->Part(this->c); - this->c->ci = NULL; + /* Parting the service bot can cause the channel to go away */ + if (this->c) + this->c->ci = NULL; } RegisteredChannelList->erase(this->name); @@ -760,6 +762,9 @@ void ChannelInfo::ClearBadWords() bool ChannelInfo::HasMLock(ChannelMode *mode, const Anope::string ¶m, bool status) const { + if (!mode) + return false; + std::multimap<Anope::string, ModeLock *>::const_iterator it = this->mode_locks->find(mode->name); if (it != this->mode_locks->end()) @@ -783,6 +788,9 @@ bool ChannelInfo::HasMLock(ChannelMode *mode, const Anope::string ¶m, bool s bool ChannelInfo::SetMLock(ChannelMode *mode, bool status, const Anope::string ¶m, Anope::string setter, time_t created) { + if (!mode) + return false; + if (setter.empty()) setter = this->founder ? this->founder->display : "Unknown"; std::pair<Anope::string, ModeLock *> ml = std::make_pair(mode->name, new ModeLock(this, status, mode->name, param, setter, created)); @@ -825,6 +833,9 @@ bool ChannelInfo::SetMLock(ChannelMode *mode, bool status, const Anope::string & bool ChannelInfo::RemoveMLock(ChannelMode *mode, bool status, const Anope::string ¶m) { + if (!mode) + return false; + if (mode->type == MODE_REGULAR || mode->type == MODE_PARAM) { ChannelInfo::ModeList::iterator it = this->mode_locks->find(mode->name), it_end = this->mode_locks->upper_bound(mode->name), it_next = it; diff --git a/src/users.cpp b/src/users.cpp index 972a39d56..708a8062c 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -47,8 +47,7 @@ User::User(const Anope::string &snick, const Anope::string &sident, const Anope: this->ident = sident; this->host = shost; this->vhost = svhost; - if (!svhost.empty()) - this->SetCloakedHost(svhost); + this->chost = svhost; this->ip = sip; this->server = sserver; this->realname = srealname; @@ -65,6 +64,7 @@ User::User(const Anope::string &snick, const Anope::string &sident, const Anope: Log(LOG_DEBUG) << "Duplicate user " << snick << " in user table?"; this->nc = NULL; + this->UpdateHost(); if (sserver) // Our bots are introduced on startup with no server { |