[srvx-commits] CVS: services/src hash.c,1.169,1.170 hash.h,1.97,1.98 nickserv.c,1.222,1.223 proto-p1
Brought to you by:
entrope
|
From: Entrope <en...@us...> - 2003-01-06 01:53:04
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv25181/src
Modified Files:
hash.c hash.h nickserv.c proto-p10.c
Log Message:
call account_func callback before calling new_user_func callback
Index: hash.c
===================================================================
RCS file: /cvsroot/srvx/services/src/hash.c,v
retrieving revision 1.169
retrieving revision 1.170
diff -C2 -r1.169 -r1.170
*** hash.c 2 Jan 2003 23:11:34 -0000 1.169
--- hash.c 6 Jan 2003 01:53:01 -0000 1.170
***************
*** 206,210 ****
}
! static account_func_t account_func = NULL;
void
--- 206,210 ----
}
! static account_func_t account_func;
void
***************
*** 218,222 ****
void
! call_account_func(struct userNode *user, char *stamp)
{
/* We've received an account stamp for a user; notify
--- 218,222 ----
void
! call_account_func(struct userNode *user, const char *stamp)
{
/* We've received an account stamp for a user; notify
***************
*** 224,228 ****
right now.
! (P10 Protocol violation if (user->modes & FLAGS_STAMPED here.)
*/
if(account_func)
--- 224,228 ----
right now.
! P10 Protocol violation if (user->modes & FLAGS_STAMPED here.)
*/
if(account_func)
***************
*** 238,250 ****
void
! StampUser(struct userNode *user, char *stamp)
{
#ifdef WITH_PROTOCOL_P10
/* The P10 protocol says we can't stamp users who already
have a stamp. */
! if(user->modes & FLAGS_STAMPED)
! {
! return;
! }
#endif
--- 238,247 ----
void
! StampUser(struct userNode *user, const char *stamp)
{
#ifdef WITH_PROTOCOL_P10
/* The P10 protocol says we can't stamp users who already
have a stamp. */
! if(IsStamped(user)) return;
#endif
Index: hash.h
===================================================================
RCS file: /cvsroot/srvx/services/src/hash.h,v
retrieving revision 1.97
retrieving revision 1.98
diff -C2 -r1.97 -r1.98
*** hash.h 15 Dec 2002 09:59:38 -0000 1.97
--- hash.h 6 Jan 2003 01:53:01 -0000 1.98
***************
*** 200,207 ****
void NickChange(struct userNode* user, const char *new_nick, int no_announce);
! typedef void (*account_func_t) (struct userNode *user, char *stamp);
void reg_account_func(account_func_t handler);
! void call_account_func(struct userNode *user, char *stamp);
! void StampUser(struct userNode *user, char *stamp);
typedef void (*new_channel_func_t) (struct chanNode *chan);
--- 200,207 ----
void NickChange(struct userNode* user, const char *new_nick, int no_announce);
! typedef void (*account_func_t) (struct userNode *user, const char *stamp);
void reg_account_func(account_func_t handler);
! void call_account_func(struct userNode *user, const char *stamp);
! void StampUser(struct userNode *user, const char *stamp);
typedef void (*new_channel_func_t) (struct chanNode *chan);
Index: nickserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.c,v
retrieving revision 1.222
retrieving revision 1.223
diff -C2 -r1.222 -r1.223
*** nickserv.c 4 Jan 2003 05:32:58 -0000 1.222
--- nickserv.c 6 Jan 2003 01:53:01 -0000 1.223
***************
*** 3231,3235 ****
void
! handle_account(struct userNode *user, char *stamp)
{
struct handle_info *hi;
--- 3231,3235 ----
void
! handle_account(struct userNode *user, const char *stamp)
{
struct handle_info *hi;
Index: proto-p10.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-p10.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -C2 -r1.55 -r1.56
*** proto-p10.c 4 Jan 2003 06:25:20 -0000 1.55
--- proto-p10.c 6 Jan 2003 01:53:01 -0000 1.56
***************
*** 285,289 ****
static struct dict *unbursted_channels;
! static struct userNode *AddUser(struct server* uplink, const char *nick, const char *ident, const char *hostname, const char *modes, const char *numeric, const char *userinfo, time_t timestamp, const char *realip);
/* Numerics can be XYY, XYYY, or XXYYY; with X's identifying the
--- 285,289 ----
static struct dict *unbursted_channels;
! static struct userNode *AddUser(struct server* uplink, const char *nick, const char *ident, const char *hostname, const char *modes, const char *account, const char *numeric, const char *userinfo, time_t timestamp, const char *realip);
/* Numerics can be XYY, XYYY, or XXYYY; with X's identifying the
***************
*** 910,920 ****
if (argc > 10) {
/* The user is +r and has an ACCOUNT stamp in argv[7]. */
! user = AddUser(serv, argv[1], argv[4], argv[5], argv[6], argv[9], argv[argc-1], 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[argc-1], atoi(argv[3]), argv[7]);
}
} else {
! AddUser(serv, argv[1], argv[4], argv[5], "+", argv[7], argv[argc-1], atoi(argv[3]), argv[6]);
}
}
--- 910,919 ----
if (argc > 10) {
/* The user is +r and has an ACCOUNT stamp in argv[7]. */
! AddUser(serv, argv[1], argv[4], argv[5], argv[6], argv[7], argv[9], argv[argc-1], atoi(argv[3]), argv[8]);
} else {
! AddUser(serv, argv[1], argv[4], argv[5], argv[6], NULL, argv[8], argv[argc-1], atoi(argv[3]), argv[7]);
}
} else {
! AddUser(serv, argv[1], argv[4], argv[5], "+", NULL, argv[7], argv[argc-1], atoi(argv[3]), argv[6]);
}
}
***************
*** 926,944 ****
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;
--- 925,932 ----
struct userNode *user;
! if (argc < 3) return 0;
! if (!origin || !GetServerH(origin)) return 0; /* Origin must be server. */
user = GetUserN(argv[1]);
! if (!user) return 1; /* A QUIT probably passed the ACCOUNT. */
call_account_func(user, argv[2]);
return 1;
***************
*** 1722,1726 ****
}
make_numeric(self, local_num, numeric);
! return AddUser(self, nick, nick, self->name, "+oik", numeric, desc, now, "AAAAAA");
}
--- 1710,1714 ----
}
make_numeric(self, local_num, numeric);
! return AddUser(self, nick, nick, self->name, "+oik", NULL, numeric, desc, now, "AAAAAA");
}
***************
*** 1736,1740 ****
}
make_numeric(self, local_num, numeric);
! return AddUser(self, nick, ident, hostname, "+i", numeric, desc, now, "AAAAAA");
}
--- 1724,1728 ----
}
make_numeric(self, local_num, numeric);
! return AddUser(self, nick, ident, hostname, "+i", NULL, numeric, desc, now, "AAAAAA");
}
***************
*** 1752,1756 ****
static struct userNode*
! AddUser(struct server* uplink, const char *nick, const char *ident, const char *hostname, const char *modes, const char *numeric, const char *userinfo, time_t timestamp, const char *realip)
{
struct userNode *oldUser, *uNode;
--- 1740,1744 ----
static struct userNode*
! AddUser(struct server* uplink, const char *nick, const char *ident, const char *hostname, const char *modes, const char *account, const char *numeric, const char *userinfo, time_t timestamp, const char *realip)
{
struct userNode *oldUser, *uNode;
***************
*** 1796,1799 ****
--- 1784,1788 ----
uNode->num_local = base64toint(numeric+strlen(uNode->uplink->numeric), 3) & uNode->uplink->num_mask;
uNode->uplink->users[uNode->num_local] = uNode;
+ if (account) call_account_func(uNode, account);
if ((oldUser = GetUserH(nick))) {
|