]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_chanprotect.cpp
Changed so that when the first in the channel gets founder, the +q mode change is...
[user/henk/code/inspircd.git] / src / modules / m_chanprotect.cpp
index 6314cca945e44297df7d745ae1235501e682c77b..8cf91d45cda6e1fcd5c527e27a480bb1633ba1a9 100644 (file)
@@ -24,7 +24,7 @@ using namespace std;
 
 /* $ModDesc: Provides channel modes +a and +q */
 
-char dummyvalue[] = "on";
+char fakevalue[] = "on";
 
 class ModuleChanProtect : public Module
 {
@@ -107,7 +107,12 @@ class ModuleChanProtect : public Module
                                // this way is best as it adds data thats accessible to other modules
                                // (so long as you document your code properly) without breaking anything
                                // because its encapsulated neatly in a map.
-                               if (user->Extend("cm_founder_"+std::string(channel->name),dummyvalue))
+
+                               // Change requested by katsklaw... when the first in is set to get founder,
+                               // to make it clearer that +q has been given, send that one user the +q notice
+                               // so that their client's syncronization and their sanity are left intact.
+                               WriteServ(user->fd,"MODE %s +q %s",channel->name,user->nick);
+                               if (user->Extend("cm_founder_"+std::string(channel->name),fakevalue))
                                {
                                        Srv->Log(DEBUG,"Marked user "+std::string(user->nick)+" as founder for "+std::string(channel->name));
                                }
@@ -222,7 +227,7 @@ class ModuleChanProtect : public Module
                                {
                                        if (!theuser->GetExt("cm_founder_"+std::string(chan->name)))
                                        {
-                                               theuser->Extend("cm_founder_"+std::string(chan->name),dummyvalue);
+                                               theuser->Extend("cm_founder_"+std::string(chan->name),fakevalue);
                                                return 1;
                                        }
                                }
@@ -265,7 +270,7 @@ class ModuleChanProtect : public Module
                                {
                                        if (!theuser->GetExt("cm_protect_"+std::string(chan->name)))
                                        {
-                                               theuser->Extend("cm_protect_"+std::string(chan->name),dummyvalue);
+                                               theuser->Extend("cm_protect_"+std::string(chan->name),fakevalue);
                                                return 1;
                                        }
                                }