diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-05-19 21:16:42 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-05-19 21:16:42 +0000 |
commit | 31f1e7ad092f8bf16ee653cc105eea4a769650ca (patch) | |
tree | dced0411d5fbe803fe92ea54cb03d36c0a817563 /src/modes/cmode_k.cpp | |
parent | 869bd02318d94a38369a125726b8edeb54ba0706 (diff) |
Convert channel::name to std::string, this was a beastie!
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9770 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modes/cmode_k.cpp')
-rw-r--r-- | src/modes/cmode_k.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/modes/cmode_k.cpp b/src/modes/cmode_k.cpp index 0ab35b954..4d4453d44 100644 --- a/src/modes/cmode_k.cpp +++ b/src/modes/cmode_k.cpp @@ -63,31 +63,31 @@ bool ModeChannelKey::CheckTimeStamp(time_t, time_t, const std::string &their_par ModeAction ModeChannelKey::OnModeChange(User* source, User*, Channel* channel, std::string ¶meter, bool adding, bool servermode) { - if ((channel->modes[CM_KEY] != adding) || (!IS_LOCAL(source))) + if ((channel->IsModeSet('k') != adding) || (!IS_LOCAL(source))) { - if (((channel->modes[CM_KEY]) && (strcasecmp(parameter.c_str(),channel->key))) && (IS_LOCAL(source))) + if (((channel->IsModeSet('k')) && (parameter != channel->key)) && (IS_LOCAL(source))) { /* Key is currently set and the correct key wasnt given */ return MODEACTION_DENY; } - else if ((!channel->modes[CM_KEY]) || ((adding) && (!IS_LOCAL(source)))) + else if ((!channel->IsModeSet('k')) || ((adding) && (!IS_LOCAL(source)))) { /* Key isnt currently set */ if ((parameter.length()) && (parameter.rfind(' ') == std::string::npos)) { - strlcpy(channel->key,parameter.c_str(),32); - channel->modes[CM_KEY] = adding; + channel->key.assign(parameter, 0, 32); + channel->SetMode('k', adding); parameter = channel->key; return MODEACTION_ALLOW; } else return MODEACTION_DENY; } - else if (((channel->modes[CM_KEY]) && (!strcasecmp(parameter.c_str(),channel->key))) || ((!adding) && (!IS_LOCAL(source)))) + else if (((channel->IsModeSet('k')) && (parameter == channel->key)) || ((!adding) && (!IS_LOCAL(source)))) { /* Key is currently set, and correct key was given */ - *channel->key = 0; - channel->modes[CM_KEY] = adding; + channel->key.clear(); + channel->SetMode('k', adding); return MODEACTION_ALLOW; } return MODEACTION_DENY; |