From f21df708b0aeea03a33a63cd5680e85eb7083260 Mon Sep 17 00:00:00 2001 From: Ailin Nemui Date: Mon, 27 Mar 2023 22:59:49 +0200 Subject: [PATCH 01/19] up version --- configure.ac | 2 +- meson.build | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index e67c5b25..5c5ba3c6 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT(irssi, 1.4.3) +AC_INIT(irssi, 1.4.4) AC_CONFIG_SRCDIR([src]) AC_CONFIG_AUX_DIR(build-aux) AC_PREREQ(2.50) diff --git a/meson.build b/meson.build index 5038b752..6bbfbced 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('irssi', 'c', - version : '1.4.3', + version : '1.4.4', meson_version : '>=0.49', default_options : ['warning_level=1']) From f32701b906816124e2eb00fc38d53ab79bb8ccab Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Sun, 18 Dec 2022 12:18:13 +0100 Subject: [PATCH 02/19] Merge pull request #1421 from j1mmie/patch-1 Add parameter LIST to STATUSBAR documentation (cherry picked from commit b988b2925bf7310a3d7fefeb9b861866afae0d29) --- docs/help/in/statusbar.in | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/help/in/statusbar.in b/docs/help/in/statusbar.in index fd764537..a5626d46 100644 --- a/docs/help/in/statusbar.in +++ b/docs/help/in/statusbar.in @@ -35,8 +35,10 @@ quoted (e.g. -priority "-1") -alignment: Display the item on the right side. - Where statusbar refers to the name of the statusbar; if no argument is - given, the entire list of statusbars will be displayed. + Where statusbar refers to the name of the statusbar; if no + argument is given, or `LIST` is given, the entire list of + statusbars along with a quick overview of their properties will be + displayed. %9Description:%9 From 1426ae87b1be4f9e4ca490ddb202cbd759b92aa3 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Sat, 26 Nov 2022 15:09:50 +0100 Subject: [PATCH 03/19] Merge pull request #1424 from ailin-nemui/lastlog fix lastlog -window (cherry picked from commit 6e3745f42386f5d4147803e4af50b163fef3e901) --- src/fe-text/lastlog.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/fe-text/lastlog.c b/src/fe-text/lastlog.c index b93b8361..89ee30a9 100644 --- a/src/fe-text/lastlog.c +++ b/src/fe-text/lastlog.c @@ -118,6 +118,7 @@ static void show_lastlog(const char *searchtext, GHashTable *optlist, return; } } + view = WINDOW_GUI(window)->view; if (g_hash_table_lookup(optlist, "new") != NULL) startline = textbuffer_view_get_bookmark(view, "lastlog_last_check"); From 8f79457769881f8fe9730b02766e4ad68056398d Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Tue, 29 Nov 2022 20:05:52 +0100 Subject: [PATCH 04/19] Merge pull request #1428 from ailin-nemui/flip-level add (hide)level flip command (cherry picked from commit 88cc48651dcfe9121ff60464c92b4318a6c1ca31) --- docs/help/in/window.in | 4 ++++ src/core/levels.c | 8 +++++--- src/fe-common/core/window-commands.c | 2 +- src/fe-text/textbuffer-commands.c | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/docs/help/in/window.in b/docs/help/in/window.in index 9a7a7b10..23316911 100644 --- a/docs/help/in/window.in +++ b/docs/help/in/window.in @@ -42,6 +42,7 @@ LEFT: %|Go to the previous window numerically that is part of the current sticky group (or not part of any sticky group). RIGHT: %|Go to the next window numerically that is part of the current sticky group (or not part of any sticky group). STICK: %|Make the currently active window sticky, or stick the window specified by number to the currently visible split window. Or turn off stickyness of the currently active window or the window specified by number. + HIDELEVEL: %|Changes the levels of text lines that should be hidden from view, or query the current hidden level. MOVE LEFT: %|Move the window to the numerically previous location inside the current sticky group. MOVE RIGHT: %|Move the window to the numerically next location inside the current sticky group. MOVE UP: %|Move the current window to the sticky group of the previous split window. If no sticky group remains, the split window collapses. @@ -52,6 +53,8 @@ %|Add the required arguments for the given command. Without arguments, the details (size, immortality, levels, server, name and sticky group) of the currently active window are displayed. If used with a number as argument, same as WINDOW REFNUM. + %|LEVEL and HIDELEVEL modify the currently set level. Without arguments, the current level is displayed. Levels listed starting with `+' are added to the current levels. Levels listed starting with `-' are removed from the current levels. To clear the levels, start the new level setting with `NONE'. Levels listed starting with `^' are either removed or added from the current setting, depending on whether they were previously set or not (since Irssi 1.5). Levels listed as is are also added to the current levels. Afterwards, the new level setting is displayed. + %9Description:%9 Manipulates the window layout and positioning attributes. @@ -68,6 +71,7 @@ /WINDOW LOG OFF /WINDOW LOG ON ~/logs/debug.log /WINDOW LEVEL -ALL +NOTICES + /WINDOW HIDELEVEL ^JOINS ^PARTS ^QUITS /WINDOW LOGFILE ~/logs/notices.log %9See also:%9 JOIN, LEVELS, LOG, QUERY diff --git a/src/core/levels.c b/src/core/levels.c index e62bc68c..62d7a00a 100644 --- a/src/core/levels.c +++ b/src/core/levels.c @@ -181,13 +181,15 @@ int combine_level(int dest, const char *src) list = g_strsplit(src, " ", -1); for (item = list; *item != NULL; item++) { - itemname = *item + (**item == '+' || **item == '-' ? 1 : 0); + itemname = *item + (**item == '+' || **item == '-' || **item == '^' ? 1 : 0); itemlevel = level_get(itemname); - if (g_strcmp0(itemname, "NONE") == 0) - dest = 0; + if (g_ascii_strcasecmp(itemname, "NONE") == 0) + dest = 0; else if (**item == '-') dest &= ~(itemlevel); + else if (**item == '^') + dest ^= itemlevel; else dest |= itemlevel; } diff --git a/src/fe-common/core/window-commands.c b/src/fe-common/core/window-commands.c index 7c542d37..6669ba43 100644 --- a/src/fe-common/core/window-commands.c +++ b/src/fe-common/core/window-commands.c @@ -400,7 +400,7 @@ static void cmd_window_previous(void) window_set_active(window_find_refnum(num)); } -/* SYNTAX: WINDOW LEVEL [] */ +/* SYNTAX: WINDOW LEVEL [] */ static void cmd_window_level(const char *data) { char *level; diff --git a/src/fe-text/textbuffer-commands.c b/src/fe-text/textbuffer-commands.c index 6ed7c39c..3d1d963b 100644 --- a/src/fe-text/textbuffer-commands.c +++ b/src/fe-text/textbuffer-commands.c @@ -93,7 +93,7 @@ static void cmd_window_scroll(const char *data) gui->scroll : settings_get_bool("scroll")); } -/* SYNTAX: WINDOW HIDELEVEL [] */ +/* SYNTAX: WINDOW HIDELEVEL [] */ static void cmd_window_hidelevel(const char *data) { GUI_WINDOW_REC *gui; From 8a8fb7740854097b2b300958f532f7e92853f557 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Sun, 18 Dec 2022 12:14:22 +0100 Subject: [PATCH 05/19] Merge pull request #1429 from ailin-nemui/docs-revamp remove ported sections from manual and add links (cherry picked from commit 42f83fc130caa4349646ea967ffafa4de4006024) --- docs/manual.txt | 137 ++++++++++-------------------------------------- 1 file changed, 29 insertions(+), 108 deletions(-) diff --git a/docs/manual.txt b/docs/manual.txt index 5f0eac51..d55e362e 100644 --- a/docs/manual.txt +++ b/docs/manual.txt @@ -18,16 +18,16 @@ 9. Text highlighting 10. Ignoring 11. Logging + 12. Commands + 14. Last log (currently text version only) + 15. Word completion + 16. Recode + 18. Key bindings (text version) + 19. Perl scripting ( not written yet: ) - 12. Commands 13. Themes - 14. Last log (currently text version only) - 15. Nick and word completion - 16. Recode 17. Windowing system (text version) - 18. Keyboard (text version) - 19. Perl scripting @@ -141,44 +141,7 @@ --hostname -h Specify what host name to use - 2. Message levels - - - Message levels (or in short, levels) are used almost everywhere. - They describe what kind of messages we're dealing with. Here's a - list of them all: - - CRAP - Can be almost anything - MSGS - Private messages - PUBLIC - Public messages in channel - NOTICES - Notices - SNOTES - Server notices - CTCPS - CTCP messages - ACTIONS - Actions (/me) - usually ORed with PUBLIC or MSGS - JOINS - Someone joins a channel - PARTS - Someone parts a channel - QUITS - Someone quits IRC - KICKS - Someone gets kicked from channel - MODES - Channel mode is changed - TOPICS - Channel topic is changed - WALLOPS - Wallop is received - INVITES - Invite is received - NICKS - Someone changes nick - DCC - DCC related messages - DCCMSGS - DCC chat messages - CLIENTNOTICES - Irssi's notices - CLIENTERRORS - Irssi's error messages - CLIENTCRAP - Some other messages from Irssi - - And a few special ones that could be included with the - levels above: - - HILIGHT - Text is highlighted - NOHILIGHT - Don't check highlighting for this message - NO_ACT - Don't trigger channel activity when printing - this message - NEVER - Never ignore or log this message - + 2. Message levels 3. Flood protection @@ -252,47 +215,12 @@ Currently only messages, notices and ctcps are checked for flooding. - /SET flood_max_msgs = , default is 4 - /SET flood_timecheck = , default is 5 seconds + /SET flood_max_msgs , default is 4 + /SET flood_timecheck , default is 5 seconds If either of these is 0, the flood checking is disabled. - 4. Configuration - - 4.1 Configuration files - - The configuration is saved to ~/.irssi/config file. You can edit - it with text editor if you want, you can also add comments to it - and they stay there even if /SAVE is used. Comments are the lines - starting with # character. Any errors in config file are displayed - at startup. - - Irssi uses it's own config library for handling the config file. - The format is pretty much the same as in libPropList and should be - easily understandable. - - You can reload the config file on the fly with /RELOAD command, you - can also read a different config file with /RELOAD . - - If you change any settings, they aren't saved to file until you use - /SAVE. You can save the config file to different place with - /SAVE . - - 4.2 Settings - - You can view or change the settings with /SET command. - - /SET without any arguments displays all the settings. - /SET displays settings which key (partly) matches - /SET sets to - - Boolean settings accepts only values ON, OFF and TOGGLE. You can - also use /TOGGLE command to change them, so /TOGGLE behaves - like /SET TOGGLE. /TOGGLE also accepts arguments ON and OFF - when /TOGGLE behaves exactly like /SET. - - Remember that changes are not saved until you use /SAVE! - + 4. Configuration 5. Servers @@ -367,11 +295,11 @@ you setup the server using /SERVER ADD (see next section). If the settings can't be found there either, Irssi will use the defaults: - /SET default_nick = , defaults to user_name - /SET alternate_nick = , defaults to _ - /SET user_name = , defaults to your login name - /SET real_name = , taken from /etc/passwd by default - /SET hostname = , what host name to use when connecting + /SET default_nick , defaults to user_name + /SET alternate_nick , defaults to _ + /SET user_name , defaults to your login name + /SET real_name , taken from /etc/passwd by default + /SET hostname , what host name to use when connecting /SET skip_motd ON|OFF|TOGGLE - Don't show server's MOTD NOTE: /CONNECT is also a command for IRC operators to connect IRC @@ -792,13 +720,7 @@ /SET massjoin_max_joins . - 7. IRC commands and features (FIXME) - - 7.x Basic commands - - 7.x IRC operator commands - - 7.x Away features + 7. IRC commands and features 8. Notify list @@ -846,9 +768,9 @@ /HILIGHT without any arguments displays list of the hilights. -If is a - number, Irssi will treat it as a MIRC color code. You can also use - bolds (^B), underlines (^_) etc. as if you like. + If is a number, Irssi will treat it as a MIRC color + code. You can also use bolds (^B), underlines (^_) etc. as + if you like. 10. Ignoring @@ -993,29 +915,24 @@ If is a You can disable this feature by setting awaylog_level to NONE. - 12. Commands + 12. Commands - Any char in the `cmdchars' setting can begin a command. The - syntax for a command is the following: + 13. Themes - [][^] + 14. Last log - If is repeated two times, alias expansion is - disabled, enabled otherwise. If `^' is present, command output - is disabled. If begins with a space, command lookup is - inhibited and the data is sent to the active window item - (useful to send a line that begins with ). + 15. Word completion 16. Recode - irssi supports selective encoding of incoming/outgoing messages + Irssi supports selective encoding of incoming/outgoing messages through the recode system. All incoming/outgoing messages can be optionally converted to/from the charset specified by the `term_charset' variable (which defaults to the locale encoding and should _not_ be changed in most cases), by setting the `recode' variable to 'ON'. Since there is no way in IRC to know the encoding associated to a - message, for incoming messages irssi uses the following algorithm: + message, for incoming messages Irssi uses the following algorithm: if `recode_autodetect_utf8' is 'ON' and the message is valid UTF-8 the encoding is assumed to be UTF-8. @@ -1032,5 +949,9 @@ If is a iconv specific extension to peform transliteration (locale dependent) when a character is not representable in the destination encoding. + 18. Key bindings + + 19. Scripting + .. no, the docs end here, I got bored of writing these after a few days and haven't touched these since then. From f422b9861390240bb2b8e2eac6d9dd8a2016cd4e Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Sun, 18 Dec 2022 12:27:29 +0100 Subject: [PATCH 06/19] Merge pull request #1431 from ailin-nemui/missing-news add missing news reference (cherry picked from commit f8500320cf0c14556d62c03ebb9e502793b4dd90) --- NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 06960d6e..af46e8fc 100644 --- a/NEWS +++ b/NEWS @@ -112,7 +112,7 @@ v1.4.1 2022-06-12 The Irssi team * Channel sync requests (WHO, MODE) are now sent "later" than user commands. This should improve responsiveness to user - commands in the autojoin phase (an#26, an#32, an#33) + commands in the autojoin phase (#1300, an#26, an#32, an#33) * Irssi is now using full paths in #include directives and consequently does not add all directories to the include path anymore (#1040) From 473cf8ca3fd57d97f6035c3ddaf848f1b386bc83 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Fri, 23 Dec 2022 10:34:56 +0100 Subject: [PATCH 07/19] Merge pull request #1432 from horgh/horgh/win-logfile Check window logfile parameter (cherry picked from commit 6f5026fd494948b03264d18095638dbecdb1a525) --- src/fe-common/core/fe-log.c | 155 ++++++++++++++++++------------------ 1 file changed, 78 insertions(+), 77 deletions(-) diff --git a/src/fe-common/core/fe-log.c b/src/fe-common/core/fe-log.c index 984b3548..164036c1 100644 --- a/src/fe-common/core/fe-log.c +++ b/src/fe-common/core/fe-log.c @@ -60,15 +60,15 @@ static char **autolog_ignore_targets; static char *log_colorizer_strip(const char *str) { - return strip_codes(str); + return strip_codes(str); } static void log_add_targets(LOG_REC *log, const char *targets, const char *tag) { char **tmp, **items; - g_return_if_fail(log != NULL); - g_return_if_fail(targets != NULL); + g_return_if_fail(log != NULL); + g_return_if_fail(targets != NULL); items = g_strsplit(targets, " ", -1); @@ -83,18 +83,18 @@ static void log_add_targets(LOG_REC *log, const char *targets, const char *tag) [] */ static void cmd_log_open(const char *data) { - SERVER_REC *server; - GHashTable *optlist; + SERVER_REC *server; + GHashTable *optlist; char *targetarg, *fname, *levels, *servertag; void *free_arg; char window[MAX_INT_STRLEN]; LOG_REC *log; int level; - if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST | - PARAM_FLAG_UNKNOWN_OPTIONS | PARAM_FLAG_OPTIONS | - PARAM_FLAG_STRIP_TRAILING_WS, "log open", &optlist, - &fname, &levels)) + if (!cmd_get_params(data, &free_arg, + 2 | PARAM_FLAG_GETREST | PARAM_FLAG_UNKNOWN_OPTIONS | + PARAM_FLAG_OPTIONS | PARAM_FLAG_STRIP_TRAILING_WS, + "log open", &optlist, &fname, &levels)) return; if (*fname == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS); @@ -112,8 +112,7 @@ static void cmd_log_open(const char *data) ltoa(window, active_win->refnum); targetarg = window; } - log_item_add(log, LOG_ITEM_WINDOW_REFNUM, targetarg, - servertag); + log_item_add(log, LOG_ITEM_WINDOW_REFNUM, targetarg, servertag); } else { targetarg = g_hash_table_lookup(optlist, "targets"); if (targetarg != NULL && *targetarg != '\0') @@ -133,14 +132,13 @@ static void cmd_log_open(const char *data) if (log->handle == -1 && g_hash_table_lookup(optlist, "noopen") == NULL) { /* start logging */ if (log_start_logging(log)) { - printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, - TXT_LOG_OPENED, fname); + printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_LOG_OPENED, fname); } else { log_close(log); } } - cmd_params_free(free_arg); + cmd_params_free(free_arg); } static LOG_REC *log_find_from_data(const char *data) @@ -209,7 +207,7 @@ static char *log_items_get_list(LOG_REC *log) for (tmp = log->items; tmp != NULL; tmp = tmp->next) { rec = tmp->data; - g_string_append_printf(str, "%s, ", rec->name); + g_string_append_printf(str, "%s, ", rec->name); } g_string_truncate(str, str->len-2); if(rec->servertag != NULL) @@ -231,13 +229,11 @@ static void cmd_log_list(void) LOG_REC *rec = tmp->data; levelstr = bits2level(rec->level); - items = rec->items == NULL ? NULL : - log_items_get_list(rec); + items = rec->items == NULL ? NULL : log_items_get_list(rec); - printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_LOG_LIST, - index, rec->fname, items != NULL ? items : "", - levelstr, rec->autoopen ? " -autoopen" : "", - rec->handle != -1 ? " active" : ""); + printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_LOG_LIST, index, rec->fname, + items != NULL ? items : "", levelstr, rec->autoopen ? " -autoopen" : "", + rec->handle != -1 ? " active" : ""); g_free_not_null(items); g_free(levelstr); @@ -253,8 +249,8 @@ static void cmd_log(const char *data, SERVER_REC *server, void *item) command_runsub("log", data, server, item); } -static LOG_REC *logs_find_item(int type, const char *item, - const char *servertag, LOG_ITEM_REC **ret_item) +static LOG_REC *logs_find_item(int type, const char *item, const char *servertag, + LOG_ITEM_REC **ret_item) { LOG_ITEM_REC *logitem; GSList *tmp; @@ -284,17 +280,17 @@ static void cmd_window_log(const char *data) if (!cmd_get_params(data, &free_arg, 2, &set, &fname)) return; - ltoa(window, active_win->refnum); + ltoa(window, active_win->refnum); log = logs_find_item(LOG_ITEM_WINDOW_REFNUM, window, NULL, NULL); - open_log = close_log = FALSE; + open_log = close_log = FALSE; if (g_ascii_strcasecmp(set, "ON") == 0) open_log = TRUE; else if (g_ascii_strcasecmp(set, "OFF") == 0) { close_log = TRUE; } else if (g_ascii_strcasecmp(set, "TOGGLE") == 0) { - open_log = log == NULL; - close_log = log != NULL; + open_log = log == NULL; + close_log = log != NULL; } else { printformat(NULL, NULL, MSGLEVEL_CLIENTERROR, TXT_NOT_TOGGLE); cmd_params_free(free_arg); @@ -309,7 +305,7 @@ static void cmd_window_log(const char *data) active_win->name != NULL ? "" : window); log = log_create_rec(fname, MSGLEVEL_ALL); log->colorizer = log_colorizer_strip; - log_item_add(log, LOG_ITEM_WINDOW_REFNUM, window, NULL); + log_item_add(log, LOG_ITEM_WINDOW_REFNUM, window, NULL); log_update(log); g_free(fname); } @@ -322,7 +318,7 @@ static void cmd_window_log(const char *data) printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_LOG_CLOSED, log->fname); } - cmd_params_free(free_arg); + cmd_params_free(free_arg); } /* Create log file entry to window, but don't start logging */ @@ -331,21 +327,34 @@ static void cmd_window_logfile(const char *data) { LOG_REC *log; char window[MAX_INT_STRLEN]; + void *free_arg; + char *fname; - ltoa(window, active_win->refnum); + if (!cmd_get_params(data, &free_arg, 1, &fname)) { + return; + } + + if (!fname || strlen(fname) == 0) { + cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS); + } + + ltoa(window, active_win->refnum); log = logs_find_item(LOG_ITEM_WINDOW_REFNUM, window, NULL, NULL); if (log != NULL) { printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_WINDOWLOG_FILE_LOGGING); + cmd_params_free(free_arg); return; } - log = log_create_rec(data, MSGLEVEL_ALL); + log = log_create_rec(fname, MSGLEVEL_ALL); log->colorizer = log_colorizer_strip; log_item_add(log, LOG_ITEM_WINDOW_REFNUM, window, NULL); log_update(log); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_WINDOWLOG_FILE, data); + + cmd_params_free(free_arg); } /* window's refnum changed - update the logs to log the new window refnum */ @@ -355,7 +364,7 @@ static void sig_window_refnum_changed(WINDOW_REC *window, gpointer old_refnum) LOG_REC *log; LOG_ITEM_REC *item; - ltoa(winnum, GPOINTER_TO_INT(old_refnum)); + ltoa(winnum, GPOINTER_TO_INT(old_refnum)); log = logs_find_item(LOG_ITEM_WINDOW_REFNUM, winnum, NULL, &item); if (log != NULL) { @@ -368,7 +377,7 @@ static void sig_window_refnum_changed(WINDOW_REC *window, gpointer old_refnum) static void sig_server_disconnected(SERVER_REC *server) { - LOG_ITEM_REC *logitem; + LOG_ITEM_REC *logitem; GSList *tmp, *next; for (tmp = logs; tmp != NULL; tmp = next) { @@ -376,13 +385,13 @@ static void sig_server_disconnected(SERVER_REC *server) next = tmp->next; if (!log->temp || log->items == NULL) - continue; + continue; logitem = log->items->data; - if (logitem->type == LOG_ITEM_TARGET && - logitem->servertag != NULL && + if (logitem->type == LOG_ITEM_TARGET && logitem->servertag != NULL && g_ascii_strcasecmp(logitem->servertag, server->tag) == 0 && - server_ischannel(server, logitem->name)) /* kludge again.. so we won't close dcc chats */ + server_ischannel( + server, logitem->name)) /* kludge again.. so we won't close dcc chats */ log_close(log); } } @@ -414,15 +423,14 @@ static char *escape_target(const char *target) *p++ = *target; } - target++; + target++; } *p = '\0'; - return str; + return str; } -static void autolog_open(SERVER_REC *server, const char *server_tag, - const char *target) +static void autolog_open(SERVER_REC *server, const char *server_tag, const char *target) { LOG_REC *log; char *fname, *dir, *fixed_target, *params; @@ -443,17 +451,16 @@ static void autolog_open(SERVER_REC *server, const char *server_tag, if (CHAT_PROTOCOL(server)->case_insensitive) ascii_strdown(fixed_target); - /* $0 = target, $1 = server tag */ - params = g_strconcat(fixed_target, " ", server_tag, NULL); + /* $0 = target, $1 = server tag */ + params = g_strconcat(fixed_target, " ", server_tag, NULL); g_free(fixed_target); - fname = parse_special_string(autolog_path, server, NULL, - params, NULL, 0); + fname = parse_special_string(autolog_path, server, NULL, params, NULL, 0); g_free(params); if (log_find(fname) == NULL) { log = log_create_rec(fname, autolog_level); - if (!settings_get_bool("autolog_colors")) + if (!settings_get_bool("autolog_colors")) log->colorizer = log_colorizer_strip; log_item_add(log, LOG_ITEM_TARGET, target, server_tag); @@ -484,8 +491,8 @@ static void autolog_open_check(TEXT_DEST_REC *dest) we're parting the channel with /WINDOW CLOSE.. Maybe a small timeout would be nice instead of immediately closing the log file after "window item destroyed" */ - if (level == MSGLEVEL_PARTS || - (autolog_level & level) == 0 || target == NULL || *target == '\0') + if (level == MSGLEVEL_PARTS || (autolog_level & level) == 0 || target == NULL || + *target == '\0') return; deftarget = server ? server->nick : "unknown"; @@ -495,8 +502,7 @@ static void autolog_open_check(TEXT_DEST_REC *dest) && channel_setup_find(target, server_tag) == NULL) return; - if (autolog_ignore_targets != NULL && - strarray_find_dest(autolog_ignore_targets, dest)) + if (autolog_ignore_targets != NULL && strarray_find_dest(autolog_ignore_targets, dest)) return; if (target != NULL) @@ -512,8 +518,7 @@ static void log_single_line(WINDOW_REC *window, const char *server_tag, const ch if (window != NULL) { /* save to log created with /WINDOW LOG */ ltoa(windownum, window->refnum); - log = logs_find_item(LOG_ITEM_WINDOW_REFNUM, - windownum, NULL, NULL); + log = logs_find_item(LOG_ITEM_WINDOW_REFNUM, windownum, NULL, NULL); if (log != NULL) log_write_rec(log, text, level, t); } @@ -553,8 +558,7 @@ static void log_line(TEXT_DEST_REC *dest, const char *text) g_strfreev(lines); } -static void sig_printtext(TEXT_DEST_REC *dest, const char *text, - const char *stripped) +static void sig_printtext(TEXT_DEST_REC *dest, const char *text, const char *stripped) { if (skip_next_printtext) { skip_next_printtext = FALSE; @@ -564,8 +568,8 @@ static void sig_printtext(TEXT_DEST_REC *dest, const char *text, log_line(dest, text); } -static void sig_print_format(THEME_REC *theme, const char *module, - TEXT_DEST_REC *dest, void *formatnum, char **args) +static void sig_print_format(THEME_REC *theme, const char *module, TEXT_DEST_REC *dest, + void *formatnum, char **args) { char *str, *linestart, *tmp; @@ -579,14 +583,14 @@ static void sig_print_format(THEME_REC *theme, const char *module, if (theme == log_theme) return; - str = format_get_text_theme_charargs(log_theme, module, dest, - GPOINTER_TO_INT(formatnum), args); + str = format_get_text_theme_charargs(log_theme, module, dest, GPOINTER_TO_INT(formatnum), + args); if (str != NULL && *str != '\0') { skip_next_printtext = TRUE; /* add the line start format */ linestart = format_get_level_tag(log_theme, dest); - tmp = str; + tmp = str; str = format_add_linestart(tmp, linestart); g_free_not_null(linestart); g_free(tmp); @@ -605,14 +609,14 @@ static int sig_autoremove(void) GSList *tmp, *next; time_t removetime; - removetime = time(NULL)-AUTOLOG_INACTIVITY_CLOSE; + removetime = time(NULL) - AUTOLOG_INACTIVITY_CLOSE; for (tmp = logs; tmp != NULL; tmp = next) { LOG_REC *log = tmp->data; next = tmp->next; if (!log->temp || log->last > removetime || log->items == NULL) - continue; + continue; /* Close only logs with private messages */ logitem = log->items->data; @@ -620,8 +624,8 @@ static int sig_autoremove(void) continue; server = server_find_tag(logitem->servertag); - if (logitem->type == LOG_ITEM_TARGET && - server != NULL && !server_ischannel(server, logitem->name)) + if (logitem->type == LOG_ITEM_TARGET && server != NULL && + !server_ischannel(server, logitem->name)) log_close(log); } return 1; @@ -632,43 +636,40 @@ static void sig_window_item_remove(WINDOW_REC *window, WI_ITEM_REC *item) LOG_REC *log; log = logs_find_item(LOG_ITEM_TARGET, item->visible_name, - item->server == NULL ? NULL : - item->server->tag, NULL); + item->server == NULL ? NULL : item->server->tag, NULL); if (log != NULL && log->temp) log_close(log); } static void sig_log_locked(LOG_REC *log) { - printformat(NULL, NULL, MSGLEVEL_CLIENTERROR, - TXT_LOG_LOCKED, log->real_fname); + printformat(NULL, NULL, MSGLEVEL_CLIENTERROR, TXT_LOG_LOCKED, log->real_fname); } static void sig_log_create_failed(LOG_REC *log) { - printformat(NULL, NULL, MSGLEVEL_CLIENTERROR, - TXT_LOG_CREATE_FAILED, - log->real_fname, g_strerror(errno)); + printformat(NULL, NULL, MSGLEVEL_CLIENTERROR, TXT_LOG_CREATE_FAILED, log->real_fname, + g_strerror(errno)); } static void sig_log_new(LOG_REC *log) { if (!settings_get_bool("awaylog_colors") && g_strcmp0(log->fname, settings_get_str("awaylog_file")) == 0) - log->colorizer = log_colorizer_strip; + log->colorizer = log_colorizer_strip; } static void sig_log_config_read(LOG_REC *log, CONFIG_NODE *node) { - if (!config_node_get_bool(node, "colors", FALSE)) + if (!config_node_get_bool(node, "colors", FALSE)) log->colorizer = log_colorizer_strip; } static void sig_log_config_save(LOG_REC *log, CONFIG_NODE *node) { - if (log->colorizer == NULL) + if (log->colorizer == NULL) iconfig_node_set_bool(node, "colors", TRUE); - else + else iconfig_node_set_str(node, "colors", NULL); } @@ -685,7 +686,7 @@ static void sig_awaylog_show(LOG_REC *log, gpointer pmsgs, gpointer pfilepos) else { printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_LOG_AWAY_MSGS, log->real_fname, msgs); - str = g_strdup_printf("\"%s\" %d", log->real_fname, filepos); + str = g_strdup_printf("\"%s\" %d", log->real_fname, filepos); signal_emit("command cat", 1, str); g_free(str); } @@ -746,13 +747,13 @@ void fe_log_init(void) skip_next_printtext = FALSE; settings_add_bool("log", "awaylog_colors", TRUE); - settings_add_bool("log", "autolog", FALSE); + settings_add_bool("log", "autolog", FALSE); settings_add_bool("log", "autolog_colors", FALSE); settings_add_bool("log", "autolog_only_saved_channels", FALSE); settings_add_choice("log", "log_server_time", 2, "off;on;auto"); settings_add_str("log", "autolog_path", "~/irclogs/$tag/$0.log"); settings_add_level("log", "autolog_level", "all -crap -clientcrap -ctcps"); - settings_add_str("log", "log_theme", ""); + settings_add_str("log", "log_theme", ""); settings_add_str("log", "autolog_ignore_targets", ""); autolog_level = 0; From af8e40b744a30b80f8f4749d4e3dcfccc39763e6 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Sun, 18 Dec 2022 21:53:34 +0100 Subject: [PATCH 08/19] Merge pull request #1434 from irssi/ailin-nemui/statusbar-help correct statusbar help text (cherry picked from commit 7445ad1f1538986b5be26af9cd658aecaa7887f6) --- docs/help/in/statusbar.in | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/docs/help/in/statusbar.in b/docs/help/in/statusbar.in index a5626d46..ac57ca5f 100644 --- a/docs/help/in/statusbar.in +++ b/docs/help/in/statusbar.in @@ -10,7 +10,7 @@ RESET: Restores the default statusbar configuration. ADDITEM: Adds an item to the specified statusbar. It can be set to appear before/after another item and left/right aligned - to a specified position on the screen. + on the screen. MODIFYITEM: Changes an item position inside a bar. REMOVEITEM: Removes an item from the specified statusbar. INFO: List the current details and items of the specified @@ -18,15 +18,16 @@ -disable: Removes a statusbar from the list. -type: Sets the type of statusbar, for each split window or only - for the current root screen. + once at the root (very top or bottom) of the screen. -placement: Sets the placement of the statusbar, either at the top or - the bottom of the screen. + the bottom of the screen or split window. -position: Sets the position of the statusbar. Represented as a - number, with 0 implying the first position. - -visible: Sets the visibility of the statusbar or item. If set to - always it is visible on all screens, otherwise if set to - inactive or active then it is only visible on inactive - or active screens, respectively. + number, with smaller numbers implying a position further + to the top. + -visible: Sets the visibility of the statusbar. If set to always, + it is visible on all split windows, otherwise if set to + inactive or active then it is only visible on inactive or + active split windows, respectively. -before: This item is added before the other item. -after: This item is added after the other item. -priority: When the statusbar items overflow, the item with the From 0438c7f0b2def0ae5d7e1dd56f980a472fa6e6a8 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Sun, 25 Dec 2022 17:51:32 +0100 Subject: [PATCH 09/19] Merge pull request #1438 from qoreQyaS/master Lang-Fix: Use more general messages (cherry picked from commit 162dc256be8f47de2491c0587e28ab21805f348a) --- src/fe-common/core/module-formats.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fe-common/core/module-formats.c b/src/fe-common/core/module-formats.c index 8c10f420..c4d9be96 100644 --- a/src/fe-common/core/module-formats.c +++ b/src/fe-common/core/module-formats.c @@ -39,9 +39,9 @@ FORMAT_REC fecommon_core_formats[] = { { "set_server_sticky", "Window's server set sticky", 1, { 0 } }, { "unset_server_sticky", "Window's server isn't sticky anymore", 0 }, { "window_name_not_unique", "Window names must be unique", 1, { 0 } }, - { "window_level", "Window level is now $0", 1, { 0 } }, - { "window_set_immortal", "Window is now immortal", 0 }, - { "window_unset_immortal", "Window isn't immortal anymore", 0 }, + { "window_level", "Window level is $0", 1, { 0 } }, + { "window_set_immortal", "Window is immortal", 0 }, + { "window_unset_immortal", "Window isn't immortal", 0 }, { "window_immortal_error", "Window is immortal, if you really want to close it, say /WINDOW IMMORTAL OFF", 0 }, { "windowlist_header", "%#Ref Name Active item Server Level", 0 }, { "windowlist_line", "%#$[4]0 %|$[20]1 $[15]2 $[15]3 $4", 5, { 1, 0, 0, 0, 0 } }, From 2f0a16556950e71cc79a72ee8ce4b966ab8f711e Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Sat, 21 Jan 2023 16:48:36 +0100 Subject: [PATCH 10/19] Merge pull request #1439 from irssi/from-codeberg Sync (cherry picked from commit de43e9e067be52c7773a25d5016e2ab7da585c78) --- meson.build | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 6bbfbced..fe8d4b21 100644 --- a/meson.build +++ b/meson.build @@ -594,7 +594,10 @@ pc.generate(filebase : 'irssi-1', description : 'Irssi chat client', version : package_version, requires : pc_requires, - variables : ['irssimoduledir=${libdir}' / incdir / 'modules']) + variables : [ + 'irssimoduledir=${libdir}' / incdir / 'modules', + 'signalsfile=${prefix}' / docdir / 'signals.txt' + ]) ########### # irssi.1 # From 377824ae7fd064ff21d8602ab007de6147b9717c Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Thu, 2 Feb 2023 17:03:53 +0100 Subject: [PATCH 11/19] Merge pull request #1442 from lheckemann/master Support receiving monospace (cherry picked from commit c06be88d8f107f1890402a266735bc0659dd6021) --- src/fe-common/core/formats.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/fe-common/core/formats.c b/src/fe-common/core/formats.c index b660b616..0c8b3088 100644 --- a/src/fe-common/core/formats.c +++ b/src/fe-common/core/formats.c @@ -1303,7 +1303,7 @@ static void get_mirc_color(const char **str, int *fg_ret, int *bg_ret) #define IS_COLOR_CODE(c) \ ((c) == 2 || (c) == 3 || (c) == 4 || (c) == 6 || (c) == 7 || \ - (c) == 15 || (c) == 22 || (c) == 27 || (c) == 29 || (c) == 31) + (c) == 15 || (c) == 17 || (c) == 22 || (c) == 27 || (c) == 29 || (c) == 31) /* Return how many characters in `str' must be skipped before `len' characters of text is skipped. */ @@ -1585,6 +1585,10 @@ void format_send_as_gui_flags(TEXT_DEST_REC *dest, const char *text, SIGNAL_FUNC bgcolor = -1; flags &= GUI_PRINT_FLAG_INDENT|GUI_PRINT_FLAG_MONOSPACE; break; + case 17: + if (!hide_text_style) + flags ^= GUI_PRINT_FLAG_MONOSPACE; + break; case 22: /* reverse */ if (!hide_text_style) From 82618ce25dc1b616c3307ae3b6a6b7f7e630e605 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Sun, 12 Feb 2023 13:51:44 +0000 Subject: [PATCH 12/19] Merge pull request #1446 from ailin-nemui/signalsfile-fix fix signals file (cherry picked from commit 2ac1f01b9486725cf9f7c20595b4912188104e04) --- meson.build | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index fe8d4b21..c4aad2fa 100644 --- a/meson.build +++ b/meson.build @@ -589,6 +589,12 @@ pc_requires = [] if not glib_internal pc_requires += glib_dep endif +signalsfile = docdir / 'signals.txt' +if signalsfile.startswith('/') + signalsfile = signalsfile.replace(get_option('prefix'), '${prefix}') +else + signalsfile = '${prefix}' / signalsfile +endif pc.generate(filebase : 'irssi-1', name : 'Irssi', description : 'Irssi chat client', @@ -596,7 +602,7 @@ pc.generate(filebase : 'irssi-1', requires : pc_requires, variables : [ 'irssimoduledir=${libdir}' / incdir / 'modules', - 'signalsfile=${prefix}' / docdir / 'signals.txt' + 'signalsfile=' + signalsfile ]) ########### From 75fd59608431cce4b306cbcc059b3cb7b061c3c6 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Mon, 13 Feb 2023 08:51:33 +0000 Subject: [PATCH 13/19] Merge pull request #1447 from ailin-nemui/signalsfile-fix fix signalsfile some more (cherry picked from commit c1fd4b17f53f7627cacb63f478af627bec1581c9) --- meson.build | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index c4aad2fa..1a8c23f3 100644 --- a/meson.build +++ b/meson.build @@ -591,7 +591,12 @@ if not glib_internal endif signalsfile = docdir / 'signals.txt' if signalsfile.startswith('/') - signalsfile = signalsfile.replace(get_option('prefix'), '${prefix}') + signalsfile = signalsfile.split(get_option('prefix')) + if signalsfile[0] == '' + signalsfile = '${prefix}' + signalsfile[1] + else + signalsfile = signalsfile[0] + endif else signalsfile = '${prefix}' / signalsfile endif From d1319b422bf90e261843ea59c05258ac39974aca Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Mon, 20 Mar 2023 19:31:56 +0000 Subject: [PATCH 14/19] Merge pull request #1452 from irssi/vague666-levels-in-update Update levels.in (cherry picked from commit 1c9990acab3e3fb162a3c1ad4936b0f2678ef07d) --- docs/help/in/levels.in | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/help/in/levels.in b/docs/help/in/levels.in index 99f3070a..b6eb9fbf 100644 --- a/docs/help/in/levels.in +++ b/docs/help/in/levels.in @@ -35,6 +35,7 @@ HIDDEN Hides the message when window HIDELEVEL includes HIDDEN. NO_ACT Doesn't trigger any activity in the statusbar. NOHILIGHT The text is not highlighted. + Suppresses hilights when used with /ignore. When using levels from Irssi scripts, you need to prepend the level with 'MSGLEVEL_'; for example 'CRAP' becomes 'MSGLEVEL_CRAP'. From 38a80b21eaa98be2bbe3046dfa04f691457a505f Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Mon, 20 Mar 2023 19:31:40 +0000 Subject: [PATCH 15/19] Merge pull request #1453 from irssi/vague666-ignore-in-update Update ignore.in (cherry picked from commit 706b6fff819b53ee97cc365c453b5f6ce1b461d2) --- docs/help/in/ignore.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/help/in/ignore.in b/docs/help/in/ignore.in index 433490e1..351c0411 100644 --- a/docs/help/in/ignore.in +++ b/docs/help/in/ignore.in @@ -29,6 +29,8 @@ because it is allowed in addition to other ignores for the same target. The special level 'HIDDEN' can be used to hide matching messages that can later be revealed using /WINDOW HIDELEVEL -HIDDEN + The special level 'NOHILIGHT' can be used to supress hilights without actually + ignoring the message. %9Examples:%9 From 6d3284f7e9259aec81ccd431ddb1a27212388d58 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Tue, 21 Mar 2023 07:05:33 +0000 Subject: [PATCH 16/19] Merge pull request #1454 from irssi/from-codeberg Sync (cherry picked from commit 2b91c45f5d7088861f5355f13b3d9a6ea304c781) --- src/fe-common/irc/fe-irc-messages.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fe-common/irc/fe-irc-messages.c b/src/fe-common/irc/fe-irc-messages.c index 2e71b34f..1419f934 100644 --- a/src/fe-common/irc/fe-irc-messages.c +++ b/src/fe-common/irc/fe-irc-messages.c @@ -208,7 +208,7 @@ static void sig_message_irc_action(IRC_SERVER_REC *server, const char *msg, return; if (server_ischannel(SERVER(server), target)) { - item = irc_channel_find(server, target); + item = channel_find(SERVER(server), target); } else { own = (!g_strcmp0(nick, server->nick)); item = privmsg_get_query(SERVER(server), own ? target : nick, FALSE, level); From 9948a18fce9a075923c20249194d4e948424b9ff Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Tue, 21 Mar 2023 08:49:09 +0000 Subject: [PATCH 17/19] Merge pull request #1455 from irssi/vague666-typo-fix Update ignore.in (cherry picked from commit 6671fec9a91dc61981ea0554525bf1a68be10999) --- docs/help/in/ignore.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/help/in/ignore.in b/docs/help/in/ignore.in index 351c0411..26dd63bb 100644 --- a/docs/help/in/ignore.in +++ b/docs/help/in/ignore.in @@ -29,7 +29,7 @@ because it is allowed in addition to other ignores for the same target. The special level 'HIDDEN' can be used to hide matching messages that can later be revealed using /WINDOW HIDELEVEL -HIDDEN - The special level 'NOHILIGHT' can be used to supress hilights without actually + The special level 'NOHILIGHT' can be used to suppress hilights without actually ignoring the message. %9Examples:%9 From 78d00b99b431bd194bf5aa06e0252421d217483e Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Mon, 27 Mar 2023 20:46:56 +0000 Subject: [PATCH 18/19] Merge pull request #1456 from ailin-nemui/collector fix stale special collector use after free (cherry picked from commit c03057f36a2abd37a1176da2890d89116bab5139) --- src/fe-text/textbuffer-formats.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/fe-text/textbuffer-formats.c b/src/fe-text/textbuffer-formats.c index 50d6250a..ce104c2d 100644 --- a/src/fe-text/textbuffer-formats.c +++ b/src/fe-text/textbuffer-formats.c @@ -213,7 +213,6 @@ static void sig_print_noformat(TEXT_DEST_REC *dest, const char *text) if (!scrollback_format) return; - special_push_collector(NULL); info = store_lineinfo_tmp(dest); info->format = format_rec_new(NULL, NULL, 2, (const char *[]){ NULL, text }); From a09fcb90930c3f0d9e6bdf660dd01c451e817e46 Mon Sep 17 00:00:00 2001 From: Ailin Nemui Date: Tue, 28 Mar 2023 14:12:28 +0200 Subject: [PATCH 19/19] tag as 1.4.4 --- NEWS | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/NEWS b/NEWS index af46e8fc..63aea544 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,22 @@ +v1.4.4 2023-03-31 The Irssi team + * Expose location of signals.txt via pkg-config (codeberg!1, + #1439, #1446, #1447). By Andrej Kacian + + Levels can now be inverted using `^' prefix in the /WINDOW + (HIDE)LEVEL commands (#1428) + + Support receiving monospace (#1370, #1442). By Linus + Heckemann + - Fix config broken by /WINDOW LOGFILE without parameter + (#1392, #1432) + - Fix broken /LASTLOG -window switch (#1418, #1424, regression + introduced in #1398) + - Fix logic in how actions are printed for other protocols + (codeberg!3, #1454). By Andrej Kacian + - Fix stale special collector use after free (#1456). Reported + by ednash + - Help and message fixes (#1421, #1429, #1431, #1434, #1438, + #1452, #1453, #1455). Includes work by Jimmie Tyrrell and + Sven Grewe + v1.4.3 2022-10-31 The Irssi team - Fix freeze on Alt+arrows (#1416, #1417) - Fix crash on /upgrade (#1399, #1419)