summaryrefslogtreecommitdiff
path: root/src/modes/cmode_o.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modes/cmode_o.cpp')
-rw-r--r--src/modes/cmode_o.cpp17
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 &parameter)
+{
+ 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 &parameter, bool adding)
{
int status = cstatus(source, channel);