Compare commits
No commits in common. "10cb6651c0be90f1103b92ad46a1da90b4bd592c" and "61c52d793c1ea2f9bdc46add2709a285ed561afa" have entirely different histories.
10cb6651c0
...
61c52d793c
2
NEWS
2
NEWS
@ -13,8 +13,6 @@
|
|||||||
|
|
||||||
* degesch: /set +=/-= now treats its argument as a string array
|
* 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;
|
* censor.lua: now stripping colours from censored messages;
|
||||||
their attributes are also configurable rather than always black on black
|
their attributes are also configurable rather than always black on black
|
||||||
|
|
||||||
|
33
degesch.c
33
degesch.c
@ -4101,13 +4101,6 @@ buffer_open_log_file (struct app_context *ctx, struct buffer *buffer)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// TODO: should we try to reopen files wrt. case mapping?
|
// 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);
|
char *path = buffer_get_log_path (buffer);
|
||||||
if (!(buffer->log_file = fopen (path, "ab")))
|
if (!(buffer->log_file = fopen (path, "ab")))
|
||||||
log_global_error (ctx, "Couldn't open log file `#s': #l",
|
log_global_error (ctx, "Couldn't open log file `#s': #l",
|
||||||
@ -8139,8 +8132,8 @@ irc_process_message (const struct irc_message *msg, struct server *s)
|
|||||||
irc_sanitize_cut_off_utf8 (&msg->params.vector[msg->params.len - 1]);
|
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())
|
// TODO: make use of IRCv3.2 server-time (with fallback to unixtime_msec())
|
||||||
// -> change all calls to log_{server,nick,chghost,outcoming,ctcp}*()
|
// -> change all calls to log_{server,nick,outcoming,ctcp}*() to take
|
||||||
// to take an extra numeric argument specifying time
|
// an extra argument specifying time
|
||||||
struct irc_handler key = { .name = msg->command };
|
struct irc_handler key = { .name = msg->command };
|
||||||
struct irc_handler *handler = bsearch (&key, g_irc_handlers,
|
struct irc_handler *handler = bsearch (&key, g_irc_handlers,
|
||||||
N_ELEMENTS (g_irc_handlers), sizeof key, irc_handler_cmp_by_name);
|
N_ELEMENTS (g_irc_handlers), sizeof key, irc_handler_cmp_by_name);
|
||||||
@ -11566,8 +11559,7 @@ handle_command_topic (struct handler_args *a)
|
|||||||
if (*a->arguments)
|
if (*a->arguments)
|
||||||
// FIXME: there's no way to start the topic with whitespace
|
// FIXME: there's no way to start the topic with whitespace
|
||||||
// FIXME: there's no way to unset the topic;
|
// 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);
|
irc_send (a->s, "TOPIC %s :%s", a->channel_name, a->arguments);
|
||||||
else
|
else
|
||||||
irc_send (a->s, "TOPIC %s", a->channel_name);
|
irc_send (a->s, "TOPIC %s", a->channel_name);
|
||||||
@ -11646,9 +11638,7 @@ mass_channel_mode_mask_list
|
|||||||
for (size_t i = 0; i < v.len; i++)
|
for (size_t i = 0; i < v.len; i++)
|
||||||
{
|
{
|
||||||
char *target = v.vector[i];
|
char *target = v.vector[i];
|
||||||
// TODO: support EXTBAN=<[PREFIX],TYPES> and leave those alone, too.
|
// TODO: support EXTBAN 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, "!@*?"))
|
if (strpbrk (target, "!@*?"))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -12198,9 +12188,8 @@ handle_command_help (struct handler_args *a)
|
|||||||
if (!*a->arguments)
|
if (!*a->arguments)
|
||||||
return show_command_list (ctx);
|
return show_command_list (ctx);
|
||||||
|
|
||||||
const char *word = cut_word (&a->arguments);
|
// TODO: we should probably also accept commands names with a leading slash
|
||||||
|
char *command = cut_word (&a->arguments);
|
||||||
const char *command = word + (*word == '/');
|
|
||||||
for (size_t i = 0; i < N_ELEMENTS (g_command_handlers); i++)
|
for (size_t i = 0; i < N_ELEMENTS (g_command_handlers); i++)
|
||||||
{
|
{
|
||||||
struct command_handler *handler = &g_command_handlers[i];
|
struct command_handler *handler = &g_command_handlers[i];
|
||||||
@ -12208,13 +12197,13 @@ handle_command_help (struct handler_args *a)
|
|||||||
return show_command_help (ctx, handler);
|
return show_command_help (ctx, handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (try_handle_command_help_option (ctx, word))
|
if (try_handle_command_help_option (ctx, command))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (str_map_find (get_aliases_config (ctx), command))
|
if (str_map_find (get_aliases_config (ctx), command))
|
||||||
log_global_status (ctx, "/#s is an alias", command);
|
log_global_status (ctx, "/#s is an alias", command);
|
||||||
else
|
else
|
||||||
log_global_error (ctx, "#s: #s", "No such command or option", word);
|
log_global_error (ctx, "#s: #s", "No such command or option", command);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -12289,12 +12278,6 @@ expand_alias_escape (const char *p, const char *arguments, struct str *output)
|
|||||||
cstr_split (arguments, " ", true, &words);
|
cstr_split (arguments, " ", true, &words);
|
||||||
|
|
||||||
// TODO: eventually also add support for argument ranges
|
// 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')
|
if (*p >= '1' && *p <= '9')
|
||||||
{
|
{
|
||||||
size_t offset = *p - '1';
|
size_t offset = *p - '1';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user