From 1250abdc0915975f0a99cdcea1a4f6cb006b0a74 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Sun, 21 Apr 2013 15:30:51 +0200 Subject: Don't crop the channel name if it's too long in Channel::Channel() ...and especially don't use the shortened name in one place and the original in another Having different values on the same network is not supported --- src/channels.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/channels.cpp b/src/channels.cpp index 229e2b8ea..3502abe12 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -31,12 +31,10 @@ Channel::Channel(const std::string &cname, time_t ts) { - chan_hash::iterator findchan = ServerInstance->chanlist->find(cname); - if (findchan != ServerInstance->chanlist->end()) + if (!ServerInstance->chanlist->insert(std::make_pair(cname, this)).second) throw CoreException("Cannot create duplicate channel " + cname); - (*(ServerInstance->chanlist))[cname.c_str()] = this; - this->name.assign(cname, 0, ServerInstance->Config->Limits.ChanMax); + this->name = cname; this->age = ts ? ts : ServerInstance->Time(); maxbans = topicset = 0; -- cgit v1.2.3