+
+ void Handle (const char** parameters, int pcnt, userrec *user)
+ {
+ std::string line = "*** GLOBOPS - From " + std::string(user->nick) + ": ";
+ for (int i = 0; i < pcnt; i++)
+ {
+ line = line + std::string(parameters[i]) + " ";
+ }
+ ServerInstance->WriteMode("og",WM_AND,line.c_str());
+ }
+};
+
+class ModeGlobops : public ModeHandler
+{
+ public:
+ ModeGlobops(InspIRCd* Instance) : ModeHandler(Instance, 'g', 0, 0, false, MODETYPE_USER, true) { }
+
+ ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding)
+ {
+ if (adding)
+ {
+ if (!dest->IsModeSet('g'))
+ {
+ dest->SetMode('P',true);
+ return MODEACTION_ALLOW;
+ }
+ }
+ else
+ {
+ if (dest->IsModeSet('g'))
+ {
+ dest->SetMode('P',false);
+ return MODEACTION_ALLOW;
+ }
+ }
+
+ return MODEACTION_DENY;
+ }
+};