added $.x.y fakhosts where $ gets replaced with the users auth handle
[srvx.git] / src / nickserv.c
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;
 }