Fix Doxygen comment typo; clarify username handling.
authorMichael Poole <mdpoole@troilus.org>
Thu, 31 Mar 2005 04:05:56 +0000 (04:05 +0000)
committerMichael Poole <mdpoole@troilus.org>
Thu, 31 Mar 2005 04:05:56 +0000 (04:05 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1346 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
include/client.h
include/struct.h
ircd/ircd_res.c
ircd/s_misc.c

index 26eb3a64ab340c5a64973a8fee84bed5d5e0cda5..2a80a7721c5ebb5f5e280b7437e48ee64cd06ded 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2005-03-30  Michael Poole <mdpoole@troilus.org>
+
+       * include/client.h (struct Client): Explain where cli_username
+       comes from.
+
+       * include/struct.h (struct User): Explain where this username
+       comes from, too
+
+       * ircd/ircd_res.c (timeout_resolver): Update parameter name in
+       Doxygen comment, too.
+
+       * ircd/s_misc.c (get_client_name): Reorganize to have less
+       indentation and behave like 2.10.11 when client is not idented.
+
 2005-03-29  Michael Poole <mdpoole@troilus.org>
 
        * doc/example.conf: Remove no-longer-used HIS_STATS_h.
index 7b4179f65bac182c178fd307b4ccaa91564de22f..f6c2244d4fe93a22f9ac90cfac6f3db29b9adbcd 100644 (file)
@@ -262,7 +262,7 @@ struct Client {
   struct irc_in_addr cli_ip;      /**< Real IP of client */
   short          cli_status;      /**< Client type */
   char cli_name[HOSTLEN + 1];     /**< Unique name of the client, nick or host */
-  char cli_username[USERLEN + 1]; /**< username here now for auth stuff */
+  char cli_username[USERLEN + 1]; /**< Username determined by ident lookup */
   char cli_info[REALLEN + 1];     /**< Free form additional client information */
 };
 
index fcbf74bcfa93928e4937aae2991218c1efb4c29e..b7041669c0669fe655d6fa8e311cb371d6d09a9e 100644 (file)
@@ -73,7 +73,12 @@ struct User {
   unsigned int       refcnt;         /**< Number of times this block is referenced */
   unsigned int       joined;         /**< number of channels joined */
   unsigned int       invites;        /**< Number of channels we've been invited to */
-  char               username[USERLEN + 1];   /**< remote account name */
+  /** Remote account name.  Before registration is complete, this is
+   * either empty or contains the username from the USER command.
+   * After registration, that may be prefixed with ~ or it may be
+   * overwritten with the ident response.
+   */
+  char               username[USERLEN + 1];
   char               host[HOSTLEN + 1];       /**< displayed hostname */
   char               realhost[HOSTLEN + 1];   /**< actual hostname */
   char               account[ACCOUNTLEN + 1]; /**< IRC account name */
index eab072bb9597b08b8522ca9e4c2f785e362059a1..f91fdc5933c8b74cb65a10e9075b58428c5f538a 100644 (file)
@@ -289,7 +289,7 @@ check_resolver_timeout(time_t when)
 }
 
 /** Drop pending DNS lookups which have timed out.
- * @param[in] notused Timer event data (ignored).
+ * @param[in] ev Timer event data (ignored).
  */
 static void
 timeout_resolver(struct Event *ev)
index 4021bccd55ad16ab08a2021e8d03bcb7c823efd6..a55c974a3847c1c6dc893ccb430d1f5ebda8bdeb 100644 (file)
@@ -164,16 +164,12 @@ const char* get_client_name(const struct Client* sptr, int showip)
 {
   static char nbuf[HOSTLEN * 2 + USERLEN + 5];
 
-  if (MyConnect(sptr)) {
-    if (showip)
-      ircd_snprintf(0, nbuf, sizeof(nbuf), "%s[%s@%s]", cli_name(sptr),
-                    IsIdented(sptr) ? cli_username(sptr) : "unknown",
-                    cli_sock_ip(sptr));
-    else
-        return cli_name(sptr);
-    return nbuf;
-  }
-  return cli_name(sptr);
+  if (!MyConnect(sptr) || !showip)
+    return cli_name(sptr);
+  ircd_snprintf(0, nbuf, sizeof(nbuf), "%s[%s@%s]", cli_name(sptr),
+                IsIdented(sptr) ? cli_username(sptr) : "",
+                cli_sock_ip(sptr));
+  return nbuf;
 }
 
 /** Set cli_sockhost(cptr) from \a host.