[srvx-commits] CVS: services/src proto-p10.c,1.18,1.19
Brought to you by:
entrope
|
From: Zoot <zo...@us...> - 2002-08-14 01:48:14
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv5865/src
Modified Files:
proto-p10.c
Log Message:
Support the P10 OPMODE command; note that it reports the origin to the mode-change hooks.
Index: proto-p10.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-p10.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** proto-p10.c 14 Aug 2002 01:36:12 -0000 1.18
--- proto-p10.c 14 Aug 2002 01:48:11 -0000 1.19
***************
*** 1110,1113 ****
--- 1110,1140 ----
}
+ static CMD_FUNC(cmd_opmode)
+ {
+ struct chanNode *cn;
+ struct userNode *un;
+ const char *modes;
+
+ if (argc < 3) {
+ return 0;
+ }
+ if (!IsChannelName(argv[1])) {
+ log(MAIN_LOG, LOG_ERROR, "Received OPMODE for non-channel %s.\n", argv[1]);
+ return 0;
+ }
+
+ if (!(cn = GetChannel(argv[1]))) {
+ log(MAIN_LOG, LOG_ERROR, "Unable to find channel %s whose mode is changing\n", argv[1]);
+ return 0;
+ }
+ if (!(un = GetUserH(origin))) {
+ log(MAIN_LOG, LOG_ERROR, "Unable to find user %s requesting OPMODE.\n", origin);
+ return 0;
+ }
+
+ modes = unsplit_string(argv + 2, argc - 2, NULL);
+ return mod_chanmode(cn, un, modes, NULL, 0);
+ }
+
static CMD_FUNC(cmd_topic)
{
***************
*** 1385,1388 ****
--- 1412,1418 ----
dict_insert(irc_func_dict, CMD_GLINE, cmd_gline);
dict_insert(irc_func_dict, TOK_GLINE, cmd_gline);
+ dict_insert(irc_func_dict, CMD_OPMODE, cmd_opmode);
+ dict_insert(irc_func_dict, TOK_OPMODE, cmd_opmode);
+
/* In P10, DESTRUCT doesn't do anything except be broadcast to servers.
* Apparently to obliterate channels from any servers that think they
|