/[svn]/ircd-hybrid/modules/m_user.c
ViewVC logotype

Annotation of /ircd-hybrid/modules/m_user.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 502 - (hide annotations)
Fri Mar 3 19:49:25 2006 UTC (15 years, 3 months ago) by michael
File MIME type: text/x-chdr
File size: 2871 byte(s)
- Implemented CAP command handler based uppon ircu's m_cap()
- Added somewhat outdated draft-mitchell-irc-capabilities-01.txt until
  I get the latest version from kev.
- Added "multi-prefix" cap so clients supporting "multi-prefix"
  may recieve multi prefixed NAMES replies, e.g. @%+nick1 @+nick2 ..
- Fixed "make clean" for src/conf/

1 adx 30 /*
2     * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd).
3     * m_user.c: Sends username information.
4     *
5     * Copyright (C) 2002 by the past and present ircd coders, and others.
6     *
7     * This program is free software; you can redistribute it and/or modify
8     * it under the terms of the GNU General Public License as published by
9     * the Free Software Foundation; either version 2 of the License, or
10     * (at your option) any later version.
11     *
12     * This program is distributed in the hope that it will be useful,
13     * but WITHOUT ANY WARRANTY; without even the implied warranty of
14     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15     * GNU General Public License for more details.
16     *
17     * You should have received a copy of the GNU General Public License
18     * along with this program; if not, write to the Free Software
19     * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20     * USA
21     *
22 knight 31 * $Id$
23 adx 30 */
24    
25     #include "stdinc.h"
26     #include "handlers.h"
27     #include "client.h"
28     #include "ircd.h"
29     #include "numeric.h"
30 db 126 #include "s_conf.h"
31 adx 30 #include "s_user.h"
32     #include "send.h"
33     #include "s_conf.h"
34     #include "msg.h"
35     #include "parse.h"
36 db 470 #include "conf/modules.h"
37 adx 30
38 michael 332 static void mr_user(struct Client*, struct Client*, int, char *[]);
39 adx 30
40     struct Message user_msgtab = {
41     "USER", 0, 0, 5, 0, MFLG_SLOW, 0L,
42 michael 332 { mr_user, m_registered, m_ignore, m_ignore, m_registered, m_ignore }
43 adx 30 };
44    
45 adx 442 INIT_MODULE(m_user, "$Revision$")
46 adx 30 {
47     mod_add_cmd(&user_msgtab);
48     }
49    
50 adx 442 CLEANUP_MODULE
51 adx 30 {
52     mod_del_cmd(&user_msgtab);
53     }
54    
55     /*
56     ** mr_user
57     ** parv[0] = sender prefix
58     ** parv[1] = username (login name, account)
59     ** parv[2] = client host name (used only from other servers)
60     ** parv[3] = server host name (used only from other servers)
61     ** parv[4] = users real name info
62     */
63     static void
64     mr_user(struct Client *client_p, struct Client *source_p,
65     int parc, char *parv[])
66     {
67 michael 458 char *p = NULL;
68 adx 30
69 michael 458 assert(source_p == client_p);
70    
71 adx 30 if ((p = strchr(parv[1],'@')) != NULL)
72     *p = '\0';
73    
74     if (*parv[4] == '\0')
75     {
76     sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS),
77     me.name, EmptyString(parv[0]) ? "*" : parv[0], "USER");
78     return;
79     }
80    
81 michael 332 if (!IsUnknown(source_p))
82     {
83     sendto_one(source_p, form_str(ERR_ALREADYREGISTRED),
84     me.name, parv[0]);
85     return;
86     }
87    
88 michael 502 source_p->localClient->registration &= ~REG_NEED_USER;
89 michael 332
90     /*
91     * don't take the clients word for it, ever
92     */
93     source_p->servptr = &me;
94    
95     strlcpy(source_p->info, parv[4], sizeof(source_p->info));
96    
97     if (!IsGotId(source_p))
98     {
99     /*
100     * save the username in the client
101     * If you move this you'll break ping cookies..you've been warned
102     */
103     strlcpy(source_p->username, parv[1], sizeof(source_p->username));
104     }
105    
106 michael 502 if (!source_p->localClient->registration)
107 michael 332 /* NICK already received, now I have USER... */
108 michael 458 register_local_user(source_p, parv[1]);
109 adx 30 }

Properties

Name Value
svn:eol-style native
svn:keywords Id Revision

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.28