Browse Source

Updated 4th party mods: m_geoip_whois

Wazakindjes 3 years ago
parent
commit
e9f31f8a42
1 changed files with 10 additions and 2 deletions
  1. 10 2
      4thparty/m_geoip_whois.c

+ 10 - 2
4thparty/m_geoip_whois.c

@@ -72,7 +72,7 @@ int geoip_whois_configrun(ConfigFile *cf, ConfigEntry *ce, int type);
 
 ModuleHeader MOD_HEADER(m_geoip_whois) = {
 	"m_geoip_whois",
-	"$Id: v1.06 2018/12/16 k4be$",
+	"$Id: v1.07 2018/12/16 k4be$",
 	"add country info to /whois", 
 	"3.2-b8-1",
 	NULL 
@@ -166,12 +166,15 @@ int geoip_whois_configtest(ConfigFile *cf, ConfigEntry *ce, int type, int *errs)
 		}
 
 		if(!strcmp(cep->ce_varname, "display-name")) { // no value expected
+			display_anything = 1;
 			continue;
 		}
 		if(!strcmp(cep->ce_varname, "display-code")) {
+			display_anything = 1;
 			continue;
 		}
 		if(!strcmp(cep->ce_varname, "display-continent")) {
+			display_anything = 1;
 			continue;
 		}
 		
@@ -197,6 +200,11 @@ int geoip_whois_configtest(ConfigFile *cf, ConfigEntry *ce, int type, int *errs)
 		config_error("m_geoip_whois: no (correct) countries file specified.");
 		errors++;
 	}
+
+	if(!display_anything){
+		config_error("m_geoip_whois: configured not to display anything! Specify at least one of: display-name, display-code, display-continent.");
+		errors++;
+	}
 	
 	*errs = errors;
 	return errors ? -1 : 1; // Returning 1 means "all good", -1 means we shat our panties
@@ -744,8 +752,8 @@ MOD_LOAD(m_geoip_whois)
 			free_all();
 			return MOD_FAILED;
 		}
-		info_string = strdup("connected from ");
 	}
+	if(info_string == NULL) info_string = strdup("connected from ");
 	
 	list_for_each_entry(acptr, &client_list, client_node){
 		if (!IsPerson(acptr)) continue;