[srvx-commits] CVS: services/src chanserv.c,1.232.2.10,1.232.2.11 hash.c,1.159.2.1,1.159.2.2 hash.h,
Brought to you by:
entrope
|
From: Entrope <en...@us...> - 2002-10-23 16:22:58
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv26453/src
Modified Files:
Tag: rel-1_1-branch
chanserv.c hash.c hash.h helpserv.c opserv.c
Log Message:
backport kick-on-join bug fix from 1.2 branch
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.232.2.10
retrieving revision 1.232.2.11
diff -C2 -r1.232.2.10 -r1.232.2.11
*** chanserv.c 21 Oct 2002 03:04:40 -0000 1.232.2.10
--- chanserv.c 23 Oct 2002 16:22:45 -0000 1.232.2.11
***************
*** 6227,6231 ****
/* welcome to my worst nightmare. warning: read the code below
at your own risk. */
! static void
handle_join(struct userNode *user, struct chanNode *channel)
{
--- 6227,6231 ----
/* welcome to my worst nightmare. warning: read the code below
at your own risk. */
! static int
handle_join(struct userNode *user, struct chanNode *channel)
{
***************
*** 6241,6258 ****
{
struct suspended *suspended = dict_find(sChannels, channel->name, NULL);
!
! if(!suspended)
! {
! return;
! }
!
channel->channel_info = suspended->cData;
suspended->cData->channel = channel;
}
!
! return;
}
! if(IsLocal(user) || IsSuspended(channel->channel_info)) return;
cData = channel->channel_info;
--- 6241,6252 ----
{
struct suspended *suspended = dict_find(sChannels, channel->name, NULL);
! if(!suspended) return 0;
channel->channel_info = suspended->cData;
suspended->cData->channel = channel;
}
! return 0;
}
! if(IsLocal(user) || IsSuspended(channel->channel_info)) return 0;
cData = channel->channel_info;
***************
*** 6282,6286 ****
/* Riding a netburst. Naughty. */
KickChannelUser(user, channel, chanserv, CSMSG_NETRIDE_DETECTED);
! return;
}
}
--- 6276,6280 ----
/* Riding a netburst. Naughty. */
KickChannelUser(user, channel, chanserv, CSMSG_NETRIDE_DETECTED);
! return 1;
}
}
***************
*** 6318,6322 ****
AddChannelBan(1, &ban, channel, chanserv, now, 1);
KickChannelUser(user, channel, chanserv, kick_reason);
! return;
}
}
--- 6312,6316 ----
AddChannelBan(1, &ban, channel, chanserv, now, 1);
KickChannelUser(user, channel, chanserv, kick_reason);
! return 1;
}
}
***************
*** 6325,6329 ****
so we might as well short-circuit all of this stuff during bursts.
*/
! if(user->uplink->burst) return;
if((channel == chanserv_conf.support_channel) && IsHelper(user))
--- 6319,6323 ----
so we might as well short-circuit all of this stuff during bursts.
*/
! if(user->uplink->burst) return 0;
if((channel == chanserv_conf.support_channel) && IsHelper(user))
***************
*** 6398,6401 ****
--- 6392,6396 ----
}
}
+ return 0;
}
Index: hash.c
===================================================================
RCS file: /cvsroot/srvx/services/src/hash.c,v
retrieving revision 1.159.2.1
retrieving revision 1.159.2.2
diff -C2 -r1.159.2.1 -r1.159.2.2
*** hash.c 18 Oct 2002 18:55:05 -0000 1.159.2.1
--- hash.c 23 Oct 2002 16:22:48 -0000 1.159.2.2
***************
*** 827,836 ****
modeList_append(&user->channels, mNode);
- if (IsLocal(user)) irc_join(user, channel);
-
for (n=0; n<jf_used; n++) {
! jf_list[n](user, channel);
}
return mNode;
}
--- 827,835 ----
modeList_append(&user->channels, mNode);
for (n=0; n<jf_used; n++) {
! if (jf_list[n](user, channel)) return NULL;
}
+ if (IsLocal(user)) irc_join(user, channel);
return mNode;
}
Index: hash.h
===================================================================
RCS file: /cvsroot/srvx/services/src/hash.h,v
retrieving revision 1.81.2.1
retrieving revision 1.81.2.2
diff -C2 -r1.81.2.1 -r1.81.2.2
*** hash.h 26 Jul 2002 04:08:43 -0000 1.81.2.1
--- hash.h 23 Oct 2002 16:22:50 -0000 1.81.2.2
***************
*** 207,211 ****
typedef void (*new_channel_func_t) (struct chanNode *chan);
void reg_new_channel_func(new_channel_func_t handler);
! typedef void (*join_func_t) (struct userNode *user, struct chanNode *chan);
void reg_join_func(join_func_t handler);
typedef void (*del_channel_func_t) (struct chanNode *chan);
--- 207,211 ----
typedef void (*new_channel_func_t) (struct chanNode *chan);
void reg_new_channel_func(new_channel_func_t handler);
! typedef int (*join_func_t) (struct userNode *user, struct chanNode *chan);
void reg_join_func(join_func_t handler);
typedef void (*del_channel_func_t) (struct chanNode *chan);
Index: helpserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/helpserv.c,v
retrieving revision 1.14.2.8
retrieving revision 1.14.2.9
diff -C2 -r1.14.2.8 -r1.14.2.9
*** helpserv.c 8 Oct 2002 22:34:53 -0000 1.14.2.8
--- helpserv.c 23 Oct 2002 16:22:51 -0000 1.14.2.9
***************
*** 3256,3267 ****
* req->user to the user joining for all requests owned by the user's handle
* (if any) with a req->user == NULL */
! static void handle_join(struct userNode *user, struct chanNode *chan) {
struct helpserv_botlist *botlist;
unsigned int i;
const int from_opserv = 0; /* for helpserv_notice */
! if (IsLocal(user) || self->uplink->burst) {
! return;
! }
if ((botlist = dict_find(helpserv_bots_bychan_dict, chan->name, NULL))) {
--- 3256,3265 ----
* req->user to the user joining for all requests owned by the user's handle
* (if any) with a req->user == NULL */
! static int handle_join(struct userNode *user, struct chanNode *chan) {
struct helpserv_botlist *botlist;
unsigned int i;
const int from_opserv = 0; /* for helpserv_notice */
! if (IsLocal(user) || self->uplink->burst) return 0;
if ((botlist = dict_find(helpserv_bots_bychan_dict, chan->name, NULL))) {
***************
*** 3280,3283 ****
--- 3278,3282 ----
}
}
+ return 0;
}
Index: opserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.c,v
retrieving revision 1.235.2.7
retrieving revision 1.235.2.8
diff -C2 -r1.235.2.7 -r1.235.2.8
*** opserv.c 4 Aug 2002 20:11:12 -0000 1.235.2.7
--- opserv.c 23 Oct 2002 16:22:52 -0000 1.235.2.8
***************
*** 2294,2303 ****
}
! static void
opserv_join_check(struct userNode *user, struct chanNode *channel)
{
! if(IsService(user)) {
! return;
! }
if (channel->bad_channel) {
--- 2294,2301 ----
}
! static int
opserv_join_check(struct userNode *user, struct chanNode *channel)
{
! if (IsService(user)) return 0;
if (channel->bad_channel) {
***************
*** 2312,2315 ****
--- 2310,2314 ----
DelUser(user, opserv, 1, OSMSG_ILLEGAL_KILL_REASON);
}
+ return 1;
}
***************
*** 2333,2336 ****
--- 2332,2336 ----
channel->join_flooded = 0;
}
+ return 0;
}
|