ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/branches/8.2.x/modules/core/m_tmode.c
Revision: 5015
Committed: Tue Dec 9 17:53:37 2014 UTC (9 years, 3 months ago) by michael
Content type: text/x-csrc
File size: 2855 byte(s)
Log Message:
- Removed unused header includes:wq

File Contents

# Content
1 /*
2 * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
3 *
4 * Copyright (c) 1997-2014 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_tmode.c
23 * \brief Includes required functions for processing the TMODE command.
24 * \version $Id$
25 */
26
27 #include "stdinc.h"
28 #include "list.h"
29 #include "channel.h"
30 #include "channel_mode.h"
31 #include "client.h"
32 #include "hash.h"
33 #include "ircd.h"
34 #include "send.h"
35 #include "parse.h"
36 #include "modules.h"
37
38
39 /*! \brief TMODE 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] = timestamp
49 * - parv[2] = channel name
50 * - parv[3] = modes to be added or removed
51 */
52 static int
53 ms_tmode(struct Client *source_p, int parc, char *parv[])
54 {
55 struct Channel *chptr = NULL;
56
57 if ((chptr = hash_find_channel(parv[2])) == NULL)
58 {
59 sendto_one_numeric(source_p, &me, ERR_NOSUCHCHANNEL, parv[2]);
60 return 0;
61 }
62
63 if (atol(parv[1]) > chptr->creationtime)
64 return 0;
65
66 if (IsServer(source_p) || HasFlag(source_p, FLAGS_SERVICE))
67 set_channel_mode(source_p, chptr, NULL, parc - 3, parv + 3);
68 else
69 {
70 struct Membership *member = find_channel_link(source_p, chptr);
71
72 set_channel_mode(source_p, chptr, member, parc - 3, parv + 3);
73 }
74
75 return 0;
76 }
77
78 static struct Message tmode_msgtab =
79 {
80 "TMODE", NULL, 0, 0, 4, MAXPARA, MFLG_SLOW, 0,
81 { m_ignore, m_ignore, ms_tmode, m_ignore, m_ignore, m_ignore }
82 };
83
84 static void
85 module_init(void)
86 {
87 mod_add_cmd(&tmode_msgtab);
88 }
89
90 static void
91 module_exit(void)
92 {
93 mod_del_cmd(&tmode_msgtab);
94 }
95
96 struct module module_entry =
97 {
98 .node = { NULL, NULL, NULL },
99 .name = NULL,
100 .version = "$Revision$",
101 .handle = NULL,
102 .modinit = module_init,
103 .modexit = module_exit,
104 .flags = MODULE_FLAG_CORE
105 };

Properties

Name Value
svn:keywords Id Revision