From: strutsi Date: Mon, 5 Dec 2005 18:03:00 +0000 (+0000) Subject: G 2.15 mostly bugfixes X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/commitdiff_plain/9f824c9581a915db12e154bd1c75a622641fbc97 G 2.15 mostly bugfixes --- diff --git a/helpmod2/changelist b/helpmod2/changelist index b781e90d..ec2cb599 100644 --- a/helpmod2/changelist +++ b/helpmod2/changelist @@ -357,4 +357,12 @@ Text list is now sorted Added ?? term support for out reason Added channel option to kick users for highlighting chanops - +2.15 +Showticket no longer has level restrictions +Text output returned to 2.13 type +Fixed top10 bug +Fixed the likely cause of missing idle kick bans +Fixed a bug with highlight detection +Highlight detection no detects @nick highlight +Fixed a crash bug in ?? use for out command +One continous changed to continuous diff --git a/helpmod2/hchannel.c b/helpmod2/hchannel.c index 2a868b81..bae82fc3 100644 --- a/helpmod2/hchannel.c +++ b/helpmod2/hchannel.c @@ -236,9 +236,10 @@ void hchannel_remove_inactive_users(void) huser_on_channel((*hchanuser)->husr, hchan)->flags |= H_IDLE_WARNING; } } - hcommit_modes(); + /*hcommit_modes();*/ hchanuser = &(*hchanuser)->next; - } + } + hcommit_modes(); } /* Additionally, test if the channel has queue but no idle opers / staff */ if (hchan->flags & H_QUEUE && hchan->flags & H_QUEUE_TIMEOUT) @@ -483,9 +484,12 @@ int hchannel_highlight_detection(hchannel *hchan, const char *message) if (i++ > 6) break; - while (*buffer_ptr && isspace(*buffer)) + while (*buffer_ptr && isspace(*buffer_ptr)) buffer_ptr++; + if (*buffer_ptr == '@') + buffer_ptr++; + if (*buffer_ptr) { ptr = strchr(buffer_ptr, ' '); diff --git a/helpmod2/hcommands.c b/helpmod2/hcommands.c index 8bd239da..befa4b9a 100644 --- a/helpmod2/hcommands.c +++ b/helpmod2/hcommands.c @@ -354,15 +354,27 @@ static void helpmod_cmd_change_userlevel(huser *sender, hlevel target_level, cha { helpmod_reply(sender, returntype, "Cannot change userlevel: Sanity check, you're changing your own userlevel, use #account instead of nick if you really wish to do this"); continue; - } - if (!IsAccount(target_huser->real_user)) - { + } + + if (target_level == H_LAMER) + { + const char *banmask = hban_ban_string(target_huser->real_user, HBAN_HOST); + hban_add(banmask, "Improper user", time(NULL) + HCMD_OUT_DEFAULT, 1); + if (!IsAccount(target_huser->real_user)) + { + helpmod_reply(sender, returntype, "Cannot change userlevel: User '%s' is not authed. Banning user instead.", argv[i]); + continue; + } + } + + if (!IsAccount(target_huser->real_user)) + { helpmod_reply(sender, returntype, "Cannot change userlevel: User '%s' is not authed", argv[i]); continue; } - if (target_huser->account == NULL) - { + if (target_huser->account == NULL) + { if (haccount_get_by_name(huser_get_auth(target_huser)) != NULL) { helpmod_reply(sender, returntype, "Cannot change userlevel: Unable to create an account. Account %s already exists", huser_get_auth(target_huser)); @@ -376,12 +388,7 @@ static void helpmod_cmd_change_userlevel(huser *sender, hlevel target_level, cha helpmod_reply(sender, returntype, "Userlevel changed: User '%s' now has userlevel %s", argv[i], hlevel_name(target_level)); - if (huser_get_level(target_huser) == H_LAMER) - { - const char *banmask = hban_ban_string(target_huser->real_user, HBAN_HOST); - hban_add(banmask, "Improper user", time(NULL) + HCMD_OUT_DEFAULT, 1); - } - else + if (target_level != H_LAMER) helpmod_reply(target_huser, NULL, "Your userlevel has been changed, your current userlevel is %s", hlevel_name(target_level)); } } @@ -1584,9 +1591,15 @@ static void helpmod_cmd_out (huser *sender, channel* returntype, char* ostr, int if (!strncmp(reason, "?? ", 3)) { /* obtain reason from hterms */ hchannel *hchan = NULL; + hterm *new_reason; if (returntype != NULL) + { /* if hchan is NULL here then everything is broken already */ hchan = hchannel_get_by_channel(returntype); - hterm *new_reason = hterm_get_and_find(hchan->channel_hterms, reason + 3); + new_reason = hterm_get_and_find(hchan->channel_hterms, reason + 3); + } + else + new_reason = hterm_get_and_find(hterms, reason + 3); + if (new_reason != NULL) reason = new_reason->description->content; } @@ -2041,7 +2054,7 @@ static void helpmod_cmd_top10 (huser *sender, channel* returntype, char* ostr, i else if (!ci_strcmp(argv[0], "all") || !ci_strcmp(argv[0], "a")) lvl = H_ANY; } - if (argc == 3) + if (argc == 2) { int tmp; if (sscanf(argv[1], "%d", &tmp) && (tmp >= 10) && (tmp <= 50)) @@ -2477,9 +2490,9 @@ static void helpmod_cmd_showticket (huser *sender, channel* returntype, char* os int i; DEFINE_HCHANNEL; - +/* HCHANNEL_VERIFY_AUTHORITY(hchan, sender); - +*/ if (argc > H_CMD_MAX_ARGS) argc = H_CMD_MAX_ARGS; @@ -3012,19 +3025,19 @@ static void helpmod_cmd_lcedit (huser *sender, channel* returntype, char* ostr, } helpmod_reply(sender, returntype, "Lamer control profile %s:", profile->name->content); - helpmod_reply(sender, returntype, "Maximum caps percentage: %d", profile->caps_max_percentage); - helpmod_reply(sender, returntype, "Caps minimum count: %d", profile->caps_min_count); - helpmod_reply(sender, returntype, "Repeat tolerance: %d", profile->repeats_max_count); - helpmod_reply(sender, returntype, "Repeat minimum length: %d", profile->repeats_min_length); - helpmod_reply(sender, returntype, "Symbol repeat tolerance: %d", profile->symbol_repeat_max_count); - helpmod_reply(sender, returntype, "Character repeat tolerance: %d", profile->character_repeat_max_count); - helpmod_reply(sender, returntype, "Continous symbol tolerance: %d", profile->symbol_max_count); - helpmod_reply(sender, returntype, "Flood tolerance: %d", profile->tolerance_flood); - helpmod_reply(sender, returntype, "Spam tolerance: %d", profile->tolerance_spam); - helpmod_reply(sender, returntype, "Spam multiplier: %f", profile->constant_spam); - helpmod_reply(sender, returntype, "Warning limit: %d", profile->tolerance_warn); - helpmod_reply(sender, returntype, "Kick limit: %d", profile->tolerance_kick); - helpmod_reply(sender, returntype, "Ban limit: %d", profile->tolerance_remove); + helpmod_reply(sender, returntype, "Maximum caps percentage: %d", profile->caps_max_percentage); + helpmod_reply(sender, returntype, "Caps minimum count: %d", profile->caps_min_count); + helpmod_reply(sender, returntype, "Repeat tolerance: %d", profile->repeats_max_count); + helpmod_reply(sender, returntype, "Repeat minimum length: %d", profile->repeats_min_length); + helpmod_reply(sender, returntype, "Symbol repeat tolerance: %d", profile->symbol_repeat_max_count); + helpmod_reply(sender, returntype, "Character repeat tolerance: %d", profile->character_repeat_max_count); + helpmod_reply(sender, returntype, "Continuous symbol tolerance: %d", profile->symbol_max_count); + helpmod_reply(sender, returntype, "Flood tolerance: %d", profile->tolerance_flood); + helpmod_reply(sender, returntype, "Spam tolerance: %d", profile->tolerance_spam); + helpmod_reply(sender, returntype, "Spam multiplier: %f", profile->constant_spam); + helpmod_reply(sender, returntype, "Warning limit: %d", profile->tolerance_warn); + helpmod_reply(sender, returntype, "Kick limit: %d", profile->tolerance_kick); + helpmod_reply(sender, returntype, "Ban limit: %d", profile->tolerance_remove); } else if (!ci_strcmp(argv[0], "edit")) { @@ -3229,7 +3242,7 @@ static void helpmod_cmd_text (huser *sender, channel* returntype, char* ostr, in if (returntype != NULL && huser_get_level(sender) > H_PEON) helpmod_message_channel(hchannel_get_by_channel(returntype), "%s: %s", argv[1], buffer); else - helpmod_reply(sender, returntype, "%s: %s", argv[1], buffer); + helpmod_reply(sender, returntype, "%s", buffer); } fclose (in); return; diff --git a/helpmod2/helpmod.h b/helpmod2/helpmod.h index 19e972c6..06be0033 100644 --- a/helpmod2/helpmod.h +++ b/helpmod2/helpmod.h @@ -12,8 +12,8 @@ /* configuration */ /* These should always be equal */ -#define HELPMOD_VERSION_INTERNAL HELPMOD_VERSION_2_14 -#define HELPMOD_VERSION "2.14" +#define HELPMOD_VERSION_INTERNAL HELPMOD_VERSION_2_15 +#define HELPMOD_VERSION "2.15" #define HELPMOD_USER_TIMEOUT 1200 diff --git a/helpmod2/hversions.h b/helpmod2/hversions.h index 32cc9f3b..c62d4a71 100644 --- a/helpmod2/hversions.h +++ b/helpmod2/hversions.h @@ -14,4 +14,6 @@ #define HELPMOD_VERSION_2_14 14 /* November 2005*/ +#define HELPMOD_VERSION_2_15 15 /* December 2005*/ + #endif