ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/branches/8.2.x/modules/core/m_nick.c
(Generate patch)

Comparing ircd-hybrid-7.2/modules/core/m_nick.c (file contents):
Revision 981 by michael, Sun Aug 9 19:09:03 2009 UTC vs.
Revision 1002 by michael, Sat Aug 29 22:48:40 2009 UTC

# Line 96 | Line 96 | const char *_version = "$Revision$";
96   #endif
97  
98  
99 + /* set_initial_nick()
100 + *
101 + * inputs
102 + * output
103 + * side effects -
104 + *
105 + * This function is only called to set up an initially registering
106 + * client.
107 + */
108 + static void
109 + set_initial_nick(struct Client *client_p, struct Client *source_p,
110 +                 const char *nick)
111 + {
112 + char buf[USERLEN + 1];
113 +
114 +  /* Client setting NICK the first time */
115 +
116 +  /* This had to be copied here to avoid problems.. */
117 +  source_p->tsinfo = CurrentTime;
118 +  source_p->localClient->registration &= ~REG_NEED_NICK;
119 +
120 +  if (source_p->name[0])
121 +    hash_del_client(source_p);
122 +
123 +  strlcpy(source_p->name, nick, sizeof(source_p->name));
124 +  hash_add_client(source_p);
125 +
126 +  /* fd_desc is long enough */
127 +  fd_note(&client_p->localClient->fd, "Nick: %s", nick);
128 +
129 +  if (!source_p->localClient->registration)
130 +  {
131 +    strlcpy(buf, source_p->username, sizeof(buf));
132 +
133 +    /*
134 +     * USER already received, now we have NICK.
135 +     * *NOTE* For servers "NICK" *must* precede the
136 +     * user message (giving USER before NICK is possible
137 +     * only for local client connection!). register_user
138 +     * may reject the client and call exit_client for it
139 +     * --must test this and exit m_nick too!!!
140 +     */
141 +    register_local_user(client_p, source_p, nick, buf);
142 +  }
143 + }
144 +
145   /*! \brief NICK command handler (called by unregistered,
146   *         locally connected clients)
147   *

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines