From: Pekka Riikonen
Date: Thu, 25 Jan 2007 12:02:13 +0000 (+0000)
Subject: Merged Irssi SVN (upcoming irssi 0.8.11).
X-Git-Tag: silc.client.1.1.beta1~40
X-Git-Url: http://git.silcnet.org/gitweb/?a=commitdiff_plain;h=63ca577177f9f5db8e553372a9793b0c85f10715;p=silc.git
Merged Irssi SVN (upcoming irssi 0.8.11).
---
diff --git a/CHANGES b/CHANGES
index ef32bfc2..ce0636bb 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+Wed Jan 24 18:55:21 EET 2007 Pekka Riikonen
+
+ * Merged Irssi SVN (irssi 0.8.11). Affected files in apps/irssi/.
+
Tue Jan 23 16:05:27 EET 2007 Pekka Riikonen
* The silc_schedule_set_listen_fd now returns boolean value.
diff --git a/apps/irssi/AUTHORS b/apps/irssi/AUTHORS
index 093f5e94..62388307 100644
--- a/apps/irssi/AUTHORS
+++ b/apps/irssi/AUTHORS
@@ -1 +1,67 @@
-Timo Sirainen
+Original code:
+
+ Timo Sirainen
+
+Irssi staff (current maintainers) :
+
+ Valentin Batz (senneth, vb)
+ Wouter Coekaerts (coekie)
+ Jochen Eisinger (c0ffee)
+ Geert Hauwaerts
+ Emanuele Giaquinta (exg)
+
+Large feature patches by:
+
+ David Leadbeater (dg, dgl) : isupport
+ vjt@users.sf.net : SSL support
+ Joel Eriksson : SSL certs
+ Heikki Orsila : DCC SEND queueing
+ Mark Trumbull : DCC SERVER
+ Francesco Fracassi : Passive DCC
+
+Other patches (grep for "patch" in ChangeLog) by:
+
+ Toby Peterson
+ Soren Jacobsen
+ Kuang-che Wu
+ Joost Vunderink (Garion)
+ Wang WenRui
+ Jean-Yves Lefort (decadix)
+ Joel Eriksson
+ Maarten van der Zwaart
+ Noah Levitt
+ Krzysztof Kowalik (Borys)
+ Peder Stray
+ mls@suse.de
+ nix@suhs.nu
+ Marcin Kowalczyk (Qrczak)
+ Petr Baudis
+ Bjoern Krombholz (fuchs)
+ aldem-irssi@aldem.net,
+ BC-bd
+ Juerd
+ Han
+ pv2b
+ Tommi Komulainen (tommik)
+ mike@po.cs.msu.su
+ zinx@magenet.net
+ yathen@web.de
+ paul@raade.org
+ Leszek Matok
+ tygrys@moo.pl
+ manoj@io.com
+ cph@cph.demon.co.uk
+ ganesh@earth.li
+ Jakub Jankowski (shasta)
+ vanilla@freebsd.org
+ Tinuk
+ Mark Glines
+ Kjetil Ødegaard
+ Chris Moore
+ ComradeP
+ Jilles Tjoelker
+ Lauri Nurmi
+ Mikko Rauhala
+ loafier
+ Nicolas Collignon
+ Daniel Koning
diff --git a/apps/irssi/NEWS b/apps/irssi/NEWS
index ccdc0e4f..5d94290d 100644
--- a/apps/irssi/NEWS
+++ b/apps/irssi/NEWS
@@ -1,3 +1,238 @@
+v0.8.11 200x-xx-xx The Irssi team
+ + Send /QUOTE immediately if server didn't send the 001 event yet
+ + If dcc_own_ip contains IPv4 address, listen only in IPv4
+ + Negative scroll_page_count scrolls screensize-n lines
+ (Patch by Chris Moore)
+ + Sort nicks with custom prefix by the order defined in isupport in /NAMES
+ + New perl command send_raw_first, patch by ComradeP (Bug 413)
+ + Let the module loader also check for fe_common_$protocol files
+ + Don't wait for all /NAMES replies before syncing if we can't combine
+ queries anyways (Patch by jilles)
+ + Renamed irc.efnet.net to irc.efnet.org
+ + Add support for utf8 to Irssi::settings_get_str and
+ Irssi::TextUI::Line::get_text
+ + /SCROLLBACK CLEAR accepts the same arguments as /CLEAR
+ + Check if binary exists and can be executed before /UPGRADE
+ + Change default value of override_coredump_limit to OFF
+ + UPTIME command by Lauri Nurmi with some modifications (Bug 458)
+ + Remove CR and LF from Perl commands, to make it harder to introduce a
+ security bug
+ - Fixed segfault on quit introduced in 0.8.10
+ - Fixed a bug where tab-complete didn't worked with utf8/big5 properly
+ - Ignore joins without a nick from broken servers
+ - Fix whois_hide_safe_channel_id: only look at the beginning of a channel
+ name, not in the middle
+ - Don't assume that 7bit ascii strings are encoded in UTF-8, only
+ validate the strings when they contain octest with highest bit set
+ (patch by Mikko Rauhala)
+ - Make random really random when resolving
+ - Don't get confused by a join command with too many arguments, keys
+ can't have spaces in them (Bug 437)
+ - Don't crash on /QUIT with scripts causing and catching signals on UNLOAD
+ - Fix off-by-one error in gui_entry_draw_from
+ - Fix %k and %K mappings in curses frontend
+ - Fix bold on monochrome terminals in terminfo frontend
+ - Fixed colors with TERM=xterm-{88,256}color in terminfo frontend
+ - Fix building with srcdir != builddir
+ - Don't get confused and keep saying "Netsplit over" on every join for
+ user that only rejoined some channels
+ - Fix crash with one line high terminal
+ - Fix crash in /EXEC (Bug 439)
+ - Fix format string in printtext_dest call from Perl, patch by loafier
+ - Fix memory leaks in expandos_deinit by Nicolas Collignon (Bug 419)
+ - Detect off_t size using AC_CHECK_SIZEOF because it works also when
+ cross-compiling in autoconf-2.50 and higher
+ - Fix failed assertion when the config file is unreadable, patch by
+ Daniel Koning (Bug 164)
+
+v0.8.10 2005-12-11 The Irssi team
+
+ * Long delayed release, with lots of changes. Most important ones:
+ + Recode support, by decadix and senneth
+ + isupport (005 numeric), by David Leadbeater
+ + Passive DCC support, by Francesco Fracassi
+ - Many memleak fixes, by Toby Peterson
+
+ + Moved to subversion
+ + /SET paste_join_multiline ON - When paste detection is enabled and
+ you paste lines which look like they're being copy&pasted from irssi
+ itself, it attempts to merge lines said originally in a single line.
+
+ How this really works is that all indented lines must have the same
+ amount of indentation. Indented lines are merged to last
+ unindented line. If line gets longer than 400 characters, it's split.
+ + /SET whois_hide_safe_channel_id ON - Hides the channel ID prefix
+ of !channels in WHOIS replies
+ + When reconnecting to server, say that it can be aborted with
+ /RMRECONNS
+ + /WHOIS - is supported now
+ + /SET whois_hide_safe_channel_id - removes the ugly IDs for !channels
+ in /WHOIS (default)
+ + If we can't connect to server using given own IP, show the IP to
+ user in the error message. Should help figuring out wrong
+ /SET hostname or /SERVER -host settings.
+ + If channel has more nicks than /SET channel_max_who_sync, don't ask
+ /WHO list to avoid getting kicked out of server (Max SendQ exceeded).
+ + /LOAD script.pl loads the perl script
+ + /IGNORE -network ignores only on specified network
+ + /SET use_status_window and /SET use_msgs_window make the effects
+ immediately
+ + Changed the confusing "ircnet" to "network" everywhere
+ + Don't autoget files sent to channels, unless dcc_autoget_masks is set
+ + Added a default "*" target which matches everything on the server,
+ including NULL items associated with it, by jimmy
+ + /UPGRADE now saves server->version
+ + If available, send who set topic and when to irssi-proxy clients
+ + Cleaned up network list: removed smaller networks, added QuakeNet
+ + New default aliases: MANUAL-WINDOWS, EXEMPTLIST and ATAG
+ + Recode support: /RECODE for manipulation of the conversion database.
+ Setting "term_type" has been renamed to "term_charset".
+ /SET recode OFF to disable recode completely.
+ /SET recode_out_default_charset to specify the default
+ outgoing charset.
+ /SET recode_fallback to specify a charset that will be
+ used when the normal conversion is failing.
+ /SET recode_transliterate ON to enable character transliteration,
+ so unavailable characters will be transliterated into something
+ readable
+ can be almost everything listed by 'iconv -l'
+ + Added transpose_words, capitalize_word, downcase_word, upcase_word
+ key bindings
+ + Avoid accidentaly /VER in a channel, by requiring parameter
+ - Pasted lines weren't added to command history. Some other paste
+ detection fixes
+ - Fixed /BIND escape_char
+ - Fixes for Chinese multibyte characters handling and cursor movement
+ by Wang WenRui
+ - Pasting multibyte chars was buggy, patch by Kuang-che Wu
+ - Fixed handling WHOIS printing once and for all. Everything unknown
+ between "beginning of whois" and "end of whois" events is now printed
+ as whois_special. Removed whois_registered and whois_help, they're
+ printed with whois_special as well.
+ - Don't replace channel key when receiving channel mode numeric. It
+ could be a fake key there.
+ - Don't crash if dcc chated user changes nick
+ - Help files are always lowercased. Make sure /HELP COMMAND works too.
+ - /EXEC crashed with 64bit systems. Patch by Soren Jacobsen
+ - Handle 432 numeric (errorneus nickname) as "nick in use". Fixes
+ problems with ircnet 2.11 ircd when irssi tries to reconnect using
+ UID as nick. Patch by Petr Baudis
+ - /SET -default fixes
+ - /DCC SEND didn't actually use /SET dcc_upload_path
+ - Fixed /WHOIS -yes (Bug 67)
+ - Make /JOIN -tag #channel and /JOIN #channel switch to that
+ channel (Bugs 13 and 93)
+ - Fixed readded (changed) hilights being in config twice, resulted in
+ duplicate hilights or removed hilights coming back (Bug 39)
+ - Fixed messages to @#channel showed *your* nickmode, not the one of
+ the sender (part of Bug 80)
+ - Fixed /KNOCK support
+ - Fixed own nick changes in irssi-proxy
+ - Fixed /HILIGHT -actcolor -mask (Bug 131)
+ - Recognise a param of signal_emit/continue in perl script if it's int
+ - Fixed bug 120 where proxy doesn't set the server_rec->away_reason
+ - Fixed /join -invite -window bug if there is no invite
+ - Fixed bug with time settings where hours actually returned 60*hours
+ - Fix multiple entries for local IP in /etc/hosts prevents connecting,
+ patch by eridius (Bug 167)
+ - Fixed a bug with /me, use the right arguments for
+ "message irc own_action"
+ - Update our own nickrec->gone flag on /away or on /away
+ - Fixed output of /hilight (add a space after -levels if any)
+ - Add libtool's -module flag to get built properly on all platforms,
+ by Toby Peterson (Bug 212)
+ - Don't apply emphasis on _foo_^ if it's a nick (Bug 52)
+ - Fix displaying of ctcp userinfo and clientinfo (Bug 222)
+ - Remember alternate_nick and max_whois on reconnect (Bug 181)
+ - Fix tr_TR locale problem for glib2 (still a bug with glib1.2)
+ by David Pashley
+ - Fixed pasting not using the character translation (Bug 151)
+ - Fixed a bug where the channel list to join/rejoin on reconnect
+ gets too long, not all channels will be joined. (Bug 108)
+ - Print glib errors nicely, by David Pashley
+ - Handle ^Z better, by David Pashley
+ - Fixed /eval recursion crashing, by David Pashley
+ - Fix notify with more nicks than max_whois_in_cmd (Bug 257),
+ based on patch by Krzysztof Kowalik (Borys)
+ - Fixed irssiproxy sometimes missing (parts of) lines
+ - Fixed remote /WHOWAS
+ - Parse negative time setting values, makes it possible again to do
+ /SET server_reconnect_time -1 to disable reconnecting
+ - Compile with gcc4
+ - Compile with readonly srcdir
+ - Fixed crash if receiving broken privmsg without source
+ (which bitlbee can send if you msg yourself)
+ - Fixed crash with invalid TERM and termcap
+ - When looking up IP addresses, return random IP instead of the first one
+
+v0.8.9 2003-12-11 Timo Sirainen
+
+ * Fixes a remote crash with:
+ a) non-x86 hardware (one requiring memory alignmentation)
+ b) script using "gui print text" signal (with x86 hardware too)
+
+ + /SET auto_whowas OFF allows now disabling automatic /whowas when
+ /whois doesn't find a nick (by Borys)
+ - If pasted line starts with command char, treat it as command always.
+ Paste detection can go on too easily with lagged connections.
+
+v0.8.8 2003-11-23 Timo Sirainen
+
+ - Just a few fixes to converting old settings automatically
+
+v0.8.7 2003-11-23 Timo Sirainen
+
+ * Settings changes - we have now "time", "size" and "level" setting
+ types.
+ - Level settings should work the same as before.
+ - Time settings can have units: days, hours, mins, secs,
+ milliseconds (or msecs). The units can be combined and written
+ in shorter form as well, for example "5d 30m 10ms"
+ - Size settings can have units: gbytes, mbytes, kbytes, bytes.
+ They can be written in shorter form as well, eg. "gb" or "g".
+
+ Your existing settings should be converted automatically.
+
+ + Pasting detection. All keys except CR and LF are pasted as-is into
+ prompt in pasting mode.
+
+ /SET paste_detect_time controls how closely each others characters
+ must occur for it to be considered pasting. Paste mode goes on when
+ first pasted CR/LF is found.
+
+ The first line may also contain some command characters. They are
+ executed, but their action in entry line is reverted once pasting
+ is detected.
+
+ What this means in practise is that even if you have TABs (assuming
+ TAB is completion key) in the first pasted line, they get pasted as
+ TABs.
+
+ This detection isn't perfect, so if it annoys you it can be disabled
+ with /SET paste_detect_time 0
+ + If pasting more lines than /SET paste_verify_line_count, irssi asks
+ if you actually want to do that. This should be useful to prevent
+ accidental copy&paste mistakes. Setting it to 0 disables this
+ entirely.
+ + Support for sending SSL certificate to server and optionally verify
+ server's certificate. See the -ssl_* options for /SERVER and
+ /SERVER ADD. Patch by Joel Eriksson.
+ + DCC SERVER support by Mark Trumbull
+ + Support for DCC sending larger files than 2GB if supported by
+ operating system (ie. 64bit file support). Receiving has always
+ been possible, but the statistics were wrong with >4GB files
+ if 64bit support isn't enabled.
+ + Better displaying of DCC file transfer statistics.
+ - Several other minor fixes and enhancements, see ChangeLog
+
+v0.8.6 2002-11-17 Timo Sirainen
+
+ * Tons of changes, here's only the largest that come to my mind now:
+
+ + SSL support by vjt@users.sf.net
+ + DCC send queues by Heikki Orsila
+ + Better support for !channels
+
v0.8.4 2002-03-13 Timo Sirainen
* Continuing to fix my stupid mistakes...
diff --git a/apps/irssi/TODO b/apps/irssi/TODO
index b1b76bc7..bc2cef99 100644
--- a/apps/irssi/TODO
+++ b/apps/irssi/TODO
@@ -1,6 +1,161 @@
+ - /whowas server nick doesn't work
+01:18 <@darix> cras: /foreach server /disconnect $tag n8 <-- doesnt work
+ - /hilight -priority is broken
+19:36 [IRCNet] [muzzy] lisää bugeja irssissä, ilmeisesti
+ uusin versio: foo splittaa ulos, bar joinaa sisään, bar vaihtaa
+ nicknamen fooksi, foo splittaa uudestaan ulos -> tulee Glib warning
+ "is already in split list (how?)" .. :)
+
+04:35 [OPN] [slug] was just wondering if you
+ had Irssi::keyboard_entry_redirect() on your TODO somewhere near the
+ top, I'd love the feature
+04:35 [OPN] [slug] or someway to clear the
+ command buffer, either way is acceptable, just my connection is a
+ little less than reliable, so I've built myself a script that stores
+ blowfish passes, all encrypted by one value
+04:36 [OPN] [slug] then I set a single
+ decryption key, and it keeps it for the irssi session (lost on
+ /upgrade though), unfortunatly it stays in the command buffer 8]
+
+ - ^I in topicbar breaks things
+14:17 <@darix> cras: this doesnt work: /exec - -o uname -a
+
+ - "setup changed", or "setup reread" seems to cause crashes.. (with darix)
+02:46 <@fuchs> cras, /server foonet.foo.xy and (recognizing it doesn't connect
+ fast enough), and so doing /server barnet.foo.xy (both in the
+ same chatnet) makes irssi joining the net but not rejoining the
+ channels
+
+
+14:59 <@c0ffee> cras, bug report, mode change compression appears not to work:
+ 13:58 -!- mode/#*cut* [-b+ *cut*] by *cut* (i think it was -b+b)
+21:55 <@L> 17:04.11 /eval /last quit;/clear;/sb goto 10:00;/last -clear;/sb end
+21:55 <@L> 17:04.27 wait after it scrolls and press page up :)
+21:55 <@L> 17:04.48 oh, you can make Irssi behave correctly with /clear
+ again
+
+ - /msg nick@server or nick%host is fully treated as nickname (log, query)
+ - max_whois won't stay with reconnects?
+ - support passive DCC
+ - separate format for privmsg/notice massmessages (anything non-yournick)
+20:45 < Juerd> 19:44 -!- Irssi: critical file channels.c: line 122
+ (channel_find): assertion
+20:45 < Juerd> `name != NULL' failed.
+20:45 < Juerd> this happens three times
+20:46 < Juerd> and it happens in a _query_
+20:47 <@Juerd> cras: for some reason irssi doesn't know this happens in a
+ query, and displays "< Juerd:> foo" in the status window
+ - set TOS field for all connections (DCC especially)
+22:51 [IRCNet] [zhafte] irssi muuten taitaa bugaa jos
+ pistää ACT oikeaan reunaan, vai onkohan se vain mun terminaali?
+22:52 [IRCNet] [zhafte] menevät välillä päällekkäin
+ numerot
+ - when using -w password command line parameter, hide the password so it
+ won't show with ps.
+07.06.2002 08:37 #irssi: <@Qrczak> cras: A bug. After /upgrade when being away
+ the awaylog is not being written to.
+21:37 < life> Then you connect. The problem is that irssi connects to the proxy
+ server and directly afterwards send "USER ..."
+21:37 < life> It has to wait for "HTTP 200 ok" *first*
+04.06.2002 08:54 #irssi: <@Garion> cras: i've seen it several times now - a
+ line of 79 or 80 chars (my win is 80 wide)
+ which has an empty line below it, and that
+ line is not refreshed when I switch to the
+ window with that line in it, thus keeping 1
+ line from the old window in the current
+ window. Very confusing
+21:43 [IRCNet] [HiroP-(~HiroP@p508035EC.dip.t-dialin.net)] Hi there. I just
+ wanted to tell you that there seems to be a problem when joining
+ large channels (500+ people) while a regexp ignore is active. I had
+ one to ignore all server ads
+21:43 [IRCNet] [HiroP-(~HiroP@p508035EC.dip.t-dialin.net)] 1 *: ALL -regexp
+ -pattern .*erver.*nline.*
+21:43 [IRCNet] [HiroP-(~HiroP@p508035EC.dip.t-dialin.net)] After joining, I
+ could see the nicklist and 1 or 2 lines of what people were saying.
+ Then irssi either core-dumped, got disconnected or just sat there
+ apparently without receiving any more data (lag-counter going up to
+ several minutes).
+
+ - %n%_ ei näy lastlogissa
+ - darixin se pingiredirectijuttu
+21:28 < Samus_Aran> cras: /log also shows #Linuux ... which I typod a couple
+ days ago
+21:30 < Samus_Aran> it doesnt show any of the queries which i closed, though,
+ jush #channels
+
+ - "show statusbar in empty windows" flag?
+ - statusbar_item_redraw() should just set the size as dirty and calculate
+ it only when really needed.
+ - possible to cache sbar_item->size when nothing else has changed in sbar?
+ ie. mostly when redrawing.
+ - use_status_window, use_msgs_window sais toimia heti
+ - /msg @#chan
+
+ - hilight -priority
+ - tab completio jos lisää utf8 juttuja niin ei oikein toimi?
+16:39 <@Qrczak> cras: I'm not sure how exactly to reproduce it but it happens
+ often. When I jump to the window with a query using Alt-a
+ (after the other person said something), and close the window
+ (being brought to the last used window), and don't switch
+ windows, and then that person says something again, I'm brought
+ to the new query window automatically (that's of course bad).
+
+21.04.2002 11:59 [immy(immy@beanus.org)] GLib warning: signal_free(script
+ destroyed) : signal still has 3 references:
+ - jos kickataan nopeasti ja joinaa takas nopeasti chansyncci kaataa
+/WHOssa.. kts. qrczak logi
+ - /set show_server_tags tjsp että näyttäis aina (yhdistä hide_server_tagsin
+ kanssa?)
+17:35 <@peder> cras: why isnt 'topic = " {sb_topic $topic}"' in the default
+ - /SBAR topic placement bottom ei toimi??
+ - /SB GOTO -
+ - /query -immortal so autoclose_queries wouldn't touch them
+ - /SET hiascii_control_chars if 128..128+32 should be treated as control chars
+
+...
+
+ - /exec -out kanavalla ei pelaa silcissä
+ - write about %[-s] etc. to default.theme
+ - away handling is a bit buggy. you do /away;/away reason, irssi remembers
+ the away reason only until it receives "you're no longer away" from the
+ first command.. setting it back to away has then lost the reason.
+ - crash: /exec -msg safari perl -e 'print "A"x600000'"
+ - nick_ nick- _nick nick2 nick3 ...
+17.03.2002 22:25 #irssi.fi: <@Ion> cras: Jos sanon dcc chatissa että /exec -
+ -out cat iso_tiedosto, niin miksi
+ iso_tiedosto jää kesken? :)
+ - /op * valitus vois olla joku parempi kuin "not a good idea"..
+ - mitenkäs tabcompletio completoi taas omaakin nickkiä..?
+ - /hilight -level "public -actions" or something so it wouldn't match
+ actions.
+ - vanhan irssin /upgrades uuteen ennen sitä vaihtoi /set autolog_path:iin
+ $1 ja kaatui?..
+ - /win hide vois pelata vaikka oliskin stickyjä siinä ikkunassa
+ - /SAVE -all?
+14.03.2002 19:10 #irssi: <@fantazja> cras: autoclose_query is also closing (and
+ finishing) dcc chats :/
+ - /window server -sticky:tetyt ikkunat ei aina meinaa tajuta kun serveri
+ yhdistyy?
+ - utf8-tekstitykset bugailee statusbarissa (promptissa)
+ - jos /set reuse_unused_windows off, ja ikkuna näyttäis täysin tyhjälle
+ ja niitä olis vaan 1, niin sen vois kyllä käyttää silti (?)
+ - /set beep_msg_level hilight ei toimi jos on /hilight -word
+
+ - /STATUSBAR xx ENABLE|DISABLE recreates all statusbars which is a bit
+ annoying because some scripts want to do it and input line is cleared
+ because of this..
+ - move /SET hilight_*color to theme
+ - /SET disconnect_timeout - default 2min, 0 = immediately
+ - reconnecting messages are a bit confusing. it prints "removed reconnection"
+ to the server which it's connecting to next.. maybe the whole reconnecting
+ thing should work so that the record stays there until it's connected
+ successfully.
+ - /ignore, /hilight and /lastlog could complain immediately if used
+ regexp is broken. /hilight list could show also if it's broken like
+ /ignore does.
+
- /UPGRADE:
- support DCCs
- - topic time/nick isn't transferred
- rewrite to work by fork()ing a new process and transfer file handles
with unix sockets. this would allow the scrollback buffers to be
transferred with them as well.
@@ -19,7 +174,7 @@
- but DCC chats shouldn't be closed until the chat itself is closed
- which we can't know really currently, since they don't need
to be in queries
- - channels should be closed when they're left
+ - channels should be closed when they're left (they are now, but)
- /WINDOW CLOSE shouldn't close it immediately, since we'll still
receive at least the PART message
- so, log items should know more about what they are exactly, and when
@@ -45,6 +200,8 @@
- support for using strftime() formats (and $tag etc). only problem with
this is that all the different awaylogs would need to be tracked and
/CATed when setting yourself unaway
+ - /AWAYLOG could show the current awaylog and optionally reset it
+ - The channel name should be optional there
- Window item placing:
- !channel vs. !12345channel. it's layout saved with full name, but joined
@@ -53,6 +210,9 @@
the query window with the dcc chat window.
- closed DCC chats should add temporary window bind to the dcc chat so
future chats for same nick would use the same window
+ - /JOIN #foo could *optionally* move the channel to active window
+ (default off, it confuses people)
+ - /JOIN -ircnet #foo doesn't jump to #foo like /JOIN #foo does.
- DCC
- /DCC SEND wildcard support
@@ -72,6 +232,8 @@
- /DCC CLOSE #, /DCC would print the IDs
- /SET dcc_use_proxy to use IRC proxy for DCC connects as well
- support for special vars in /SET dcc_download_path, so $N could be used
+ - No way to autoclose dcc chat windows which have been closed by another
+ side.
- Generic chat commands:
- /MSG /CTCP /ACTION =dcc_chat,#channel
@@ -83,8 +245,6 @@
maybe some multipeople query support? :) /query nick1,nick2 and sending
text there would send it to both. Seems to work already but receiving
messages from either nick1 or nick2 don't go to that window..
- - /^MSG nick creates query with /SET qutocreate_own_query YES
- - /WHOIS -servertag
- /BAN: setting of what netmask to use for banning with IPv6 addresses
- Netsplits
@@ -133,19 +293,16 @@
- Irssi proxy:
- doesn't propagate your own nickchanges to other clients
- - better support for CTCP replies / DCC
+ - list sessions, kill them
+ - /set irssi_proxy_ips
- Misc IRC related things:
- - better support for !channels (don't log the ID, show nicer in whois,
- layout save doesn't work, /win item move !channel)
- support for mode +q in dancer - also same as +b %xxx modes..
- properly support RFC-1459 charset (ircnet specific option), eg.
/QUERY p[ and msgs from p{ aren't placed there.
- /BAN -ip, -time [
And example how to add servers:
-
(openprojects network, identify with nickserv and wait for 2 seconds before
+
(OFTC network, identify with nickserv and wait for 2 seconds before
joining channels)
Then add some servers to different networks (ircnet is already set up
+
(NOTE: use /IRCNET with 0.8.9 and older)
+
+
Then add some servers to different networks (network is already set up
for them), irc.kpnqwest.fi is used by default for IRCNet but if it fails,
irc.funet.fi is tried next:
@@ -156,9 +158,10 @@ Ctrl-P, Ctrl-N - Jump to previous / next window
Clearly the easiest way is to use Meta-number keys. And what is the Meta
-key? For some terminals, it's the same as ALT. If you have Windows keyboard,
-it's probably the left Windows key. If they don't work directly, you'll need
-to set a few X resources (NOTE: these work with both xterm and rxvt):
+key? ESC key always works as Meta, but there's also easier ways. ALT could
+work as Meta, or if you have Windows keyboard, left Windows key might work
+as Meta. If they don't work directly, you'll need to set a few X resources
+(NOTE: these work with both xterm and rxvt):
@@ -264,22 +267,22 @@ helps with reconnecting if your primary server breaks and is probably
useful in some other ways too :) For information how to actually use
irssi correctly with multiple servers see the chapter 6.
-
First you need to have your IRC network set, use /IRCNET
-command to see if it's already there. If it isn't, use /IRCNET ADD
-yourircnet. If you want to execute some commands automatically when
+
First you need to have your IRC network set, use /NETWORK
+command to see if it's already there. If it isn't, use /NETWORK ADD
+yournetwork. If you want to execute some commands automatically when
you're connected to some network, use -autosendcmd option.
-Here's some examples:
+(NOTE: use /IRCNET with 0.8.9 and older.) Here's some examples:
-bots and -botcmd should be the only ones
@@ -401,17 +404,17 @@ without any parameters. You should see a list of something like:
-!- IRCNet: irc.song.fi:6667 (IRCNet)
--!- freenode: irc.freenode.net:6667 (freenode)
+-!- OFTC: irc.oftc.net:6667 (OFTC)
-!- RECON-1: 192.168.0.1:6667 () (02:59 left before reconnecting)
-
Here you see that we're connected to IRCNet and freenode networks.
+
Here you see that we're connected to IRCNet and OFTC networks.
The IRCNet at the beginning is called the "server tag" while the
(IRCnet) at the end shows the IRC network. Server tag specifies unique
tag to refer to the server, usually it's the same as the IRC network.
When the IRC network isn't known it's some part of the server name.
When there's multiple connections to same IRC network or server, irssi
-adds a number after the tag so there could be ircnet, ircnet2, ircnet3
+adds a number after the tag so there could be network, network2, network3
etc.
Server tags beginning with RECON- mean server
@@ -422,7 +425,7 @@ successful and irssi will try to connect it again in 3 minutes.
reconnecting, use
-/DISCONNECT ircnet - disconnect server with tag "ircnet"
+/DISCONNECT network - disconnect server with tag "network"
/DISCONNECT recon-1 - stop trying to reconnect to RECON-1 server
/RMRECONNS - stop all server reconnections
@@ -475,12 +478,12 @@ for each server. Here's how to do them (repeat for each server)
/WINDOW NEW HIDE
/WINDOW NAME (status)
/WINDOW LEVEL ALL -MSGS
-/WINDOW SERVER -sticky ircnet
+/WINDOW SERVER -sticky network
/WINDOW NEW HIDE
/WINDOW NAME (msgs)
/WINDOW LEVEL MSGS
-/WINDOW SERVER -sticky ircnet
+/WINDOW SERVER -sticky network
With the proxy /SETs however, irssi now connects to those
@@ -647,7 +650,7 @@ you can just forget that your bouncer even exists.
/SET -clear proxy_password
-/EVAL SET proxy_string CONNECT %s:%d\n\n
+/EVAL SET proxy_string CONNECT %s:%d HTTP/1.0\n\n
BNC
@@ -661,16 +664,16 @@ you can just forget that your bouncer even exists.
dircproxy
dircproxy separates the server connections by passwords. So, if you
-for example have ircnet connection with password ircpass and
-openprojects connection with freenodepass, you would do something like
+for example have network connection with password ircpass and
+OFTC connection with oftcpass, you would do something like
this:
So, you'll specify the usernames with /IRCNET ADD command,
+
So, you'll specify the usernames with /NETWORK ADD command,
and the user's password with /SERVER ADD.
+
(NOTE: use /IRCNET with 0.8.9 and older.)
+
Irssi proxy
Irssi contains it's own proxy which you can build giving
@@ -711,19 +716,19 @@ anyone figure out even more easier ways to say this, so I wouldn't need to
try to explain this thing for minutes every time? :)
Irssi proxy supports sharing multiple server connections in different
-ports, like you can share ircnet in port 2777 and efnet in port 2778.
+ports, like you can share network in port 2777 and efnet in port 2778.
NOTE: you MUST add all the servers you
-are using to server and ircnet lists with /SERVER ADD and
-/IRCNET ADD. ..Except if you really don't want to for some
+are using to server and network lists with /SERVER ADD and
+/NETWORK ADD. ..Except if you really don't want to for some
reason, and you only use one server connection, you may simply set:
@@ -736,8 +741,8 @@ reason, and you only use one server connection, you may simply set:
specified in /SET irssiproxy_password. For example:
Irssi proxy works fine with other IRC clients as well.
@@ -784,7 +789,7 @@ of them you might want to change (the default value is shown):
/SET autocreate_query_level MSGS
New query window should be created when receiving messages with
this level. MSGS, DCCMSGS and NOTICES levels work currently. You can
- disable this with /SET -clear autocrate_query_level.
+ disable this with /SET -clear autocreate_query_level.
/SET autoclose_query 0
Query windows can be automatically closed after certain time of
diff --git a/apps/irssi/glib-2.0.m4_ b/apps/irssi/glib-2.0.m4_
index 0c1ae856..d6413ff7 100644
--- a/apps/irssi/glib-2.0.m4_
+++ b/apps/irssi/glib-2.0.m4_
@@ -5,7 +5,7 @@ dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [
dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject or
dnl gthread is specified in MODULES, pass to pkg-config
dnl
-AC_DEFUN(AM_PATH_GLIB_2_0,
+AC_DEFUN([AM_PATH_GLIB_2_0],
[dnl
dnl Get the cflags and libraries from pkg-config
dnl
@@ -19,6 +19,9 @@ AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run
gmodule)
pkg_config_args="$pkg_config_args gmodule-2.0"
;;
+ gmodule-no-export)
+ pkg_config_args="$pkg_config_args gmodule-no-export-2.0"
+ ;;
gobject)
pkg_config_args="$pkg_config_args gobject-2.0"
;;
@@ -173,6 +176,8 @@ main ()
:
else
echo "*** Could not run GLIB test program, checking why..."
+ ac_save_CFLAGS="$CFLAGS"
+ ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $GLIB_CFLAGS"
LIBS="$LIBS $GLIB_LIBS"
AC_TRY_LINK([
@@ -189,9 +194,7 @@ main ()
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
- echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
- echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
- echo "*** may want to edit the pkg-config script: $PKG_CONFIG" ])
+ echo "*** exact error that occured. This usually means GLIB is incorrectly installed."])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
diff --git a/apps/irssi/scripts/Makefile.am b/apps/irssi/scripts/Makefile.am
index 38cc4826..5e569253 100644
--- a/apps/irssi/scripts/Makefile.am
+++ b/apps/irssi/scripts/Makefile.am
@@ -1,13 +1,18 @@
-scriptdir = $(datadir)/silc/scripts
+SUBDIRS = examples
+
+scriptdir = $(datadir)/irssi/scripts
script_DATA = \
autoop.pl \
- clones.pl \
- hello.pl \
- mail.pl \
- beep.pl \
- dns.pl \
- mail-maildir.pl \
- silc-mime.pl
+ autorejoin.pl \
+ buf.pl \
+ dns.pl \
+ kills.pl \
+ mail.pl \
+ mlock.pl \
+ quitmsg.pl \
+ scriptassist.pl \
+ splitlong.pl \
+ usercount.pl
EXTRA_DIST = $(script_DATA)
diff --git a/apps/irssi/scripts/autoop.pl b/apps/irssi/scripts/autoop.pl
index 413f5e17..f7182999 100644
--- a/apps/irssi/scripts/autoop.pl
+++ b/apps/irssi/scripts/autoop.pl
@@ -1,7 +1,18 @@
# /AUTOOP <*|#channel> []
+# use friends.pl if you need more features
use Irssi;
use strict;
+use vars qw($VERSION %IRSSI);
+
+$VERSION = "1.00";
+%IRSSI = (
+ authors => 'Timo Sirainen',
+ name => 'autoop',
+ description => 'Simple auto-op script',
+ license => 'Public Domain',
+ changed => 'Sun Mar 10 23:18 EET 2002'
+);
my (%opnicks, %temp_opped);
@@ -53,7 +64,7 @@ sub autoop {
if (!$temp_opped{$nick} &&
$server->masks_match($masks, $nick, $host)) {
- $channel->command("/op $nick");
+ $channel->command("op $nick");
$temp_opped{$nick} = 1;
}
}
diff --git a/apps/irssi/scripts/autorejoin.pl b/apps/irssi/scripts/autorejoin.pl
new file mode 100644
index 00000000..2d23449f
--- /dev/null
+++ b/apps/irssi/scripts/autorejoin.pl
@@ -0,0 +1,52 @@
+# automatically rejoin to channel after kicked
+
+# /SET autorejoin_channels #channel1 #channel2 ...
+
+# NOTE: I personally don't like this feature, in most channels I'm in it
+# will just result as ban. You've probably misunderstood the idea of /KICK
+# if you kick/get kicked all the time "just for fun" ...
+
+use Irssi;
+use Irssi::Irc;
+use strict;
+use vars qw($VERSION %IRSSI);
+
+$VERSION = "1.00";
+%IRSSI = (
+ authors => 'Timo Sirainen',
+ name => 'autorejoin',
+ description => 'Automatically rejoin to channel after kicked',
+ license => 'Public Domain',
+ changed => 'Sun Mar 10 23:18 EET 2002'
+);
+
+sub channel_rejoin {
+ my ($server, $channel) = @_;
+
+ # check if channel has password
+ my $chanrec = $server->channel_find($channel);
+ my $password = $chanrec->{key} if ($chanrec);
+
+ # We have to use send_raw() because the channel record still
+ # exists and irssi won't even try to join to it with command()
+ $server->send_raw("JOIN $channel $password");
+}
+
+sub event_rejoin_kick {
+ my ($server, $data) = @_;
+ my ($channel, $nick) = split(/ +/, $data);
+
+ return if ($server->{nick} ne $nick);
+
+ # check if we want to autorejoin this channel
+ my @chans = split(/[ ,]+/, Irssi::settings_get_str('autorejoin_channels'));
+ foreach my $chan (@chans) {
+ if (lc($chan) eq lc($channel)) {
+ channel_rejoin($server, $channel);
+ last;
+ }
+ }
+}
+
+Irssi::settings_add_str('misc', 'autorejoin_channels', '');
+Irssi::signal_add('event kick', 'event_rejoin_kick');
diff --git a/apps/irssi/scripts/buf.pl b/apps/irssi/scripts/buf.pl
new file mode 100644
index 00000000..43b4b3dd
--- /dev/null
+++ b/apps/irssi/scripts/buf.pl
@@ -0,0 +1,122 @@
+use strict;
+use vars qw($VERSION %IRSSI);
+
+use Irssi qw(command signal_add signal_add_first active_win
+ settings_get_str settings_get_bool channels windows
+ settings_add_str settings_add_bool get_irssi_dir
+ window_find_refnum signal_stop);
+$VERSION = '2.13';
+%IRSSI = (
+ authors => 'Juerd',
+ contact => 'juerd@juerd.nl',
+ name => 'Scroll buffer restorer',
+ description => 'Saves the buffer for /upgrade, so that no information is lost',
+ license => 'Public Domain',
+ url => 'http://juerd.nl/irssi/',
+ changed => 'Mon May 13 19:41 CET 2002',
+ changes => 'Severe formatting bug removed * oops, I ' .
+ 'exposed Irssi to ircII foolishness * sorry ' .
+ '** removed logging stuff (this is a fix)',
+ note1 => 'This script HAS TO BE in your scripts/autorun!',
+ note2 => 'Perl support must be static or in startup',
+);
+
+# Q: How can I get a very smooth and clean upgrade?
+#
+# A: /set -clear upgrade_separator
+# /set upgrade_suppress_join ON (default)
+# /set channel_sync OFF
+
+# Q: Can I use color in the upgrade_separator?
+# Q: Is it possible to save my command history?
+# Q: Can I prevent the screen from blinking?
+# Q: Can you make it faster?
+#
+# A: Probably not, but if you can do it, tell me how.
+
+use Irssi::TextUI;
+use Data::Dumper;
+
+my %suppress;
+
+sub upgrade {
+ open BUF, sprintf('>%s/scrollbuffer', get_irssi_dir) or die $!;
+ print BUF join("\0", map $_->{server}->{address} . $_->{name}, channels), "\n";
+ for my $window (windows) {
+ next unless defined $window;
+ next if $window->{name} eq 'status';
+ my $view = $window->view;
+ my $line = $view->get_lines;
+ my $lines = 0;
+ my $buf = '';
+ if (defined $line){
+ {
+ $buf .= $line->get_text(1) . "\n";
+ $line = $line->next;
+ $lines++;
+ redo if defined $line;
+ }
+ }
+ printf BUF "%s:%s\n%s", $window->{refnum}, $lines, $buf;
+ }
+ close BUF;
+ unlink sprintf("%s/sessionconfig", get_irssi_dir);
+ command 'layout save';
+ command 'save';
+}
+
+sub restore {
+ open BUF, sprintf('<%s/scrollbuffer', get_irssi_dir) or die $!;
+ my @suppress = split /\0/, ;
+ if (settings_get_bool 'upgrade_suppress_join') {
+ chomp $suppress[-1];
+ @suppress{@suppress} = (2) x @suppress;
+ }
+ active_win->command('^window scroll off');
+ while (my $bla = ){
+ chomp $bla;
+ my ($refnum, $lines) = split /:/, $bla;
+ next unless $lines;
+ my $window = window_find_refnum $refnum;
+ unless (defined $window){
+ for 1..$lines;
+ next;
+ }
+ my $view = $window->view;
+ $view->remove_all_lines();
+ $view->redraw();
+ my $buf = '';
+ $buf .= for 1..$lines;
+ my $sep = settings_get_str 'upgrade_separator';
+ $sep .= "\n" if $sep ne '';
+ $window->gui_printtext_after(undef, MSGLEVEL_CLIENTNOTICE, "$buf\cO$sep");
+ $view->redraw();
+ }
+ active_win->command('^window scroll on');
+ active_win->command('^scrollback end');
+}
+
+sub suppress {
+ my ($first, $second) = @_;
+ return
+ unless scalar keys %suppress
+ and settings_get_bool 'upgrade_suppress_join';
+ my $key = $first->{address} .
+ (grep { (s/^://, /^[#!+&]/) } split ' ', $second)[0];
+ if (exists $suppress{$key} and $suppress{$key}--) {
+ signal_stop();
+ delete $suppress{$key} unless $suppress{$key};
+ }
+}
+
+settings_add_str 'buffer', 'upgrade_separator' => '=Upgrade=';
+settings_add_bool 'buffer', 'upgrade_suppress_join' => 1;
+
+signal_add_first 'session save' => 'upgrade';
+signal_add_first 'session restore' => 'restore';
+signal_add 'event 366' => 'suppress';
+signal_add 'event join' => 'suppress';
+
+unless (-f sprintf('%s/scripts/autorun/buf.pl', get_irssi_dir)) {
+ Irssi::print('PUT THIS SCRIPT IN ~/.irssi/scripts/autorun/ BEFORE /UPGRADING!!');
+}
diff --git a/apps/irssi/scripts/dns.pl b/apps/irssi/scripts/dns.pl
index 01a12f24..612fab0e 100644
--- a/apps/irssi/scripts/dns.pl
+++ b/apps/irssi/scripts/dns.pl
@@ -1,11 +1,20 @@
# /DNS || ...
-# for irssi 0.7.99 by Timo Sirainen
-# version 2.0
+use Irssi;
use strict;
use Socket;
use POSIX;
+use vars qw($VERSION %IRSSI);
+$VERSION = "2.1";
+%IRSSI = (
+ authors => 'Timo Sirainen',
+ name => 'dns',
+ description => '/DNS || ...',
+ license => 'Public Domain',
+ changed => 'Sun Mar 10 23:23 EET 2002'
+);
+
my (%resolve_hosts, %resolve_nicks, %resolve_print); # resolve queues
my $userhosts; # number of USERHOSTs currently waiting for reply
my $lookup_waiting; # 1 if we're waiting a reply for host lookup
@@ -25,6 +34,7 @@ sub cmd_dns {
my $ask_nicks = "";
my $print_error = 0;
foreach my $nick (split(" ", $nicks)) {
+ $nick = lc($nick);
if ($nick =~ /[\.:]/) {
# it's an IP or hostname
$resolve_hosts{$nick} = $tag;
@@ -66,9 +76,9 @@ sub sig_userhost {
# move resolve_nicks -> resolve_hosts
foreach my $host (@hosts) {
if ($host =~ /^([^=\*]*)\*?=.(.*)@(.*)/) {
- my $nick = $1;
+ my $nick = lc($1);
my $user = $2;
- $host = $3;
+ $host = lc($3);
$resolve_hosts{$host} = $resolve_nicks{$nick};
delete $resolve_nicks{$nick};
diff --git a/apps/irssi/scripts/examples/Makefile.am b/apps/irssi/scripts/examples/Makefile.am
new file mode 100644
index 00000000..c8d8c8e0
--- /dev/null
+++ b/apps/irssi/scripts/examples/Makefile.am
@@ -0,0 +1,8 @@
+scriptdir = $(datadir)/irssi/scripts
+
+script_DATA = \
+ command.pl \
+ msg-event.pl \
+ redirect.pl
+
+EXTRA_DIST = $(script_DATA)
diff --git a/apps/irssi/scripts/examples/command.pl b/apps/irssi/scripts/examples/command.pl
new file mode 100644
index 00000000..77a9d7fb
--- /dev/null
+++ b/apps/irssi/scripts/examples/command.pl
@@ -0,0 +1,23 @@
+# Example how to create your own /commands:
+
+# /HELLO - sends a "Hello, world!" to given nick.
+
+use Irssi;
+use strict;
+use vars qw($VERSION %IRSSI);
+
+$VERSION = "1.00";
+%IRSSI = (
+ authors => 'Timo Sirainen',
+ name => 'command',
+ description => 'Command example',
+ license => 'Public Domain'
+);
+
+sub cmd_hello {
+ my ($data, $server, $channel) = @_;
+
+ $server->command("/msg $data Hello, world!");
+}
+
+Irssi::command_bind('hello', 'cmd_hello');
diff --git a/apps/irssi/scripts/examples/msg-event.pl b/apps/irssi/scripts/examples/msg-event.pl
new file mode 100644
index 00000000..53174e23
--- /dev/null
+++ b/apps/irssi/scripts/examples/msg-event.pl
@@ -0,0 +1,41 @@
+# Example how to react on specific messages:
+
+# !reverse sends back the text reversed.
+
+use Irssi;
+use strict;
+use vars qw($VERSION %IRSSI);
+
+$VERSION = "1.00";
+%IRSSI = (
+ authors => 'Timo Sirainen',
+ name => 'msg-event',
+ description => 'Event example',
+ license => 'Public Domain'
+);
+
+sub event_privmsg {
+ # $server = server record where the message came
+ # $data = the raw data received from server, with PRIVMSGs it is:
+ # "target :text" where target is either your nick or #channel
+ # $nick = the nick who sent the message
+ # $host = host of the nick who sent the message
+ my ($server, $data, $nick, $host) = @_;
+
+ # split data to target/text
+ my ($target, $text) = $data =~ /^(\S*)\s:(.*)/;
+
+ # skip lines not beginning with !reverse
+ return if ($text !~ /!reverse (.*)/);
+ $text = $1;
+
+ if (!$server->ischannel($target)) {
+ # private message, $target contains our nick, so we'll need
+ # to change it to $nick
+ $target = $nick;
+ }
+
+ $server->command("notice $target reversed $text = ".reverse($text));
+}
+
+Irssi::signal_add('event privmsg', 'event_privmsg');
diff --git a/apps/irssi/scripts/examples/redirect.pl b/apps/irssi/scripts/examples/redirect.pl
new file mode 100644
index 00000000..6a7e94cc
--- /dev/null
+++ b/apps/irssi/scripts/examples/redirect.pl
@@ -0,0 +1,40 @@
+# Example how to do redirections, we'll grab the output of /WHOIS:
+
+# /RN - display real name of nick
+
+use Irssi;
+use Irssi::Irc;
+use strict;
+use vars qw($VERSION %IRSSI);
+
+$VERSION = "1.00";
+%IRSSI = (
+ authors => 'Timo Sirainen',
+ name => 'redirect',
+ description => 'Redirection example',
+ license => 'Public Domain'
+);
+
+sub cmd_realname {
+ my ($data, $server, $channel) = @_;
+
+ # ignore all whois replies except "No such nick" or the
+ # first line of the WHOIS reply
+ $server->redirect_event('whois', 1, $data, -1, '', {
+ 'event 402' => 'event 402',
+ 'event 401' => 'event 401',
+ 'event 311' => 'redir whois',
+ '' => 'event empty' });
+
+ $server->send_raw("WHOIS :$data");
+}
+
+sub event_rn_whois {
+ my ($num, $nick, $user, $host, $empty, $realname) = split(/ +/, $_[1], 6);
+ $realname =~ s/^://;
+
+ Irssi::print("%_$nick%_ is $realname");
+}
+
+Irssi::command_bind('rn', 'cmd_realname');
+Irssi::signal_add('redir whois', 'event_rn_whois');
diff --git a/apps/irssi/scripts/kills.pl b/apps/irssi/scripts/kills.pl
new file mode 100644
index 00000000..7ed2d533
--- /dev/null
+++ b/apps/irssi/scripts/kills.pl
@@ -0,0 +1,102 @@
+# Display kills with more understandable messages.
+# for irssi 0.7.98 by Timo Sirainen
+
+# There's one kind of nick collision this script doesn't handle - if the
+# collision is detected by the server you're connected to, it won't use
+# kill as quit reason, but "Nick collision(new)" or "..(old)". This is pretty
+# easy to understand already, happens hardly ever(?) and it can be faked
+# so I thought better not change it to kill message.
+
+# There's a pretty good explanation of (ircnet) ircd's server kills in
+# http://www.irc.org/tech_docs/ircnet/kills.html
+
+use Irssi;
+use vars qw($VERSION %IRSSI);
+
+$VERSION = "1.00";
+%IRSSI = (
+ authors => 'Timo Sirainen',
+ name => 'kills',
+ description => 'Displays kills with more understandable messages',
+ license => 'Public Domain',
+ changed => 'Sun Mar 10 23:18 EET 2002'
+);
+
+Irssi::theme_register([
+ 'kill_public', '{channick $0} {chanhost $1} killed by {nick $2}$3 {reason $4}'
+]);
+
+sub msg_quit {
+ my ($server, $nick, $addr, $data) = @_;
+
+ my $localkill;
+ if ($data =~ /^Killed \(([^ ]*) \((.*)\)\)$/) {
+ # remote kill
+ $localkill = 0;
+ } elsif ($data =~ /^Local Kill by ([^ ]*) \((.*)\)/) {
+ # local kill
+ $localkill = 1;
+ } else {
+ return;
+ }
+
+ my $killer = $1;
+ my $killmsg = $2;
+ my $msg = "\002Nick collision\002: ";
+
+ my @printargs = ();
+ if ($killmsg =~ /([^ ]*) != (.*)/) {
+ # 1 != 2
+ my $server1 = $1, $server2 = $2;
+
+ $server1 =~ s/([^\[]*)\[([^\]]*)\]/\1/;
+ $msg .= "$2 != $server2";
+ } elsif ($killmsg =~ /([^ ]*) <- (.*)/) {
+ # 1 <- 2
+ my $server1 = $1, $server2 = $2;
+
+ if ($server1 =~ /^\(/) {
+ # (addr1)server1 <- (add2)server2
+ $server1 =~ s/^\(([^\)]*)\)//;
+ my $nick1 = $1;
+ $server2 =~ s/^\(([^\)]*)\)//;
+ my $nick2 = $1;
+
+ $msg .= "server $server1";
+ $msg .= " (nick from $nick1)" if $nick1;
+ $msg .= " <- ";
+ $msg .= "\002$server2\002";
+ $msg .= " (nick from \002$nick2\002)" if $nick2;
+ } elsif ($server1 =~ /\)$/ || $server2 =~ /\)$/) {
+ # server1(nick) <- server2
+ # server1 <- server2(nick)
+ $server1 =~ s/\(([^\)]*)\)$//;
+ my $oldnick = $1;
+ $server2 =~ s/\(([^\)]*)\)$//;
+ $oldnick = $1 if $1;
+ $msg = "\002Nick change collision\002: $server1 <- \002$server2\002 (old nick \002$oldnick\002)";
+ } else {
+ # server1 <- server2
+ $msg = "\002Nick/server collision\002: $server1 <- \002$server2\002";
+ }
+ } else {
+ # something else, just show it as-is
+ $msg = $killmsg;
+ }
+
+ @list = $server->nicks_get_same($nick);
+ while (@list) {
+ $channel = $list[0];
+ shift @list;
+ # skip nick record
+ shift @list;
+
+ $channel->printformat(MSGLEVEL_QUITS, 'kill_public',
+ $nick, $addr, $killer,
+ $localkill ? " (local)" : "", $msg);
+ }
+
+ Irssi::signal_stop();
+}
+
+Irssi::signal_add('message quit', 'msg_quit');
diff --git a/apps/irssi/scripts/mail.pl b/apps/irssi/scripts/mail.pl
index 2d11a46f..33b3c22e 100644
--- a/apps/irssi/scripts/mail.pl
+++ b/apps/irssi/scripts/mail.pl
@@ -1,60 +1,254 @@
+$VERSION = "2.92";
+%IRSSI = (
+ authors => "Timo Sirainen, Matti Hiljanen, Joost Vunderink, Bart Matthaei",
+ contact => "tss\@iki.fi, matti\@hiljanen.com, joost\@carnique.nl, bart\@dreamflow.nl",
+ name => "mail",
+ description => "Fully customizable mail counter statusbar item with multiple mailbox and multiple Maildir support",
+ license => "Public Domain",
+ url => "http://irssi.org, http://scripts.irssi.de",
+);
+
# Mail counter statusbar item
-# for irssi 0.7.99 by Timo Sirainen
-# /SET mail_ext_program - specify external mail checker program
-# /SET mail_file - specifies mbox file location
-# /SET mail_refresh_time - in seconds, how often to check for new mail
+# for irssi 0.8.1 by Timo Sirainen
+#
+# Maildir support added by Matti Hiljanen
+# Multiple Maildir/mbox and customization support added by Joost Vunderink
+# OLD mailtreatment switch added by Bart Matthaei.
+# Improved some regexps in maildirmode by Bart Matthaei.
+# Maildirmode regexps (hopefully) fixed for good by Matti Hiljanen.
+#
+# You can add any number of mailboxes or Maildirs to watch for new mail in.
+# Give them any name and : will appear in your mail
+# statusbar item, where is the number of unread messages.
+# If only 1 mailbox/Maildir is defined, the statusbar item will have the
+# familiar form [Mail: ].
+# If you set mail_show_message to ON, irssi will print a message in the
+# active window whenever new mail arrives.
+#
+# Check /mailbox help for help.
-use strict;
use Irssi::TextUI;
+my $maildirmode = 0; # maildir=1, file(spools)=0
+my $old_is_not_new = 0;
my $extprog;
my ($last_refresh_time, $refresh_tag);
# for mbox caching
-my ($last_size, $last_mtime, $last_mailcount);
+my $last_size, $last_mtime, $last_mailcount, $last_mode;
-sub mbox_count {
- my $mailfile = shift;
+# list of mailboxes
+my %mailboxes = ();
+my %new_mails_in_box = ();
+my $nummailboxes = 0;
- my @stat = stat($mailfile);
- my $size = $stat[7];
- my $mtime = $stat[9];
+# the string to be stored in Irssi's mail_mailboxes setting
+my $mailboxsetting = "";
- # if the file hasn't changed, get the count from cache
- return $last_mailcount if ($last_size == $size && $last_mtime == $mtime);
- $last_size = $size;
- $last_mtime = $mtime;
+sub cmd_print_help {
+ Irssi::print(
+ "MAILBOX ADD \n".
+ "MAILBOX DEL \n".
+ "MAILBOX SHOW\n\n".
+ "Statusbar item to keep track of how many (new) emails there are in ".
+ "each of your mailboxes/Maildirs.\n\n".
+ "/MAILBOX ADD \n".
+ " - Adds a mailbox or a Maildir to the list.\n".
+ "/MAILBOX DEL \n".
+ " - Removes mailbox or Maildir named from the list.\n".
+ "/MAILBOX SHOW\n".
+ " - Shows a list of the defined mailboxes.\n\n".
+ "Use the following commands to change the behaviour:\n\n".
+ "/SET MAILDIRMODE on|off\n".
+ " - If maildirmode is on, the mailboxes in the list are assumed to be ".
+ "directories. Otherwise they are assumed to be spool files.\n".
+ " Default: off.\n".
+ "/SET MAIL_OLDNOTNEW on|off\n".
+ " - If switched on, mail marked als \"OLD\" will not be treated as new.\n".
+ " Default: off.\n".
+ "/SET MAIL_EXT_PROGRAM \n".
+ " - will be used to check for mail.\n".
+ "/SET MAIL_REFRESH_TIME \n".
+ " - Sets the time between checks to seconds.\n Default: 60.\n".
+ "/SET MAIL_SHOW_MESSAGE on|off\n".
+ " - If this is on, a message will be printed in the active window ".
+ "whenever new email is received.\n Default: off.\n".
+ "/SET MAIL_SHOW_ONLY_UNREAD on|off\n".
+ " - If you don't want to see a mailbox if it does not contain any new ".
+ "mail, set this to on.\n Default: on.\n" .
+ "/SET MAIL_SEPARATOR \n".
+ " - Sets the character to be printed between each mailbox.\n".
+ " The default is a comma.\n".
+ "/SET MAIL_FORMAT \n".
+ " - Sets the format of each mailbox.\n".
+ " Allowed variables:\n".
+ " %%n = mailbox name\n".
+ " %%u = number of unread mail\n".
+ " %%r = number of read mail\n".
+ " %%t = total amount of mail\n".
+ " The default format is %%n:%%u/%%t.\n".
+ "\nSee also: STATUSBAR"
+ ,MSGLEVEL_CRAP);
+}
+
+sub mbox_count {
+ my $mailfile = shift;
+ my $unread = 0;
+ my $read = 0;
+ my $maildirmode=Irssi::settings_get_bool('maildir_mode');
+ my $old_is_not_new=Irssi::settings_get_bool('mail_oldnotnew');
- my $count;
if ($extprog ne "") {
- $count = `$extprog`;
- chomp $count;
+ $total = `$extprog`;
+ chomp $unread;
} else {
- return 0 if (!open(F, $mailfile));
+ if (!$maildirmode) {
+ if (-f $mailfile) {
+ my @stat = stat($mailfile);
+ my $size = $stat[7];
+ my $mtime = $stat[9];
+
+ # if the file hasn't changed, get the count from cache
+ return $last_mailcount if ($last_size == $size && $last_mtime == $mtime);
+ $last_size = $size;
+ $last_mtime = $mtime;
+
+ my $f = gensym;
+ return 0 if (!open($f, $mailfile));
- $count = 0;
- while () {
- $count++ if (/^From /);
- $count-- if (/^Subject: .*FOLDER INTERNAL DATA/);
+ # count new mails only
+ my $internal_removed = 0;
+ while (<$f>) {
+ $unread++ if (/^From /);
+
+ if(!$old_is_not_new) {
+ $unread-- if (/^Status: R/);
+ } else {
+ $unread-- if (/^Status: [OR]/);
+ }
+
+ $read++ if (/^From /);
+
+ # Remove folder internal data, but only once
+ if (/^Subject: .*FOLDER INTERNAL DATA/) {
+ if ($internal_removed == 0) {
+ $internal_removed = 1;
+ $read--;
+ $unread--;
+ }
+ }
+ }
+ close($f);
+ }
+ } else {
+ opendir(DIR, "$mailfile/cur") or return 0;
+ while (defined(my $file = readdir(DIR))) {
+ next if $file =~ /^(.|..)$/;
+ # Maildir flags: http://cr.yp.to/proto/maildir.html
+ # My old regexps were useless if the MUA added any
+ # non-default flags -qvr
+ #
+ # deleted mail
+ next if $file =~ /\:.*?T.*?$/;
+ if($old_is_not_new) {
+ # when mail gets moved from new to cur it's name _always_
+ # changes from uniq to uniq:info, even when it's still not
+ # read. I assume "old mail" means mail which hasn't been read
+ # yet but it has been "acknowledged" by the user. (it's been
+ # moved to cur) -qvr
+ if ($file =~ /\:.*?$/) {
+ $read++;
+ next;
+ }
+ } else {
+ if ($file =~ /\:.*?S.*?$/) {
+ $read++;
+ next;
+ }
+ }
+ $unread++;
+ }
+ closedir(DIR);
+
+ opendir(DIR, "$mailfile/new") or return 0;
+ while (defined(my $file = readdir(DIR))) {
+ next if $file =~ /^(.|..)$/;
+ $unread++;
+ }
+ closedir(DIR);
}
- close(F);
}
- $last_mailcount = $count;
- return $count;
+ if ($unread eq "" || $unread < 0) {
+ $unread = 0;
+ }
+ if ($read eq "" || $read < 0) {
+ $read = 0;
+ }
+
+ $last_mailcount = $unread;
+
+ return ($unread, $read);
}
+# Checks for mail and sets the statusbar item to the right string.
+# Also shows a message in the active window if that setting is set.
sub mail {
my ($item, $get_size_only) = @_;
- my $count = mbox_count(Irssi::settings_get_str('mail_file'));
- if ($count == 0) {
+ my $result;
+ my $format = Irssi::settings_get_str('mail_format');
+ my $unread = 0;
+ my $read = 0;
+ my $total = 0;
+
+ # check all mailboxes for new email
+ foreach $name (keys(%mailboxes)) {
+ my $box = $mailboxes{$name};
+ # replace "~/" at the beginning by the user's home dir
+ $box =~ s/^~\//$ENV{'HOME'}\//;
+
+ ($unread, $read) = mbox_count($box);
+ $unread = "0" if ($unread eq "");
+ $read = "0" if ($read eq "");
+ $total = $unread + $read;
+ $total = "0" if ($total eq "");
+
+ next if (Irssi::settings_get_bool('mail_show_only_unread') && $unread == 0);
+
+ if ($total eq "") { $total = 0; }
+ if (length($result) > 0) {
+ $result .= Irssi::settings_get_str('mail_separator');
+ }
+ my $string = $format;
+ $string =~ s/%n/$name/;
+ $string =~ s/%u/$unread/;
+ $string =~ s/%r/$read/;
+ $string =~ s/%t/$total/;
+ $result .= $string;
+
+ # Show -!- You have new messages in .
+ # Show this only if there are any new, unread messages.
+ if (Irssi::settings_get_bool('mail_show_message') &&
+ $unread > $new_mails_in_box{$name}) {
+ $new_mails = $unread - $new_mails_in_box{$name};
+ if ($nummailboxes == 1) {
+ Irssi::print("You have $new_mails new message" . ($new_mails != 1 ? "s." : "."), MSGLEVEL_CRAP);
+ } else {
+ Irssi::print("You have $new_mails new message" . ($new_mails != 1 ? "s " : " ") . "in $name.", MSGLEVEL_CRAP);
+ }
+ }
+
+ $new_mails_in_box{$name} = $unread;
+ }
+
+ if (length($result) == 0) {
# no mail - don't print the [Mail: ] at all
if ($get_size_only) {
$item->{min_size} = $item->{max_size} = 0;
}
} else {
- $item->default_handler($get_size_only, undef, $count, 1);
+ $item->default_handler($get_size_only, undef, $result, 1);
}
}
@@ -62,22 +256,159 @@ sub refresh_mail {
Irssi::statusbar_items_redraw('mail');
}
+# Adds the mailboxes from a string. Only to be used during startup.
+sub add_mailboxes {
+ my $boxstring = $_[0];
+ my @boxes = split(/,/, $boxstring);
+
+ foreach $dbox(@boxes) {
+ my $name = $dbox;
+ $name = substr($dbox, 0, index($dbox, '='));
+ my $box = $dbox;
+ $box = substr($dbox, index($dbox, '=') + 1, length($dbox));
+ addmailbox($name, $box);
+ }
+}
+
+sub addmailbox {
+ my ($name, $box) = @_;
+
+ if (exists($mailboxes{$name})) {
+ if ($box eq $mailboxes{$name}) {
+ Irssi::print("Mailbox $name already set to $box", MSGLEVEL_CRAP);
+ } else {
+ Irssi::print("Mailbox $name changed to $box", MSGLEVEL_CRAP);
+ $new_mails_in_box{$name} = 0;
+ }
+ } else {
+ Irssi::print("Mailbox $name added: " . $box, MSGLEVEL_CRAP);
+ $new_mails_in_box{$name} = 0;
+ $nummailboxes++;
+ }
+ $mailboxes{$name} = $box;
+}
+
+sub delmailbox {
+ my $name = $_[0];
+
+ if (exists($mailboxes{$name})) {
+ Irssi::print("Mailbox $name removed", MSGLEVEL_CRAP);
+ delete($mailboxes{$name});
+ delete($new_mails_in_box{$name});
+ $nummailboxes--;
+ } else {
+ Irssi::print("No such mailbox $name. Use /mailbox show to see a list.", MSGLEVEL_CRAP);
+ }
+}
+
+sub update_settings_string {
+ my $setting;
+
+ foreach $name (keys(%mailboxes)) {
+ $setting .= $name . "=" . $mailboxes{$name} . ",";
+ }
+
+ Irssi::settings_set_str("mail_mailboxes", $setting);
+}
+
+sub cmd_addmailbox {
+ my ($name, $box) = split(/ +/, $_[0]);
+
+ if ($name eq "" || $box eq "") {
+ Irssi::print("Use /mailbox add to add a mailbox.", MSGLEVEL_CRAP);
+ return;
+ }
+
+ addmailbox($name, $box);
+ update_settings_string();
+ refresh_mail();
+}
+
+sub cmd_delmailbox {
+ my $name = $_[0];
+
+ if ($name eq "") {
+ Irssi::print("Use /mailbox del to delete a mailbox.", MSGLEVEL_CRAP);
+ return;
+ }
+
+ delmailbox($name);
+ update_settings_string();
+ refresh_mail();
+}
+
+sub cmd_showmailboxes {
+ if ($nummailboxes == 0) {
+ Irssi::print("No mailboxes defined.", MSGLEVEL_CRAP);
+ return;
+ }
+ Irssi::print("Mailboxes:", MSGLEVEL_CRAP);
+ foreach $box (keys(%mailboxes)) {
+ Irssi::print("$box: " . $mailboxes{$box}, MSGLEVEL_CRAP);
+ }
+}
+
+sub cmd_mailboxes {
+ my ($data, $server, $item) = @_;
+ if ($data =~ m/^[(show)|(add)|(del)]/i ) {
+ Irssi::command_runsub ('mailbox', $data, $server, $item);
+ }
+ else {
+ Irssi::print("Use /mailbox (show|add|del).")
+ }
+}
+
+sub init_mailboxes {
+ # Add the mailboxes at startup of the script
+ my $boxes = Irssi::settings_get_str('mail_mailboxes');
+ if (length($boxes) > 0) {
+ add_mailboxes($boxes);
+ }
+}
+
sub read_settings {
$extprog = Irssi::settings_get_str('mail_ext_program');
my $time = Irssi::settings_get_int('mail_refresh_time');
- return if ($time == $last_refresh_time);
+ my $mode = Irssi::settings_get_bool('maildir_mode');
+ unless ($time == $last_refresh_time) {
+ $last_refresh_time = $time;
+ Irssi::timeout_remove($refresh_tag) if ($refresh_tag);
+ $refresh_tag = Irssi::timeout_add($time*1000, 'refresh_mail', undef);
+ }
+ return if ($mode == $last_mode);
+ $last_mode = $mode;
+ refresh_mail;
+}
+
- $last_refresh_time = $time;
- Irssi::timeout_remove($refresh_tag) if ($refresh_tag);
- $refresh_tag = Irssi::timeout_add($time*1000, 'refresh_mail', undef);
+if (!$maildirmode) {
+ my $default = "1=" . $ENV{'MAIL'} . ",";
+ Irssi::settings_add_str('misc', 'mail_mailboxes', $default);
+} else {
+ my $default = "1=~/Maildir/,";
+ Irssi::settings_add_str('misc', 'mail_mailboxes', $default);
}
+Irssi::command_bind('mailbox show', 'cmd_showmailboxes');
+Irssi::command_bind('mailbox add', 'cmd_addmailbox');
+Irssi::command_bind('mailbox del', 'cmd_delmailbox');
+Irssi::command_bind('mailbox help', 'cmd_print_help');
+Irssi::command_bind('mailbox', 'cmd_mailboxes');
+
Irssi::settings_add_str('misc', 'mail_ext_program', '');
-Irssi::settings_add_str('misc', 'mail_file', $ENV{'MAIL'});
Irssi::settings_add_int('misc', 'mail_refresh_time', 60);
+Irssi::settings_add_bool('misc', 'maildir_mode', "$maildirmode");
+Irssi::settings_add_bool('misc', 'mail_oldnotnew', "$old_is_not_new");
+Irssi::settings_add_str('misc', 'mail_separator', ",");
+Irssi::settings_add_bool('misc', 'mail_show_message', "0");
+Irssi::settings_add_str('misc', 'mail_format', '%n:%u/%t');
+Irssi::settings_add_bool('misc', 'mail_show_only_unread', "1");
Irssi::statusbar_item_register('mail', '{sb Mail: $0-}', 'mail');
read_settings();
+init_mailboxes();
Irssi::signal_add('setup changed', 'read_settings');
-mbox_count(Irssi::settings_get_str('mail_file'));
+refresh_mail();
+
+# EOF
diff --git a/apps/irssi/scripts/mlock.pl b/apps/irssi/scripts/mlock.pl
new file mode 100644
index 00000000..ed2fe52b
--- /dev/null
+++ b/apps/irssi/scripts/mlock.pl
@@ -0,0 +1,135 @@
+# /MLOCK
+#
+# Locks the channel mode to , if someone else tries to change the mode
+# Irssi will automatically change it back. +k and +l are a bit special since
+# they require the parameter. If you omit the parameter, like setting the
+# mode to "+ntlk", Irssi will allow all +k and +l (or -lk) mode changes.
+# You can remove the lock with /MODE #channel -
+
+use Irssi;
+use Irssi::Irc;
+use strict;
+use vars qw($VERSION %IRSSI);
+
+$VERSION = "1.00";
+%IRSSI = (
+ authors => 'Timo Sirainen',
+ name => 'mlock',
+ description => 'Channel mode locking',
+ license => 'Public Domain',
+ changed => 'Sun Mar 10 23:18 EET 2002'
+);
+
+my %keep_channels;
+
+sub cmd_mlock {
+ my ($data, $server) = @_;
+ my ($channel, $mode) = split(/ /, $data, 2);
+
+ if ($mode eq "-") {
+ # remove checking
+ delete $keep_channels{$channel};
+ } else {
+ $keep_channels{$channel} = $mode;
+ mlock_check_mode($server, $channel);
+ }
+}
+
+sub mlock_check_mode {
+ my ($server, $channame) = @_;
+
+ my $channel = $server->channel_find($channame);
+ return if (!$channel || !$channel->{chanop});
+
+ my $keep_mode = $keep_channels{$channame};
+ return if (!$keep_mode);
+
+ # old channel mode
+ my ($oldmode, $oldkey, $oldlimit);
+ $oldmode = $channel->{mode};
+ $oldmode =~ s/^([^ ]*).*/\1/;
+ $oldkey = $channel->{key};
+ $oldlimit = $channel->{limit};
+
+ # get the new channel key/limit
+ my (@newmodes, $newkey, $limit);
+ @newmodes = split(/ /, $keep_mode); $keep_mode = $newmodes[0];
+ if ($keep_mode =~ /k/) {
+ if ($keep_mode =~ /k.*l/) {
+ $newkey = $newmodes[1];
+ $limit = $newmodes[2];
+ } elsif ($keep_mode =~ /l.*k/) {
+ $limit = $newmodes[1];
+ $newkey = $newmodes[2];
+ } else {
+ $newkey = $newmodes[1];
+ }
+ } elsif ($keep_mode =~ /l/) {
+ $limit = $newmodes[1];
+ }
+
+ # check the differences
+ my %allmodes;
+ $keep_mode =~ s/^\+//;
+ for (my $n = 0; $n < length($keep_mode); $n++) {
+ my $modechar = substr($keep_mode, $n, 1);
+ $allmodes{$modechar} = '+';
+ }
+
+ for (my $n = 0; $n < length($oldmode); $n++) {
+ my $modechar = substr($oldmode, $n, 1);
+
+ if ($allmodes{$modechar} eq '+') {
+ next if (($modechar eq "k" && $newkey ne $oldkey) ||
+ ($modechar eq "l" && $limit != $oldlimit));
+ delete $allmodes{$modechar};
+ } else {
+ $allmodes{$modechar} = '-';
+ }
+ }
+
+ # create the mode change string
+ my ($modecmd, $extracmd);
+ foreach my $mode (keys %allmodes) {
+ Irssi::print("key = '$mode':".$allmodes{$mode});
+ if ($mode eq "k") {
+ if ($allmodes{$mode} eq '+') {
+ next if ($newkey eq "");
+ if ($oldkey ne "") {
+ # we need to get rid of old key too
+ $modecmd .= "-k";
+ $extracmd .= " $oldkey";
+ }
+ $extracmd .= " $newkey";
+ } else {
+ $extracmd .= " $oldkey";
+ }
+ }
+ if ($mode eq "l" && $allmodes{$mode} eq '+') {
+ next if ($limit <= 0);
+ $extracmd .= " $limit";
+ }
+ $modecmd .= $allmodes{$mode}.$mode;
+ }
+
+ if ($modecmd ne "") {
+ $channel->{server}->command("mode $channame $modecmd$extracmd");
+ }
+}
+
+sub mlock_mode_changed {
+ my ($server, $data) = @_;
+ my ($channel, $mode) = split(/ /, $data, 2);
+
+ mlock_check_mode($server, $channel);
+}
+
+sub mlock_synced {
+ my $channel = $_[0];
+
+ mlock_check_mode($channel->{server}, $channel->{name});
+}
+
+Irssi::command_bind('mlock', 'cmd_mlock');
+Irssi::signal_add_last("event mode", "mlock_mode_changed");
+Irssi::signal_add("channel synced", "mlock_synced");
diff --git a/apps/irssi/scripts/quitmsg.pl b/apps/irssi/scripts/quitmsg.pl
new file mode 100644
index 00000000..41bddaa8
--- /dev/null
+++ b/apps/irssi/scripts/quitmsg.pl
@@ -0,0 +1,45 @@
+# If quit message isn't given, quit with a random message
+# read from ~/.irssi/irssi.quit
+
+use Irssi;
+use Irssi::Irc;
+use strict;
+use vars qw($VERSION %IRSSI);
+
+$VERSION = "1.00";
+%IRSSI = (
+ authors => 'Timo Sirainen',
+ name => 'quitmsg',
+ description => 'Random quit messages',
+ license => 'Public Domain',
+ changed => 'Sun Mar 10 23:18 EET 2002'
+);
+
+my $quitfile = glob "~/.irssi/irssi.quit";
+
+sub cmd_quit {
+ my ($data, $server, $channel) = @_;
+ return if ($data ne "");
+
+ open (f, $quitfile) || return;
+ my $lines = 0; while() { $lines++; };
+
+ my $line = int(rand($lines))+1;
+
+ my $quitmsg;
+ seek(f, 0, 0); $. = 0;
+ while() {
+ next if ($. != $line);
+
+ chomp;
+ $quitmsg = $_;
+ last;
+ }
+ close(f);
+
+ foreach my $server (Irssi::servers) {
+ $server->command("disconnect ".$server->{tag}." $quitmsg");
+ }
+}
+
+Irssi::command_bind('quit', 'cmd_quit');
diff --git a/apps/irssi/scripts/scriptassist.pl b/apps/irssi/scripts/scriptassist.pl
new file mode 100644
index 00000000..786ec57f
--- /dev/null
+++ b/apps/irssi/scripts/scriptassist.pl
@@ -0,0 +1,1160 @@
+# by Stefan "tommie" Tomanek
+#
+# scriptassist.pl
+
+
+use strict;
+
+use vars qw($VERSION %IRSSI);
+$VERSION = '2003020803';
+%IRSSI = (
+ authors => 'Stefan \'tommie\' Tomanek',
+ contact => 'stefan@pico.ruhr.de',
+ name => 'scriptassist',
+ description => 'keeps your scripts on the cutting edge',
+ license => 'GPLv2',
+ url => 'http://irssi.org/scripts/',
+ changed => $VERSION,
+ modules => 'Data::Dumper LWP::UserAgent (GnuPG)',
+ commands => "scriptassist"
+);
+
+use vars qw($forked %remote_db $have_gpg);
+
+use Irssi 20020324;
+use Data::Dumper;
+use LWP::UserAgent;
+use POSIX;
+
+# GnuPG is not always needed
+use vars qw($have_gpg @complist);
+$have_gpg = 0;
+eval "use GnuPG qw(:algo :trust);";
+$have_gpg = 1 if not ($@);
+
+sub show_help() {
+ my $help = "scriptassist $VERSION
+/scriptassist check
+ Check all loaded scripts for new available versions
+/scriptassist update