]> jfr.im git - irc/evilnet/x3.git/blobdiff - src/proto-common.c
more python work. Not safe to run yet
[irc/evilnet/x3.git] / src / proto-common.c
index ae23a20a463651c66351efa867116c661890036a..f9b30e7eda29cd3b2b1906599e36904b934ed0c8 100644 (file)
@@ -5,7 +5,7 @@
  *
  * x3 is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
@@ -834,9 +834,20 @@ generate_hostmask(struct userNode *user, int options)
     hostname = user->hostname;
     if (IsFakeHost(user) && IsHiddenHost(user) && !(options & GENMASK_NO_HIDING)) {
         hostname = user->fakehost;
-    } else if (IsHiddenHost(user) && user->handle_info && hidden_host_suffix && !(options & GENMASK_NO_HIDING)) {
-        hostname = alloca(strlen(user->handle_info->handle) + strlen(hidden_host_suffix) + 2);
-        sprintf(hostname, "%s.%s", user->handle_info->handle, hidden_host_suffix);
+    } else if (IsHiddenHost(user)) {
+        int style = 1;
+        char *data;
+        data = conf_get_data("server/hidden_host_type", RECDB_QSTRING);
+        if (data)
+            style = atoi(data);
+
+        if ((style == 1) && user->handle_info && hidden_host_suffix && !(options & GENMASK_NO_HIDING)) {
+            hostname = alloca(strlen(user->handle_info->handle) + strlen(hidden_host_suffix) + 2);
+            sprintf(hostname, "%s.%s", user->handle_info->handle, hidden_host_suffix);
+        } else if ((style == 2) && !(options & GENMASK_NO_HIDING)) {
+            hostname = alloca(strlen(user->crypthost));
+            sprintf(hostname, "%s", user->crypthost);
+        }
     } else if (options & GENMASK_STRICT_HOST) {
         if (options & GENMASK_BYIP)
             hostname = (char*)irc_ntoa(&user->ip);