diff options
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Makefile.am | 5 | ||||
-rw-r--r-- | README.md | 15 | ||||
-rw-r--r-- | docs/crash.txt | 6 | ||||
-rw-r--r-- | docs/help/in/network.in | 4 | ||||
-rw-r--r-- | docs/manual.txt | 2 | ||||
-rw-r--r-- | docs/signals.txt | 3 | ||||
-rw-r--r-- | docs/special_vars.txt | 16 | ||||
-rw-r--r-- | irssi.conf | 2 | ||||
-rw-r--r-- | src/core/ignore.c | 20 | ||||
-rw-r--r-- | src/fe-text/gui-printtext.c | 13 | ||||
-rw-r--r-- | src/fe-text/gui-printtext.h | 1 | ||||
-rw-r--r-- | src/fe-text/gui-windows.h | 1 | ||||
-rw-r--r-- | src/fe-text/textbuffer-view.c | 2 | ||||
-rwxr-xr-x | src/perl/get-signals.pl | 4 | ||||
-rw-r--r-- | src/perl/textui/TextUI.xs | 15 |
16 files changed, 85 insertions, 26 deletions
@@ -49,5 +49,3 @@ src/perl/ui/*.c .deps .libs - -docs/help diff --git a/Makefile.am b/Makefile.am index 5bb0a2d7..4f1d1112 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -ACLOCAL_AMFLAGS = -I m4 +ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} # create default-config.h BUILT_SOURCES = default-config.h default-theme.h irssi-version.h @@ -27,8 +27,7 @@ pkginclude_HEADERS = irssi-config.h irssi-version.h EXTRA_DIST = \ ChangeLog \ autogen.sh \ - curses.m4 \ - README \ + README.md \ file2header.sh \ $(conf_DATA) \ $(theme_DATA) \ @@ -2,11 +2,16 @@ [![Build Status](https://travis-ci.org/irssi/irssi.svg?branch=master)](https://travis-ci.org/irssi/irssi) -Irssi is a modular IRC client that currently has only text mode user interface, -but 80-90% of the code isn't text mode specific, so other UIs could be created -pretty easily. Also, Irssi isn't really even IRC specific anymore, there's -already a working [SILC](http://www.silcnet.org/) module available. Support for -other protocols like ICQ could be created some day too. +Irssi is a modular chat client that is most commonly known for its +text mode user interface, but 80% of the code isn't text mode +specific. We have a working but currently unmaintained GTK2 frontend +called xirssi. Irssi comes with IRC support built in, and there are +third party [ICB](https://github.com/jperkin/irssi-icb), +[SILC](http://www.silcnet.org/), +[XMPP](http://cybione.org/~irssi-xmpp/) (Jabber), +[PSYC](https://github.com/electric-blue/irssyc) and +[Quassel](https://github.com/phhusson/quassel-irssi) protocol modules +available. ## Installation diff --git a/docs/crash.txt b/docs/crash.txt index 713d303c..be4ee078 100644 --- a/docs/crash.txt +++ b/docs/crash.txt @@ -1,9 +1,11 @@ How to submit a good bug report? -Send them to bug reporting system in http://bugs.irssi.org/ +Bugs are tracked via the GitHub issue tracker. Open an issue at: +https://github.com/irssi/irssi/issues First you should give the following information: - - irssi version, if CVS (or devel. tarball) then which day? + - irssi version, if git (or devel. tarball) then which commit hash (or date + from /version)? - operating system / distribution and it's version - when did it crash? did you do something? can you reproduce the crash? diff --git a/docs/help/in/network.in b/docs/help/in/network.in index d1879b5c..cb4a634a 100644 --- a/docs/help/in/network.in +++ b/docs/help/in/network.in @@ -13,9 +13,11 @@ -autosendcmd: Command to send after connecting to a server With -autosendcmd argument you can automatically run any commands -after connecting to network. This is useful for automatically +after connecting to the network. This is useful for automatically identifying yourself to NickServ, for example + /NETWORK ADD -autosendcmd "/^msg NickServ identify secret" freenode + Shows and changes the settings of defined IRC networks. See also: CONNECT diff --git a/docs/manual.txt b/docs/manual.txt index 43d77550..b2d0de14 100644 --- a/docs/manual.txt +++ b/docs/manual.txt @@ -349,7 +349,7 @@ after connecting to the network. This is useful for automatically identifying yourself to NickServ, for example - /NETWORK ADD -autosendcmd "/msg NickServ identify secret" freenode + /NETWORK ADD -autosendcmd "/^msg NickServ identify secret" freenode /NETWORK REMOVE <name> diff --git a/docs/signals.txt b/docs/signals.txt index fd9ccc11..ea60d575 100644 --- a/docs/signals.txt +++ b/docs/signals.txt @@ -334,6 +334,9 @@ gui-readline.c: gui-printtext.c: "beep" +textbuffer-view.c + "gui textbuffer line removed", TEXTBUFFER_VIEW_REC *view, LINE_REC *line, LINE_REC *prev_line + Perl ---- diff --git a/docs/special_vars.txt b/docs/special_vars.txt index f19b2bb2..36517f78 100644 --- a/docs/special_vars.txt +++ b/docs/special_vars.txt @@ -114,3 +114,19 @@ surrounding text will not affect the expression's return value. /eval echo foo${N}foo /* ${N} returns current nickname */ fooYourNickfoo /* returned by above command */ +When writing an alias containing a /script exec, special consideration has to be +taken to $vars and statement delimiters, ie. ; +/alias tries to evaluate all $vars as expandos, which would mean that what you +pass on to /script exec isn't necessarily what you intended. +Compare: + + 1. /alias al1 script exec my $var = "Hello"; print $var; + 2. /alias al2 script exec my $$var = "Hello"\; print $$var; + 3. /alias al3 script exec my \$var = "Hello"\; print \$var; (Same as nr 2) + +In example nr 1 $var would be expanded to an empty string and ; would end +the /script exec command, leaving print $var as a separate command to be run by +irssi. In example 2 $$ is evaluated to a literal $ leaving a literal $var to be +passed on to /script exec. The same goes for \; which is turned into a +literal ; and thus is passed on to /script exec as a statement delimiter. +This would mean print $$var is part of the /script exec being evaluated. @@ -138,6 +138,8 @@ aliases = { ATAG = "WINDOW SERVER"; UNSET = "set -clear"; RESET = "set -default"; + HIGHLIGHT = "HILIGHT"; + DEHIGHLIGHT = "DEHILIGHT"; }; statusbar = { diff --git a/src/core/ignore.c b/src/core/ignore.c index a7aa106f..eda232c7 100644 --- a/src/core/ignore.c +++ b/src/core/ignore.c @@ -293,10 +293,24 @@ static void ignore_remove_config(IGNORE_REC *rec) static void ignore_init_rec(IGNORE_REC *rec) { #ifdef HAVE_REGEX_H + char *errbuf; + int errcode, errbuf_len; + if (rec->regexp_compiled) regfree(&rec->preg); - rec->regexp_compiled = !rec->regexp || rec->pattern == NULL ? FALSE : - regcomp(&rec->preg, rec->pattern, - REG_EXTENDED|REG_ICASE|REG_NOSUB) == 0; + rec->regexp_compiled = FALSE; + if (rec->regexp && rec->pattern != NULL) { + errcode = regcomp(&rec->preg, rec->pattern, + REG_EXTENDED|REG_ICASE|REG_NOSUB); + if (errcode != 0) { + errbuf_len = regerror(errcode, &rec->preg, 0, 0); + errbuf = g_malloc(errbuf_len); + regerror(errcode, &rec->preg, errbuf, errbuf_len); + g_warning("Failed to compile regexp '%s': %s", rec->pattern, errbuf); + g_free(errbuf); + } else { + rec->regexp_compiled = TRUE; + } + } #endif } diff --git a/src/fe-text/gui-printtext.c b/src/fe-text/gui-printtext.c index 2b5bfc5f..76b116d8 100644 --- a/src/fe-text/gui-printtext.c +++ b/src/fe-text/gui-printtext.c @@ -102,7 +102,7 @@ void gui_printtext(int xpos, int ypos, const char *str) next_xpos = next_ypos = -1; } -void gui_printtext_after(TEXT_DEST_REC *dest, LINE_REC *prev, const char *str) +void gui_printtext_after_time(TEXT_DEST_REC *dest, LINE_REC *prev, const char *str, time_t time) { GUI_WINDOW_REC *gui; @@ -110,10 +110,16 @@ void gui_printtext_after(TEXT_DEST_REC *dest, LINE_REC *prev, const char *str) gui->use_insert_after = TRUE; gui->insert_after = prev; + gui->insert_after_time = time; format_send_to_gui(dest, str); gui->use_insert_after = FALSE; } +void gui_printtext_after(TEXT_DEST_REC *dest, LINE_REC *prev, const char *str) +{ + gui_printtext_after_time(dest, prev, str, 0); +} + static void remove_old_lines(TEXT_BUFFER_VIEW_REC *view) { LINE_REC *line; @@ -199,9 +205,10 @@ static void sig_gui_print_text(WINDOW_REC *window, void *fgcolor, } lineinfo.level = dest == NULL ? 0 : dest->level; - lineinfo.time = time(NULL); - gui = WINDOW_GUI(window); + lineinfo.time = (gui->use_insert_after && gui->insert_after_time) ? + gui->insert_after_time : time(NULL); + view = gui->view; insert_after = gui->use_insert_after ? gui->insert_after : view->buffer->cur_line; diff --git a/src/fe-text/gui-printtext.h b/src/fe-text/gui-printtext.h index 47cd3c23..33b7ce6f 100644 --- a/src/fe-text/gui-printtext.h +++ b/src/fe-text/gui-printtext.h @@ -18,5 +18,6 @@ INDENT_FUNC get_default_indent_func(void); void gui_printtext(int xpos, int ypos, const char *str); void gui_printtext_after(TEXT_DEST_REC *dest, LINE_REC *prev, const char *str); +void gui_printtext_after_time(TEXT_DEST_REC *dest, LINE_REC *prev, const char *str, time_t time); #endif diff --git a/src/fe-text/gui-windows.h b/src/fe-text/gui-windows.h index 9d4afac7..94c0d28b 100644 --- a/src/fe-text/gui-windows.h +++ b/src/fe-text/gui-windows.h @@ -20,6 +20,7 @@ typedef struct { unsigned int sticky:1; unsigned int use_insert_after:1; LINE_REC *insert_after; + time_t insert_after_time; } GUI_WINDOW_REC; void gui_windows_init(void); diff --git a/src/fe-text/textbuffer-view.c b/src/fe-text/textbuffer-view.c index c2964276..c19b9af7 100644 --- a/src/fe-text/textbuffer-view.c +++ b/src/fe-text/textbuffer-view.c @@ -1141,6 +1141,8 @@ void textbuffer_view_remove_line(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line) g_return_if_fail(view != NULL); g_return_if_fail(line != NULL); + signal_emit("gui textbuffer line removed", 3, view, line, line->prev); + linecount = view_get_linecount(view, line); update_counter = view->cache->update_counter+1; diff --git a/src/perl/get-signals.pl b/src/perl/get-signals.pl index 55264cb9..529d35b1 100755 --- a/src/perl/get-signals.pl +++ b/src/perl/get-signals.pl @@ -57,6 +57,10 @@ while (<STDIN>) { WINDOW_REC => 'Irssi::UI::Window', WI_ITEM_REC => 'iobject', + # fe-text + TEXTBUFFER_VIEW_REC => 'Irssi::TextUI::TextBufferView', + LINE_REC => 'Irssi::TextUI::Line', + # perl PERL_SCRIPT_REC => 'Irssi::Script', ); diff --git a/src/perl/textui/TextUI.xs b/src/perl/textui/TextUI.xs index fe51076a..ae986aaf 100644 --- a/src/perl/textui/TextUI.xs +++ b/src/perl/textui/TextUI.xs @@ -139,11 +139,12 @@ CODE: MODULE = Irssi::TextUI PACKAGE = Irssi::UI::Window void -print_after(window, prev, level, str) +print_after(window, prev, level, str, time = 0) Irssi::UI::Window window Irssi::TextUI::Line prev int level char *str + time_t time PREINIT: TEXT_DEST_REC dest; char *text; @@ -152,21 +153,22 @@ CODE: format_create_dest(&dest, NULL, NULL, level, window); text = format_string_expand(str, NULL); text2 = g_strconcat(text, "\n", NULL); - gui_printtext_after(&dest, prev, text2); + gui_printtext_after_time(&dest, prev, text2, time); g_free(text); g_free(text2); void -gui_printtext_after(window, prev, level, str) +gui_printtext_after(window, prev, level, str, time = 0) Irssi::UI::Window window Irssi::TextUI::Line prev int level char *str + time_t time PREINIT: TEXT_DEST_REC dest; CODE: format_create_dest(&dest, NULL, NULL, level, window); - gui_printtext_after(&dest, prev, str); + gui_printtext_after_time(&dest, prev, str, time); Irssi::TextUI::Line last_line_insert(window) @@ -179,17 +181,18 @@ OUTPUT: MODULE = Irssi::TextUI PACKAGE = Irssi::Server void -gui_printtext_after(server, target, prev, level, str) +gui_printtext_after(server, target, prev, level, str, time = 0) Irssi::Server server char *target Irssi::TextUI::Line prev int level char *str + time_t time PREINIT: TEXT_DEST_REC dest; CODE: format_create_dest(&dest, server, target, level, NULL); - gui_printtext_after(&dest, prev, str); + gui_printtext_after_time(&dest, prev, str, time); BOOT: irssi_boot(TextUI__Statusbar); |