[srvx-commits] CVS: services/src chanserv.c,1.250,1.251
Brought to you by:
entrope
|
From: Zoot <zo...@us...> - 2002-07-29 15:16:13
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv18490/src
Modified Files:
chanserv.c
Log Message:
Display channel notes visible to the user in the !info reply.
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.250
retrieving revision 1.251
diff -C2 -r1.250 -r1.251
*** chanserv.c 25 Jul 2002 03:00:07 -0000 1.250
--- chanserv.c 29 Jul 2002 15:16:08 -0000 1.251
***************
*** 339,342 ****
--- 339,343 ----
#define CSMSG_CHANNEL_TOPIC "$bDefault Topic: $b%s"
#define CSMSG_CHANNEL_MODES "$bMode Lock: $b%s"
+ #define CSMSG_CHANNEL_NOTE "$b%s:%*s$b%s"
#define CSMSG_CHANNEL_MAX "$bRecord Visitors: $b%i"
#define CSMSG_CHANNEL_BANS "$bBan Count: $b%i"
***************
*** 454,458 ****
/* The 24 allows for [+-ntlksimp] and lots of fudge factor. */
#define MODELEN 24 + KEYLEN
! #define PADLEN 14
#define ACCESSLEN 10
--- 455,459 ----
/* The 24 allows for [+-ntlksimp] and lots of fudge factor. */
#define MODELEN 24 + KEYLEN
! #define PADLEN 21
#define ACCESSLEN 10
***************
*** 4463,4466 ****
--- 4464,4469 ----
const char *chan_name;
enum userLevel access;
+ struct note *note;
+ dict_iterator_t it;
if(channel)
***************
*** 4499,4503 ****
create_mode_lock(modes, cData);
chanserv_notice(user, CSMSG_CHANNEL_TOPIC, cData->topic);
! chanserv_notice(user, CSMSG_CHANNEL_MODES, modes);
}
--- 4502,4520 ----
create_mode_lock(modes, cData);
chanserv_notice(user, CSMSG_CHANNEL_TOPIC, cData->topic);
! chanserv_notice(user, CSMSG_CHANNEL_MODES, modes[0] ? modes : "None.");
! }
!
! for(it = dict_first(cData->notes); it; it = iter_next(it))
! {
! int padding;
!
! note = iter_data(it);
! if(!note_type_visible_to_user(cData, note->type, user))
! {
! continue;
! }
!
! padding = PADLEN - 1 - strlen(iter_key(it));
! chanserv_notice(user, CSMSG_CHANNEL_NOTE, iter_key(it), padding > 0 ? padding : 1, "", note->note);
}
***************
*** 4505,4513 ****
for(access = USER_LEVEL_HIGHEST; access >= USER_LEVEL_LOWEST; access--)
{
! int ii = PADLEN - strlen(accessTitles[access]);
chanserv_notice(user, CSMSG_CHANNEL_USERS, accessTitles[access], ii, "", cData->userCount[access]);
}
! chanserv_notice(user, CSMSG_CHANNEL_USERS, "Total User", PADLEN - 10, "", cData->userCount[0]);
chanserv_notice(user, CSMSG_CHANNEL_BANS, cData->banCount);
--- 4522,4530 ----
for(access = USER_LEVEL_HIGHEST; access >= USER_LEVEL_LOWEST; access--)
{
! int ii = PADLEN - 7 - strlen(accessTitles[access]);
chanserv_notice(user, CSMSG_CHANNEL_USERS, accessTitles[access], ii, "", cData->userCount[access]);
}
! chanserv_notice(user, CSMSG_CHANNEL_USERS, "Total User", PADLEN - 17, "", cData->userCount[0]);
chanserv_notice(user, CSMSG_CHANNEL_BANS, cData->banCount);
***************
*** 4566,4574 ****
for(access = USER_LEVEL_HIGHEST; access >= USER_LEVEL_LOWEST; access--)
{
! i = PADLEN - strlen(accessTitles[access]);
chanserv_notice(user, CSMSG_CHANNEL_USERS, accessTitles[access], i, "", userCount[access]);
}
! chanserv_notice(user, CSMSG_CHANNEL_USERS, "Total User", PADLEN - 10, "", userCount[0]);
intervalString(interval, now - boot_time);
--- 4583,4591 ----
for(access = USER_LEVEL_HIGHEST; access >= USER_LEVEL_LOWEST; access--)
{
! i = PADLEN - 7 - strlen(accessTitles[access]);
chanserv_notice(user, CSMSG_CHANNEL_USERS, accessTitles[access], i, "", userCount[access]);
}
! chanserv_notice(user, CSMSG_CHANNEL_USERS, "Total User", PADLEN - 17, "", userCount[0]);
intervalString(interval, now - boot_time);
|