[srvx-commits] CVS: services/src chanserv.c,1.371,1.372
Brought to you by:
entrope
|
From: Adrian D. <sai...@us...> - 2003-08-02 23:42:17
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv6698/src
Modified Files:
chanserv.c
Log Message:
Send globals for channel merges and giveownership (RFE#678930)
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.371
retrieving revision 1.372
diff -C2 -r1.371 -r1.372
*** chanserv.c 31 Jul 2003 02:08:40 -0000 1.371
--- chanserv.c 2 Aug 2003 23:42:14 -0000 1.372
***************
*** 2377,2381 ****
struct userData *target_user;
struct chanNode *target;
! char reason[MAXLEN];
REQUIRE_PARAMS(2);
--- 2377,2381 ----
struct userData *target_user;
struct chanNode *target;
! char reason[MAXLEN], *oldname;
REQUIRE_PARAMS(2);
***************
*** 2385,2408 ****
if(!(target = GetChannel(argv[1])))
{
! chanserv_notice(user, MSG_INVALID_CHANNEL);
! return 0;
}
if(!target->channel_info)
{
! chanserv_notice(user, CSMSG_NOT_REGISTERED, target->name);
! return 0;
}
if(IsSuspended(target->channel_info))
{
! chanserv_notice(user, CSMSG_MERGE_SUSPENDED);
! return 0;
}
if(channel == target)
{
! chanserv_notice(user, CSMSG_MERGE_SELF);
! return 0;
}
--- 2385,2408 ----
if(!(target = GetChannel(argv[1])))
{
! chanserv_notice(user, MSG_INVALID_CHANNEL);
! return 0;
}
if(!target->channel_info)
{
! chanserv_notice(user, CSMSG_NOT_REGISTERED, target->name);
! return 0;
}
if(IsSuspended(target->channel_info))
{
! chanserv_notice(user, CSMSG_MERGE_SUSPENDED);
! return 0;
}
if(channel == target)
{
! chanserv_notice(user, CSMSG_MERGE_SELF);
! return 0;
}
***************
*** 2417,2423 ****
--- 2417,2429 ----
merge_channel(channel->channel_info, target->channel_info);
sprintf(reason, "Channel merged into %s by %s.", target->name, user->handle_info->handle);
+ oldname = strdup(channel->name);
unregister_channel(channel->channel_info);
DelChannelUser(chanserv, channel, reason, 0);
chanserv_notice(user, CSMSG_MERGE_SUCCESS, target->name);
+
+ sprintf(reason, "%s merged into %s by %s.", oldname, target->name, user->handle_info->handle);
+ global_message(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, reason);
+ free(oldname);
+
return 1;
}
***************
*** 5747,5750 ****
--- 5753,5757 ----
unsigned int force;
struct do_not_register *dnr;
+ char reason[MAXLEN];
REQUIRE_PARAMS(2);
***************
*** 5809,5812 ****
--- 5816,5823 ----
}
chanserv_notice(user, CSMSG_OWNERSHIP_GIVEN, channel->name, new_owner_hi->handle);
+
+ sprintf(reason, "%s ownership transferred to %s by %s", channel->name, new_owner_hi->handle, user->handle_info->handle);
+ global_message(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, reason);
+
return 1;
}
|