aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2021-06-16 21:17:34 +0200
committerPřemysl Eric Janouch <p@janouch.name>2021-06-16 22:10:25 +0200
commit10cb6651c0be90f1103b92ad46a1da90b4bd592c (patch)
tree8cf7186234865fd66047559f265fe1ddd1ac614d
parent7f28dcd1efbfd7191ed43856119b90ee47a2f65d (diff)
downloadxK-10cb6651c0be90f1103b92ad46a1da90b4bd592c.tar.gz
xK-10cb6651c0be90f1103b92ad46a1da90b4bd592c.tar.xz
xK-10cb6651c0be90f1103b92ad46a1da90b4bd592c.zip
degesch: expand/analyze a few TODO comments
-rw-r--r--degesch.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/degesch.c b/degesch.c
index ed5b1ce..f556241 100644
--- a/degesch.c
+++ b/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;
@@ -12279,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';