[srvx-commits] CVS: services/src proto-p10.c,1.13,1.14
Brought to you by:
entrope
|
From: Zoot <zo...@us...> - 2002-08-08 02:50:05
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv21940/src
Modified Files:
proto-p10.c
Log Message:
Parse the ACCOUNT command so separate services instances can cooperate to some degree.
Index: proto-p10.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-p10.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** proto-p10.c 8 Aug 2002 02:15:58 -0000 1.13
--- proto-p10.c 8 Aug 2002 02:50:02 -0000 1.14
***************
*** 787,791 ****
user = AddUser(serv, argv[1], argv[4], argv[5], argv[6], argv[9], argv[10], (time_t)atoi(argv[3]), argv[8]);
! call_account_func(user, argv[7]);
} else {
AddUser(serv, argv[1], argv[4], argv[5], argv[6], argv[8], argv[9], (time_t)atoi(argv[3]), argv[7]);
--- 787,794 ----
user = AddUser(serv, argv[1], argv[4], argv[5], argv[6], argv[9], argv[10], (time_t)atoi(argv[3]), argv[8]);
! if(user)
! {
! call_account_func(user, argv[7]);
! }
} else {
AddUser(serv, argv[1], argv[4], argv[5], argv[6], argv[8], argv[9], (time_t)atoi(argv[3]), argv[7]);
***************
*** 798,801 ****
--- 801,827 ----
}
+ static CMD_FUNC(cmd_account)
+ {
+ struct userNode *user;
+
+ if (argc < 3) {
+ return 0;
+ }
+
+ if (!origin || !GetServerH(origin)) {
+ /* Protocol violation - ACCOUNT from user. */
+ return 0;
+ }
+
+ user = GetUserN(argv[1]);
+ if(!user) {
+ /* Ignore ACCOUNT for user that QUIT; probably crossed */
+ return 1;
+ }
+
+ call_account_func(user, argv[2]);
+ return 1;
+ }
+
static CMD_FUNC(cmd_burst)
{
***************
*** 1192,1195 ****
--- 1218,1223 ----
dict_insert(irc_func_dict, CMD_NICK, cmd_nick);
dict_insert(irc_func_dict, TOK_NICK, cmd_nick);
+ dict_insert(irc_func_dict, CMD_ACCOUNT, cmd_account);
+ dict_insert(irc_func_dict, TOK_ACCOUNT, cmd_account);
dict_insert(irc_func_dict, CMD_PASS, cmd_pass);
dict_insert(irc_func_dict, TOK_PASS, cmd_pass);
|