]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_geoip.cpp
Change httpd modules to use the MODNAME constant in headers.
[user/henk/code/inspircd.git] / src / modules / extra / m_geoip.cpp
index 7696146e8466443459b986590c3be7d3f27c4f7f..fffadcd324e9a4338a915eb8d05647885e0fe169 100644 (file)
@@ -27,7 +27,6 @@
 # pragma comment(lib, "GeoIP.lib")
 #endif
 
-/* $ModDesc: Provides a way to restrict users by country using GeoIP lookup */
 /* $LinkerFlags: -lGeoIP */
 
 class ModuleGeoIP : public Module
@@ -35,7 +34,7 @@ class ModuleGeoIP : public Module
        LocalStringExt ext;
        GeoIP* gi;
 
-       void SetExt(LocalUser* user)
+       std::string* SetExt(LocalUser* user)
        {
                const char* c = GeoIP_country_code_by_addr(gi, user->GetIPString().c_str());
                if (!c)
@@ -43,6 +42,7 @@ class ModuleGeoIP : public Module
 
                std::string* cc = new std::string(c);
                ext.set(user, cc);
+               return cc;
        }
 
  public:
@@ -85,7 +85,7 @@ class ModuleGeoIP : public Module
        {
                std::string* cc = ext.get(user);
                if (!cc)
-                       SetExt(user);
+                       cc = SetExt(user);
 
                std::string geoip = myclass->config->getString("geoip");
                if (geoip.empty())