summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/modules/m_invisible.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/modules/m_invisible.cpp b/src/modules/m_invisible.cpp
index e1fb88ca0..f30105ce2 100644
--- a/src/modules/m_invisible.cpp
+++ b/src/modules/m_invisible.cpp
@@ -83,9 +83,20 @@ class InvisibleMode : public ModeHandler
dest->SetMode('Q', adding);
+ /* Fix for bug #379 reported by stealth. On +/-Q make m_watch think the user has signed on/off */
+ Module* m = ServerInstance->FindModule("m_watch.so");
+
+ /* This must come before setting/unsetting the handler */
+ if (m && adding)
+ m->OnUserQuit(dest, "Connection closed", "Connection closed");
+
/* Set visibility handler object */
dest->Visibility = adding ? qo : NULL;
+ /* This has to come after setting/unsetting the handler */
+ if (m && !adding)
+ m->OnPostConnect(dest);
+
/* User appears to vanish or appear from nowhere */
for (UCListIter f = dest->chans.begin(); f != dest->chans.end(); f++)
{