diff options
| author | Adam <Adam@anope.org> | 2011-08-28 15:46:15 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2011-09-10 02:05:00 -0400 |
| commit | 700a585b1bb38a9dc0ac3e749083250d405488f8 (patch) | |
| tree | 8af306bd60778815fe5a137590d3b888213ad231 /modules/extra | |
| parent | 62752db4c49a8679b51d5996003fd3a23c2a3f2d (diff) | |
Allow modules to add their own channel levels
Diffstat (limited to 'modules/extra')
| -rw-r--r-- | modules/extra/m_helpchan.cpp | 2 | ||||
| -rw-r--r-- | modules/extra/m_statusupdate.cpp | 18 |
2 files changed, 10 insertions, 10 deletions
diff --git a/modules/extra/m_helpchan.cpp b/modules/extra/m_helpchan.cpp index 6efcea572..83477da94 100644 --- a/modules/extra/m_helpchan.cpp +++ b/modules/extra/m_helpchan.cpp @@ -28,7 +28,7 @@ class HelpChannel : public Module { User *u = finduser(param); - if (u && c->ci->AccessFor(u).HasPriv(CA_OPDEOPME)) + if (u && c->ci->AccessFor(u).HasPriv("OPDEOPME")) u->SetMode(findbot(Config->OperServ), UMODE_HELPOP); } diff --git a/modules/extra/m_statusupdate.cpp b/modules/extra/m_statusupdate.cpp index 6f98c1345..8fff6e4c3 100644 --- a/modules/extra/m_statusupdate.cpp +++ b/modules/extra/m_statusupdate.cpp @@ -9,15 +9,15 @@ static struct ModeInfo { - ChannelAccess priv; + Anope::string priv; ChannelModeName name; } modeInfo[] = { - { CA_AUTOOWNER, CMODE_OWNER }, - { CA_AUTOPROTECT, CMODE_PROTECT }, - { CA_AUTOOP, CMODE_OP }, - { CA_AUTOHALFOP, CMODE_HALFOP }, - { CA_AUTOVOICE, CMODE_VOICE }, - { CA_SIZE, CMODE_END } + { "AUTOOWNER", CMODE_OWNER }, + { "AUTOPROTECT", CMODE_PROTECT }, + { "AUTOOP", CMODE_OP }, + { "AUTOHALFOP", CMODE_HALFOP }, + { "AUTOVOICE", CMODE_VOICE }, + { "", CMODE_END } }; class StatusUpdate : public Module @@ -40,7 +40,7 @@ class StatusUpdate : public Module if (access->Matches(user, user->Account())) { - for (int i = 0; modeInfo[i].priv != CA_SIZE; ++i) + for (int i = 0; !modeInfo[i].priv.empty(); ++i) if (!access->HasPriv(modeInfo[i].priv)) ci->c->RemoveMode(NULL, modeInfo[i].name, user->nick); chan_set_correct_modes(user, ci->c, 1); @@ -57,7 +57,7 @@ class StatusUpdate : public Module if (access->Matches(user, user->Account())) { - for (int i = 0; modeInfo[i].priv != CA_SIZE; ++i) + for (int i = 0; !modeInfo[i].priv.empty(); ++i) if (access->HasPriv(modeInfo[i].priv)) ci->c->RemoveMode(NULL, modeInfo[i].name, user->nick); } |
