[srvx-commits] CVS: services/src chanserv.c,1.346,1.347
Brought to you by:
entrope
|
From: Entrope <en...@us...> - 2003-05-19 19:23:48
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv29502/src
Modified Files:
chanserv.c
Log Message:
require users to have owner (or above) access in target channel for a merge
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.346
retrieving revision 1.347
diff -C2 -r1.346 -r1.347
*** chanserv.c 25 Mar 2003 09:20:16 -0000 1.346
--- chanserv.c 19 May 2003 19:23:45 -0000 1.347
***************
*** 150,153 ****
--- 150,154 ----
#define CSMSG_MERGE_SELF "Merging cannot be performed if the source and target channels are the same."
#define CSMSG_MERGE_SUSPENDED "Merging cannot be performed if the source or target channel is suspended."
+ #define CSMSG_MERGE_NOTOWNER "You must be the owner of the target channel (or a helper) to merge into the channel."
/* Handle unregistration */
***************
*** 2377,2380 ****
--- 2378,2382 ----
static CHANSERV_FUNC(cmd_merge)
{
+ struct userData *target_user;
struct chanNode *target;
char reason[MAXLEN];
***************
*** 2406,2409 ****
--- 2408,2418 ----
chanserv_notice(user, CSMSG_MERGE_SELF);
return 0;
+ }
+
+ target_user = GetChannelUser(target->channel_info, user->handle_info);
+ if(!target_user || (target_user->access < ulOwner))
+ {
+ chanserv_notice(user, CSMSG_MERGE_NOTOWNER);
+ return 0;
}
|