+class InvisibleWatcher : public ModeWatcher
+{
+ unsigned int& invisible;
+public:
+ InvisibleWatcher(Module* mod, unsigned int& Invisible)
+ : ModeWatcher(mod, 'i', MODETYPE_USER), invisible(Invisible)
+ {
+ }
+
+ void AfterMode(User* source, User* dest, Channel* channel, const std::string& parameter, bool adding, ModeType type)
+ {
+ if (dest->registered != REG_ALL)
+ return;
+
+ if (adding)
+ invisible++;
+ else
+ invisible--;
+ }
+};
+