projects
/
srvx.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9cbe149
)
added entry counter to cmd_myaccess
author
pk910
<philipp@zoelle1.de>
Thu, 7 Jul 2011 19:28:38 +0000
(21:28 +0200)
committer
pk910
<philipp@zoelle1.de>
Thu, 7 Jul 2011 19:28:38 +0000
(21:28 +0200)
src/chanserv.c
patch
|
blob
|
history
diff --git
a/src/chanserv.c
b/src/chanserv.c
index 900bf854fb812503736b65de34e9daaa527dd1d0..0e8aeee4d3f59abbd73d15092b10a0e7c0821879 100644
(file)
--- a/
src/chanserv.c
+++ b/
src/chanserv.c
@@
-384,6
+384,8
@@
static const struct message_entry msgtab[] = {
{ "CSMSG_UC_H_TITLE", "network helper" },
{ "CSMSG_LC_H_TITLE", "support helper" },
{ "CSMSG_LAME_SMURF_TARGET", "%s is an IRC operator." },
{ "CSMSG_UC_H_TITLE", "network helper" },
{ "CSMSG_LC_H_TITLE", "support helper" },
{ "CSMSG_LAME_SMURF_TARGET", "%s is an IRC operator." },
+ { "CSMSG_MYACCESS_COUNT", "%s has access in $b%d$b channels." },
+ { "CSMSG_MYACCESS_COUNT_1", "%s has access in $b%d$b channel." },
/* Seen information */
{ "CSMSG_NEVER_SEEN", "%s has never been seen in $b%s$b." },
/* Seen information */
{ "CSMSG_NEVER_SEEN", "%s has never been seen in $b%s$b." },
@@
-3794,6
+3796,7
@@
static CHANSERV_FUNC(cmd_myaccess)
static struct string_buffer sbuf;
struct handle_info *target_handle;
struct userData *uData;
static struct string_buffer sbuf;
struct handle_info *target_handle;
struct userData *uData;
+ int ccount = 0;
if(argc < 2)
target_handle = user->handle_info;
if(argc < 2)
target_handle = user->handle_info;
@@
-3818,6
+3821,7
@@
static CHANSERV_FUNC(cmd_myaccess)
for(uData = target_handle->channels; uData; uData = uData->u_next)
{
struct chanData *cData = uData->channel;
for(uData = target_handle->channels; uData; uData = uData->u_next)
{
struct chanData *cData = uData->channel;
+ ccount++;
if(uData->access > UL_OWNER)
continue;
if(uData->access > UL_OWNER)
continue;
@@
-3848,6
+3852,12
@@
static CHANSERV_FUNC(cmd_myaccess)
send_message_type(4, user, cmd->parent->bot, "%s", sbuf.list);
}
send_message_type(4, user, cmd->parent->bot, "%s", sbuf.list);
}
+ if(ccount == 1) {
+ reply("CSMSG_MYACCESS_COUNT_1", target_handle->handle, ccount);
+ } else {
+ reply("CSMSG_MYACCESS_COUNT", target_handle->handle, ccount);
+ }
+
return 1;
}
return 1;
}