Compare commits
2 Commits
61c52d793c
...
10cb6651c0
Author | SHA1 | Date | |
---|---|---|---|
10cb6651c0 | |||
7f28dcd1ef |
2
NEWS
2
NEWS
@ -13,6 +13,8 @@
|
||||
|
||||
* degesch: /set +=/-= now treats its argument as a string array
|
||||
|
||||
* degesch: made "/help /command" work the same way as "/help command" does
|
||||
|
||||
* censor.lua: now stripping colours from censored messages;
|
||||
their attributes are also configurable rather than always black on black
|
||||
|
||||
|
33
degesch.c
33
degesch.c
@ -4101,6 +4101,13 @@ buffer_open_log_file (struct app_context *ctx, struct buffer *buffer)
|
||||
return;
|
||||
|
||||
// TODO: should we try to reopen files wrt. case mapping?
|
||||
// - Need to read the whole directory and look for matches:
|
||||
// irc_server_strcmp(buffer->s, d_name, make_log_filename())
|
||||
// remember to strip the ".log" suffix from d_name, case-sensitively.
|
||||
// - The tolower_ascii() in make_log_filename() is a perfect overlap,
|
||||
// it may stay as-is.
|
||||
// - buffer_get_log_path() will need to return a FILE *,
|
||||
// or an error that includes the below message.
|
||||
char *path = buffer_get_log_path (buffer);
|
||||
if (!(buffer->log_file = fopen (path, "ab")))
|
||||
log_global_error (ctx, "Couldn't open log file `#s': #l",
|
||||
@ -8132,8 +8139,8 @@ irc_process_message (const struct irc_message *msg, struct server *s)
|
||||
irc_sanitize_cut_off_utf8 (&msg->params.vector[msg->params.len - 1]);
|
||||
|
||||
// TODO: make use of IRCv3.2 server-time (with fallback to unixtime_msec())
|
||||
// -> change all calls to log_{server,nick,outcoming,ctcp}*() to take
|
||||
// an extra argument specifying time
|
||||
// -> change all calls to log_{server,nick,chghost,outcoming,ctcp}*()
|
||||
// to take an extra numeric argument specifying time
|
||||
struct irc_handler key = { .name = msg->command };
|
||||
struct irc_handler *handler = bsearch (&key, g_irc_handlers,
|
||||
N_ELEMENTS (g_irc_handlers), sizeof key, irc_handler_cmp_by_name);
|
||||
@ -11559,7 +11566,8 @@ handle_command_topic (struct handler_args *a)
|
||||
if (*a->arguments)
|
||||
// FIXME: there's no way to start the topic with whitespace
|
||||
// FIXME: there's no way to unset the topic;
|
||||
// we could adopt the Tcl style of "-switches" with "--" sentinels
|
||||
// we could adopt the Tcl style of "-switches" with "--" sentinels,
|
||||
// or we could accept "strings" in the config format
|
||||
irc_send (a->s, "TOPIC %s :%s", a->channel_name, a->arguments);
|
||||
else
|
||||
irc_send (a->s, "TOPIC %s", a->channel_name);
|
||||
@ -11638,7 +11646,9 @@ mass_channel_mode_mask_list
|
||||
for (size_t i = 0; i < v.len; i++)
|
||||
{
|
||||
char *target = v.vector[i];
|
||||
// TODO: support EXTBAN and leave those alone, too
|
||||
// TODO: support EXTBAN=<[PREFIX],TYPES> and leave those alone, too.
|
||||
// The type may be prefixed by ~, and must be followed by \0 or ':'.
|
||||
// Make a function like irc_is_extban().
|
||||
if (strpbrk (target, "!@*?"))
|
||||
continue;
|
||||
|
||||
@ -12188,8 +12198,9 @@ handle_command_help (struct handler_args *a)
|
||||
if (!*a->arguments)
|
||||
return show_command_list (ctx);
|
||||
|
||||
// TODO: we should probably also accept commands names with a leading slash
|
||||
char *command = cut_word (&a->arguments);
|
||||
const char *word = cut_word (&a->arguments);
|
||||
|
||||
const char *command = word + (*word == '/');
|
||||
for (size_t i = 0; i < N_ELEMENTS (g_command_handlers); i++)
|
||||
{
|
||||
struct command_handler *handler = &g_command_handlers[i];
|
||||
@ -12197,13 +12208,13 @@ handle_command_help (struct handler_args *a)
|
||||
return show_command_help (ctx, handler);
|
||||
}
|
||||
|
||||
if (try_handle_command_help_option (ctx, command))
|
||||
if (try_handle_command_help_option (ctx, word))
|
||||
return true;
|
||||
|
||||
if (str_map_find (get_aliases_config (ctx), command))
|
||||
log_global_status (ctx, "/#s is an alias", command);
|
||||
else
|
||||
log_global_error (ctx, "#s: #s", "No such command or option", command);
|
||||
log_global_error (ctx, "#s: #s", "No such command or option", word);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -12278,6 +12289,12 @@ expand_alias_escape (const char *p, const char *arguments, struct str *output)
|
||||
cstr_split (arguments, " ", true, &words);
|
||||
|
||||
// TODO: eventually also add support for argument ranges
|
||||
// - Can use ${0}, ${0:}, ${:0}, ${1:-1} with strtol, dispose of $1 syntax
|
||||
// (default aliases don't use numeric arguments).
|
||||
// - Start numbering from zero, since we'd have to figure out what to do
|
||||
// in case we encounter a zero if we keep the current approach.
|
||||
// - Ignore the sequence altogether if no closing '}' can be found,
|
||||
// or if the internal format doesn't fit the above syntax.
|
||||
if (*p >= '1' && *p <= '9')
|
||||
{
|
||||
size_t offset = *p - '1';
|
||||
|
Loading…
x
Reference in New Issue
Block a user