]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Remove virtual User::GetClass() (but keep LocalUser::GetClass())
authorattilamolnar <attilamolnar@hush.com>
Fri, 9 Aug 2013 16:28:11 +0000 (18:28 +0200)
committerattilamolnar <attilamolnar@hush.com>
Fri, 9 Aug 2013 16:28:11 +0000 (18:28 +0200)
include/users.h
src/commands/cmd_motd.cpp
src/commands/cmd_rules.cpp
src/users.cpp

index 73f1334d2b54cf25db3853fcf7ce8fd75802d36f..aaf9b5cda3b22d9de0696c51c8aff10957f6cb75 100644 (file)
@@ -635,11 +635,6 @@ class CoreExport User : public Extensible
         */
        void PurgeEmptyChannels();
 
-       /** Get the connect class which this user belongs to. NULL for remote users.
-        * @return A pointer to this user's connect class.
-        */
-       virtual ConnectClass* GetClass();
-
        /** Default destructor
         */
        virtual ~User();
@@ -702,7 +697,10 @@ class CoreExport LocalUser : public User, public InviteBase
         */
        reference<ConnectClass> MyClass;
 
-       ConnectClass* GetClass();
+       /** Get the connect class which this user belongs to.
+        * @return A pointer to this user's connect class.
+        */
+       ConnectClass* GetClass() const { return MyClass; }
 
        /** Call this method to find the matching \<connect> for a user, and to check them against it.
         */
index 8e227723ee57f0bcca916fd1f66e85a4a6dcb241..b28e57b2f018d2641f15bdc7070aaed264b50c3a 100644 (file)
@@ -54,8 +54,9 @@ CmdResult CommandMotd::Handle (const std::vector<std::string>& parameters, User
                return CMD_SUCCESS;
 
        ConfigTag* tag = NULL;
-       if (IS_LOCAL(user))
-               tag = user->GetClass()->config;
+       LocalUser* localuser = IS_LOCAL(user);
+       if (localuser)
+               tag = localuser->GetClass()->config;
        std::string motd_name = tag->getString("motd", "motd");
        ConfigFileCache::iterator motd = ServerInstance->Config->Files.find(motd_name);
        if (motd == ServerInstance->Config->Files.end())
index 5d41aa4b8db8e335cc97675d07e41dd59277dba7..76ee0061bccebdaf166e063a59af5060adcacdd1 100644 (file)
@@ -52,8 +52,9 @@ CmdResult CommandRules::Handle (const std::vector<std::string>& parameters, User
                return CMD_SUCCESS;
 
        ConfigTag* tag = NULL;
-       if (IS_LOCAL(user))
-               tag = user->GetClass()->config;
+       LocalUser* localuser = IS_LOCAL(user);
+       if (localuser)
+               tag = localuser->GetClass()->config;
        std::string rules_name = tag->getString("rules", "rules");
        ConfigFileCache::iterator rules = ServerInstance->Config->Files.find(rules_name);
        if (rules == ServerInstance->Config->Files.end())
index 3bc19632153840dd9aebdd2b703c2eeefe843cdd..b49587b389935f2042aa810fa348ebeac0e87af6 100644 (file)
@@ -1278,21 +1278,6 @@ void LocalUser::SetClass(const std::string &explicit_name)
        }
 }
 
-/* looks up a users password for their connection class (<ALLOW>/<DENY> tags)
- * NOTE: If the <ALLOW> or <DENY> tag specifies an ip, and this user resolves,
- * then their ip will be taken as 'priority' anyway, so for example,
- * <connect allow="127.0.0.1"> will match joe!bloggs@localhost
- */
-ConnectClass* LocalUser::GetClass()
-{
-       return MyClass;
-}
-
-ConnectClass* User::GetClass()
-{
-       return NULL;
-}
-
 void User::PurgeEmptyChannels()
 {
        // firstly decrement the count on each channel