diff options
| author | 2023-06-26 21:44:19 +0100 | |
|---|---|---|
| committer | 2023-06-26 21:44:19 +0100 | |
| commit | 3414bf8f11913acb606414927c7dc943b62fb935 (patch) | |
| tree | 210909ce73e9f1a1a872148ddde501f337ac571a /src/modules/m_deaf.cpp | |
| parent | Only warn deaf users when they are adding the mode. (diff) | |
| download | inspircd++-3414bf8f11913acb606414927c7dc943b62fb935.tar.gz inspircd++-3414bf8f11913acb606414927c7dc943b62fb935.tar.bz2 inspircd++-3414bf8f11913acb606414927c7dc943b62fb935.zip | |
Fix not being able to unset the deaf/privdeaf modes.
Diffstat (limited to 'src/modules/m_deaf.cpp')
| -rw-r--r-- | src/modules/m_deaf.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/modules/m_deaf.cpp b/src/modules/m_deaf.cpp index aed737c97..d2df5d50f 100644 --- a/src/modules/m_deaf.cpp +++ b/src/modules/m_deaf.cpp @@ -40,13 +40,13 @@ public: bool OnModeChange(User* source, User* dest, Channel* channel, Modes::Change& change) override { - if (change.adding && SimpleUserMode::OnModeChange(source, dest, channel, change)) - { + if (!SimpleUserMode::OnModeChange(source, dest, channel, change)) + return false; + + if (change.adding) dest->WriteNotice("*** You have enabled user mode +d, deaf mode. This mode means you WILL NOT receive any messages from any channels you are in. If you did NOT mean to do this, use /mode " + dest->nick + " -d."); - return true; - } - return false; + return true; } }; @@ -62,13 +62,13 @@ public: bool OnModeChange(User* source, User* dest, Channel* channel, Modes::Change& change) override { - if (change.adding && SimpleUserMode::OnModeChange(source, dest, channel, change)) - { + if (!SimpleUserMode::OnModeChange(source, dest, channel, change)) + return false; + + if (change.adding) dest->WriteNotice("*** You have enabled user mode +D, private deaf mode. This mode means you WILL NOT receive any messages and notices from any nicks. If you did NOT mean to do this, use /mode " + dest->nick + " -D."); - return true; - } - return false; + return true; } }; |
