#define KEY_USERS "users"
#define KEY_BANS "bans"
#define KEY_MAX "max"
+#define KEY_MAX_TIME "max_time"
#define KEY_NOTES "notes"
#define KEY_TOPIC_MASK "topic_mask"
#define KEY_OWNER_TRANSFER "owner_transfer"
{ "CSMSG_CHANNEL_MODES", "$bMode Lock: $b%s" },
{ "CSMSG_CHANNEL_NOTE", "$b%s:%*s$b%s" },
{ "CSMSG_CHANNEL_MAX", "$bRecord Visitors: $b%i" },
+ { "CSMSG_CHANNEL_MAX_TIME", "$bRecord Visitors: $b%i (%s ago.)" },
{ "CSMSG_CHANNEL_OWNER", "$bOwner: $b%s" },
{ "CSMSG_CHANNEL_BANS", "$bBan Count: $b%i" },
{ "CSMSG_CHANNEL_USERS", "$bTotal User Count: $b%i" },
/* Initialize the channel's max user record. */
cData->max = channel->members.used;
+ cData->max_time = 0;
if(handle != user->handle_info)
reply("CSMSG_PROXY_SUCCESS", handle->handle, channel->name);
target->ownerTransfer = source->ownerTransfer;
if(source->may_opchan)
target->may_opchan = 1;
- if(source->max > target->max)
+ if(source->max > target->max) {
target->max = source->max;
+ target->max_time = source->max_time;
+ }
}
static void
reply("CSMSG_CHANNEL_NOTE", iter_key(it), padding > 0 ? padding : 1, "", note->note);
}
- reply("CSMSG_CHANNEL_MAX", cData->max);
+ if(cData->max_time) {
+ reply("CSMSG_CHANNEL_MAX_TIME", cData->max, intervalString(buffer, now - cData->max_time, user->handle_info));
+ } else {
+ reply("CSMSG_CHANNEL_MAX", cData->max);
+ }
for(owner = cData->users; owner; owner = owner->next)
if(owner->access == UL_OWNER)
reply("CSMSG_CHANNEL_OWNER", owner->handle->handle);
return 0;
cData = channel->channel_info;
- if(channel->members.used > cData->max)
+ if(channel->members.used > cData->max) {
cData->max = channel->members.used;
+ cData->max_time = now;
+ }
for(i = 0; i < channel->invited.used; i++)
{
cData->ownerTransfer = str ? strtoul(str, NULL, 0) : 0;
str = database_get_data(channel, KEY_MAX, RECDB_QSTRING);
cData->max = str ? atoi(str) : 0;
+ str = database_get_data(channel, KEY_MAX_TIME, RECDB_QSTRING);
+ cData->max_time = str ? atoi(str) : 0;
str = database_get_data(channel, KEY_GREETING, RECDB_QSTRING);
cData->greeting = str ? strdup(str) : NULL;
str = database_get_data(channel, KEY_USER_GREETING, RECDB_QSTRING);
saxdb_write_int(ctx, KEY_REGISTERED, channel->registered);
saxdb_write_int(ctx, KEY_MAX, channel->max);
+ saxdb_write_int(ctx, KEY_MAX_TIME, channel->max_time);
if(channel->topic)
saxdb_write_string(ctx, KEY_TOPIC, channel->topic);
if(channel->registrar)