* | Inspire Internet Relay Chat Daemon |
* +------------------------------------+
*
- * InspIRCd: (C) 2002-2008 InspIRCd Development Team
+ * InspIRCd: (C) 2002-2009 InspIRCd Development Team
* See: http://www.inspircd.org/wiki/index.php/Credits
*
* This program is free but copyrighted software; see
* ---------------------------------------------------
*/
-/*
- by Chernov-Phoenix Alexey (Phoenix@RusNet) mailto:phoenix /email address separator/ pravmail.ru */
+/*
+ * Originally by Chernov-Phoenix Alexey (Phoenix@RusNet) mailto:phoenix /email address separator/ pravmail.ru
+ */
+
+/* $ModDesc: Gives opers cmode +y which provides a staff prefix. */
#include "inspircd.h"
if ((!ServerInstance->Modes->AddMode(opm)))
throw ModuleException("Could not add a new mode!");
- Implementation eventlist[] = { I_OnPostJoin, I_OnCleanup, I_OnUserQuit, I_OnUserKick, I_OnUserPart };
- ServerInstance->Modules->Attach(eventlist, this, 5);
+ Implementation eventlist[] = { I_OnPostJoin, I_OnCleanup, I_OnUserQuit, I_OnUserKick, I_OnUserPart, I_OnOper };
+ ServerInstance->Modules->Attach(eventlist, this, 6);
}
virtual void PushChanMode(Channel* channel, User* user, bool negate = false)
return 0;
}
+ virtual void OnOper(User *user, const std::string&)
+ {
+ if (user && IS_LOCAL(user) && !user->IsModeSet('H'))
+ {
+ for (UCListIter v = user->chans.begin(); v != user->chans.end(); v++)
+ {
+ PushChanMode(v->first, user);
+ }
+ }
+ }
+
virtual ~ModuleOperPrefixMode()
{
ServerInstance->Modes->DelMode(opm);
virtual Version GetVersion()
{
- return Version("$Id$", VF_COMMON, API_VERSION);
+ return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION);
}
};