diff options
Diffstat (limited to 'src/modes/cmode_o.cpp')
-rw-r--r-- | src/modes/cmode_o.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/modes/cmode_o.cpp b/src/modes/cmode_o.cpp index dfa3a1a10..853bb86e5 100644 --- a/src/modes/cmode_o.cpp +++ b/src/modes/cmode_o.cpp @@ -26,6 +26,23 @@ ModeChannelOp::ModeChannelOp() : ModeHandler('o', 1, 1, true, MODETYPE_CHANNEL, { } +std::pair<bool,std::string> ModeChannelOp::ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter) +{ + userrec* x = Find(parameter); + if (x) + { + if (cstatus(x, channel) == STATUS_OP) + { + return std::make_pair(true, x->nick); + } + else + { + return std::make_pair(false, parameter); + } + } + return std::make_pair(false, parameter); +} + ModeAction ModeChannelOp::OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding) { int status = cstatus(source, channel); |