ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/modules/m_svsjoin.c
Revision: 5347
Committed: Sun Jan 11 12:42:20 2015 UTC (11 years, 8 months ago) by michael
Content type: text/x-csrc
File size: 3241 byte(s)
Log Message:
- Update copyright years

File Contents

# Content
1 /*
2 * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
3 *
4 * Copyright (c) 2014-2015 ircd-hybrid development team
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
19 * USA
20 */
21
22 /*! \file m_svsjoin.c
23 * \brief Includes required functions for processing the SVSJOIN command.
24 * \version $Id$
25 */
26
27 #include "stdinc.h"
28 #include "list.h"
29 #include "channel.h"
30 #include "client.h"
31 #include "hash.h"
32 #include "irc_string.h"
33 #include "ircd.h"
34 #include "send.h"
35 #include "parse.h"
36 #include "modules.h"
37
38
39 /*! \brief SVSJOIN command handler
40 *
41 * \param source_p Pointer to allocated Client struct from which the message
42 * originally comes from. This can be a local or remote client.
43 * \param parc Integer holding the number of supplied arguments.
44 * \param parv Argument vector where parv[0] .. parv[parc-1] are non-NULL
45 * pointers.
46 * \note Valid arguments for this command are:
47 * - parv[0] = command
48 * - parv[1] = nickname
49 * - parv[2] = channel
50 * - parv[3] = channel password (key)
51 */
52 static int
53 ms_svsjoin(struct Client *source_p, int parc, char *parv[])
54 {
55 struct Client *target_p = NULL;
56
57 if (!HasFlag(source_p, FLAGS_SERVICE))
58 return 0;
59
60 if (EmptyString(parv[2]))
61 return 0;
62
63 if ((target_p = find_person(source_p, parv[1])) == NULL)
64 return 0;
65
66 if (MyConnect(target_p))
67 {
68 channel_do_join(target_p, parv[2], parv[3]);
69 return 0;
70 }
71
72 if (target_p->from == source_p->from)
73 {
74 sendto_realops_flags(UMODE_DEBUG, L_ALL, SEND_NOTICE,
75 "Received wrong-direction SVSJOIN "
76 "for %s (behind %s) from %s",
77 target_p->name, source_p->from->name,
78 get_client_name(source_p, HIDE_IP));
79 return 0;
80 }
81
82 if (parc == 3)
83 sendto_one(target_p, ":%s SVSJOIN %s %s", source_p->id,
84 target_p->id, parv[2]);
85 else
86 sendto_one(target_p, ":%s SVSJOIN %s %s %s", source_p->id,
87 target_p->id, parv[2], parv[3]);
88 return 0;
89 }
90
91 static struct Message svsjoin_msgtab =
92 {
93 "SVSJOIN", NULL, 0, 0, 3, MAXPARA, MFLG_SLOW, 0,
94 { m_unregistered, m_ignore, ms_svsjoin, m_ignore, m_ignore, m_ignore }
95 };
96
97 static void
98 module_init(void)
99 {
100 mod_add_cmd(&svsjoin_msgtab);
101 }
102
103 static void
104 module_exit(void)
105 {
106 mod_del_cmd(&svsjoin_msgtab);
107 }
108
109 struct module module_entry =
110 {
111 .node = { NULL, NULL, NULL },
112 .name = NULL,
113 .version = "$Revision$",
114 .handle = NULL,
115 .modinit = module_init,
116 .modexit = module_exit,
117 .flags = 0
118 };

Properties

Name Value
svn:keywords Id Revision