[srvx-commits] CVS: services/src chanserv.help,1.26,1.27 chanserv.c,1.238,1.239
Brought to you by:
entrope
|
From: Entrope <en...@us...> - 2002-07-04 03:08:39
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv12554/src
Modified Files:
chanserv.help chanserv.c
Log Message:
make "/msg chanserv access" show your infolines in all channels
Index: chanserv.help
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.help,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -r1.26 -r1.27
*** chanserv.help 25 Jun 2002 04:21:24 -0000 1.26
--- chanserv.help 4 Jul 2002 03:08:36 -0000 1.27
***************
*** 103,106 ****
--- 103,107 ----
"${command/ACCESS/access}",
"Reports various pieces of information about a channel user, including channel and network access level, and the user's info line. If no nick or account is provided, $C returns your own information.",
+ "If no channel is provided, $C lists your infolines in all registered channels.",
"$uSee Also:$u users");
"ADDBAN" ("$bADDBAN$b",
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.238
retrieving revision 1.239
diff -C2 -r1.238 -r1.239
*** chanserv.c 2 Jul 2002 02:58:13 -0000 1.238
--- chanserv.c 4 Jul 2002 03:08:36 -0000 1.239
***************
*** 315,318 ****
--- 315,320 ----
/* Access information */
#define CSMSG_IS_CHANSERV "$b$C$b is the $bchannel service bot$b."
+ #define CSMSG_ACCESS_SELF_ONLY "You may only see the list of infolines for yourself (by using $b%s$b with no arguments)."
+ #define CSMSG_INFOLINE_LIST "Showing all infolines for account $b%s$b:"
#define CSMSG_USER_NO_ACCESS "%s lacks access to %s."
#define CSMSG_USER_HAS_ACCESS "%s is %s $b%s$b in %s."
***************
*** 3725,3728 ****
--- 3727,3757 ----
char prefix[MAXLEN];
+ if(!channel)
+ {
+ struct chanList *cList;
+ const char *chanName;
+
+ target_handle = user->handle_info;
+ if(argc > 1)
+ {
+ if(IsPrivileged(user))
+ {
+ if (!(target_handle = chanserv_get_handle_info(user, argv[1]))) return 0;
+ }
+ else
+ {
+ chanserv_notice(user, CSMSG_ACCESS_SELF_ONLY, argv[0]);
+ return 0;
+ }
+ }
+ chanserv_notice(user, CSMSG_INFOLINE_LIST, target_handle->handle);
+ for (cList = target_handle->channels; cList; cList = cList->next) {
+ if(!cList->user->info) continue;
+ chanName = cList->channel->channel ? cList->channel->channel->name : cList->channel->suspended->name;
+ chanserv_notice(user, "[%s] %s", chanName, cList->user->info);
+ }
+ return 1;
+ }
+
if(argc < 2)
{
***************
*** 7655,7659 ****
DEFINE_COMMAND(peek, CMD_REQUIRE_DEFAULT | CMD_IGNORE_EVENT, ulOp);
! DEFINE_COMMAND(access, CMD_REQUIRE_REGISTERED | CMD_IGNORE_EVENT | CMD_SUSPEND_OVERRIDE | CMD_REQUIRE_JOINABLE, ulNone);
DEFINE_COMMAND(users, CMD_REQUIRE_REGISTERED | CMD_IGNORE_EVENT | CMD_SUSPEND_OVERRIDE | CMD_REQUIRE_JOINABLE, ulNone);
DEFINE_COMMAND(wlist, CMD_REQUIRE_REGISTERED | CMD_IGNORE_EVENT | CMD_SUSPEND_OVERRIDE | CMD_REQUIRE_JOINABLE, ulNone);
--- 7684,7688 ----
DEFINE_COMMAND(peek, CMD_REQUIRE_DEFAULT | CMD_IGNORE_EVENT, ulOp);
! DEFINE_COMMAND(access, CMD_IGNORE_EVENT | CMD_SUSPEND_OVERRIDE | CMD_REQUIRE_JOINABLE, ulNone);
DEFINE_COMMAND(users, CMD_REQUIRE_REGISTERED | CMD_IGNORE_EVENT | CMD_SUSPEND_OVERRIDE | CMD_REQUIRE_JOINABLE, ulNone);
DEFINE_COMMAND(wlist, CMD_REQUIRE_REGISTERED | CMD_IGNORE_EVENT | CMD_SUSPEND_OVERRIDE | CMD_REQUIRE_JOINABLE, ulNone);
|