]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Use FindMode instead of FindPrefix for OnUserPreJoin privs; makes it possible to...
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 13 Sep 2009 20:31:45 +0000 (20:31 +0000)
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 13 Sep 2009 20:31:45 +0000 (20:31 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11702 e03df62e-2008-0410-955e-edbf42e46eb7

include/modules.h
src/channels.cpp
src/modules/m_chanprotect.cpp
src/modules/m_ojoin.cpp

index 9c8fa395a4d7c77d1943f5c6edc9e37c7ae93f27..81381ab8bb6dc4408af417efaf2402a9c32a25f8 100644 (file)
@@ -568,7 +568,7 @@ class CoreExport Module : public Extensible
         * @param user The user joining the channel
         * @param chan If the  channel is a new channel, this will be NULL, otherwise it will be a pointer to the channel being joined
         * @param cname The channel name being joined. For new channels this is valid where chan is not.
-        * @param privs A string containing the users privilages when joining the channel. For new channels this will contain "@".
+        * @param privs A string containing the users privilages when joining the channel. For new channels this will contain "o".
         * You may alter this string to alter the user's modes on the channel.
         * @param keygiven The key given to join the channel, or an empty string if none was provided
         * @return 1 To prevent the join, 0 to allow it.
index 9489e57baedc2e0cc93475fbba1952a0724c61a6..3685f66046c83f00477c21281db6692eefc67ea3 100644 (file)
@@ -240,7 +240,7 @@ Channel* Channel::JoinUser(InspIRCd* Instance, User *user, const char* cn, bool
                }
                else
                {
-                       privs = "@";
+                       privs = "o";
                        created_by_local = true;
                }
 
@@ -347,7 +347,7 @@ Channel* Channel::ForceChan(InspIRCd* Instance, Channel* Ptr, User* user, const
        for (std::string::const_iterator x = privs.begin(); x != privs.end(); x++)
        {
                const char status = *x;
-               ModeHandler* mh = Instance->Modes->FindPrefix(status);
+               ModeHandler* mh = Instance->Modes->FindMode(status, MODETYPE_CHANNEL);
                if (mh)
                {
                        /* Set, and make sure that the mode handler knows this mode was now set */
index fd121edcf83a4b2112cb5ac77ad41a8f8a04941c..56d107c7155ccdc02e3878c277d3a95d49244067 100644 (file)
@@ -343,7 +343,7 @@ class ModuleChanProtect : public Module
                // the config option for it is set
 
                if (FirstInGetsFounder && !chan)
-                       privs += std::string(1, QPrefix);
+                       privs += 'q';
 
                return MOD_RES_PASSTHRU;
        }
index 63be08a0fb562e257092cf2ee75beea048fffc94..a5b4b6ffb4383e3464356dc83ebd8c3fe8283c37 100644 (file)
@@ -67,16 +67,6 @@ class CommandOjoin : public Command
                {
                        ServerInstance->SNO->WriteGlobalSno('a', std::string(user->nick)+" used OJOIN to join "+channel->name);
 
-                       if (!NPrefix)
-                       {
-                               std::vector<std::string> modes;
-                               modes.push_back(parameters[0]);
-                               modes.push_back("+Y");
-                               modes.push_back(user->nick);
-                               ServerInstance->SendMode(modes, ServerInstance->FakeClient);
-                               ServerInstance->PI->SendMode(channel->name, ServerInstance->Modes->GetLastParseParams(), ServerInstance->Modes->GetLastParseTranslate());
-                       }
-
                        if (notice)
                        {
                                channel = ServerInstance->FindChan(parameters[0]);