added $.x.y fakhosts where $ gets replaced with the users auth handle
authorpk910 <philipp@zoelle1.de>
Thu, 7 Jul 2011 21:04:36 +0000 (23:04 +0200)
committerpk910 <philipp@zoelle1.de>
Thu, 7 Jul 2011 21:04:36 +0000 (23:04 +0200)
src/chanserv.c
src/nickserv.c
src/proto-common.c

index 0b1eb400924602de690951a828110365a6ae77df..e160f620231427109ad6aa7c147de10a2ede7395 100644 (file)
@@ -3264,6 +3264,20 @@ eject_user(struct userNode *user, struct chanNode *channel, unsigned int argc, c
 
     offset = (action & ACTION_ADD_TIMED_BAN) ? 3 : 2;
     REQUIRE_PARAMS(offset);
+    if(argc > offset && IsNetServ(user))
+    {
+        if(*argv[offset] == '$') {
+            struct userNode *hib;
+            const char *accountnameb = argv[offset] + 1;
+            if(!(hib = GetUserH(accountnameb)))
+            {
+                reply("MSG_HANDLE_UNKNOWN", accountnameb);
+                return 0;
+            }
+            user=hib;
+            offset++;
+        }
+    }
     if(argc > offset)
     {
         reason = unsplit_string(argv + offset, argc - offset, NULL);
index 4ba42507876a34630242cff2f97f1ff6a6734a12..7911034cf6ffcc3e9f5d7a1691e8b498b91c076c 100644 (file)
@@ -891,6 +891,10 @@ generate_fakehost(struct handle_info *handle)
         /* A leading dot indicates the stored value is actually a title. */
         snprintf(buffer, sizeof(buffer), "%s.%s.%s", handle->handle, handle->fakehost+1, titlehost_suffix);
         return buffer;
+    } else if (handle->fakehost[0] == '$') {
+        /* A leading $ indicates the stored value begins with the user handle. */
+        snprintf(buffer, sizeof(buffer), "%s%s", handle->handle, handle->fakehost+1);
+        return buffer;
     }
     return handle->fakehost;
 }
@@ -1659,6 +1663,7 @@ static NICKSERV_FUNC(cmd_rename_handle)
     reply("NSMSG_HANDLE_CHANGED", old_handle, hi->handle);
     global_message(MESSAGE_RECIPIENT_STAFF, msgbuf);
     free(old_handle);
+    apply_fakehost(hi);
     return 1;
 }
 
index e71bacd6959323c24896f048f382338c66d6f8a0..a7c159a18f989449eba731cec2dedf2b6eb1ba19 100644 (file)
@@ -757,7 +757,12 @@ generate_hostmask(struct userNode *user, int options)
     }
     hostname = user->hostname;
     if (IsFakeHost(user) && IsHiddenHost(user) && !(options & GENMASK_NO_HIDING)) {
-        hostname = user->fakehost;
+        if(user->fakehost && user->fakehost[0] == "$") {
+            hostname = alloca(strlen(user->handle_info->handle) + strlen(user->fakehost));
+            sprintf(hostname, "%s%s", user->handle_info->handle, user->fakehost+1);
+        } else {
+            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);