1
0
mirror of https://github.com/irssi/irssi.git synced 2024-06-09 06:20:45 +00:00

Initial revision

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 1999-09-03 14:27:29 +00:00 committed by cras
parent 2d97cd3cc4
commit 770ae4596d
29 changed files with 4987 additions and 0 deletions

31
.cvsignore Normal file
View File

@ -0,0 +1,31 @@
Makefile
Makefile.in
aclocal.m4
config.cache
config.guess
config.h
config.log
config.status
config.sub
configure
configure.scan
libtool
ltconfig
ltmain.sh
stamp-h
stamp-h.in
stamp.h
version.h
config.h.in
.exrc
gnome-bug
gnome-config
install-sh
missing
mkinstalldirs
INSTALL
intl
ABOUT-NLS
COPYING
irssi.spec
default-config.h

1
AUTHORS Normal file
View File

@ -0,0 +1 @@
Timo Sirainen, cras@irccrew.org

383
COMMANDS Normal file
View File

@ -0,0 +1,383 @@
** Some definations
"Level" usually means that you can use these words there:
CRAP - Can be almost anything
PUB - Public messages in channel
MSGS - Private messages
CHAN - Channel messages: joins, parts, quits, etc.
NOTICES - Notices
SNOTES - Notices from server
WALLOPS - Wallops
ACTIONS - Actions (/me)
DCC - DCC messages
CTCP - CTCP messages
HILIGHT - Hilighted text
CLIENTNOTICES - Irssi's notices
CLIENTERRORS - Irssi's error messages
** Server handling
CONNECT <address>[:port[:password]]
Connect to specified server
DISCONNECT <* / tag> [message]
Disconnect from server
SERVER <address>[:port[:password]]
Disconnect from current server and connect to new one
SERVERS
Display a list of servers
RMRECONNS
Remove all servers from reconnection list
** Basic IRC commands
QUIT [message]
Quit irssi
JOIN <channel> [key] [, channel...]
Join to channel(s)
PART [channel] [message]
Leave from channel
QUERY <nick>
Create query window
UNQUERY <nick>
Close query window
MSG <nick/channel> <message>
Send message to nick/channel
ME <message>
Send action to channel (/me thinks..)
NOTICE <nick/channel> <message>
Send notice to nick/channel
WHOIS [server/nick] <nick>
Send WHOIS query, you can also specify from what server to ask the
information. If you type the nick twice it will ask from the same
server what nick is using.
AWAY [message]
Sets yourself away/unaway
AWAYALL [message]
Sets yourself away/unaway to all connected servers
WHO <nick/channel>
Show WHO list
NAMES [channel]
List nicks (in channel)
** Bit more advanced commands
MODE <channel/nick> <mode>
Get/set channel/nick mode.
Get channel modes:
b - Get ban list
e - Get ban exception list
I - Get invite list
Set channel modes (use +/- before these):
b *!ban@mask - Set/remove ban
e *!ban@mask - Set/remove ban exception
I *!ban@mask - Set/remove channel invite
o nick - Set/remove op status
v nick - Set/remove voice status
l limit - Set remove max. people limit in channel
k key - Set/remove channel key
s - Secret
p - Private
m - Moderated
i - Invite only
n - No external messages
t - Only ops can change topic
User modes:
i - Invisible
w - Show wallops
s - Show server notices
TOPIC [channel] [topic]
Get/set channel topic
INVITE <nick> [channel]
Invite nick to channel
CTCP <nick/channel> <command>
Send CTCP request to nick/channel (PING, VERSION, ..)
NCTCP <nick/channel> <reply>
Send CTCP reply to nick/channel
PING <nick>
Send CTCP PING to nick and tell how long it took to receive the reply
ISON [nick [nick...]]
Ask if nicks are in IRC.
WALL [channel] <message>
Send notice message to all operators in channel.
OP, DEOP, VOICE, DEVOICE [channel] [nick [nick...]
Op/deop/voice/devoice nick(s) in channel
KICK [channel] <nick> <reason>
Kick nick from channel
KICKBAN [channel] <nick> <reason>
Kick+ban nick from channel
KNOCKOUT [secs] <nick> <reason>
Kick+ban+delay (default to 5min)+unban
BAN [channel] [nick [nick...]]
Ban nick(s) in channel
UNBAN [channel] [mask [mask...]]
Remove ban(s) from channel
BANSTAT [channel]
List bans and ban exceptions in channel
BANTYPE <normal/host/domain/custom>
Set ban type:
Normal - *!user@*.domain.net
Host - *!*@host.domain.net
Domain - *!*@*.domain.net
Custom [nick] [user] [host] [domain]
eg. /bantype custom nick domain - nick!*@*.domain.net
eg. /bantype custom user host - *!user@host.domain.net
INVITELIST [channel]
List invites (+I) in channel
VERSION [server]
Displays irssi version and asks IRC server's version
VER [nick/channel]
Sends CTCP VERSION request to nick/channel
SV [nick/channel]
Sends irssi version text to nick/channel
KILL <nick> <message>
Kill nick from irc network. [irc ops only]
WALLOPS <message>
Write wallops message. [irc ops only]
QUOTE <message>
Send raw data to irc server - DON'T USE THIS unless you really know
what you're doing!
** DCC handling
DCC
List DCC connections (same as DCC LIST)
DCC CHAT <nick>
Open DCC chat
DCC SEND <nick> <filename>
Send file to nick
DCC GET <nick> [filename]
Get file offered by nick
DCC RESUME <nick> [filename]
(MIRC) Resume getting file offered by nick
DCC CLOSE <type> <nick> [filename]
Close DCC connection
DCC LIST
List DCC connections
MIRCDCC [n]
Set MIRC style CTCPs on/off
** User interface handling
WINDOW <NEW/CLOSE/SERVER/PREV/NEXT/GOTO/LEVEL>
NEW [HIDDEN/TAB]
Create new window (in tab)
CLOSE
Close the current window
SERVER <tag>
Change which server to use in current window
PREV/NEXT/GOTO <N>
Go to previous/next/Nth window
LEVEL <[+/-]pub/msgs/...>
Change window level, eg.
/window level msgs - creates messages window
/window level all -msgs - creates status window
CLEAR
Clear screen
ECHO <text>
Print text to screen
MODES
Open channel modes dialog (GTK/GNOME version)
GWHOIS <nick>
Display WHOIS information in dialog (GTK/GNOME version)
LAST [-pub -msgs...] <text>
Display (only public/msgs/..) lines where <text> appears
(Text version only)
** Configuration
SET [key [=value / [key [key..]]
Get/set configuration
ALIAS, UNALIAS <alias> [command]
Set/remove alias, /unalias is the same as /alias without command
These codes are extracted in commands:
%0 : name of alias
%1, %2, %3 .. : %th word
&1, &2, &3 .. : &th word + the rest of the text after it
%c : channel name
Typing extra / before /command (//command) ignores any aliases
IGNORE, UNIGNORE <mask> [level [level..]]
Ignore/unignore specified level(s) or everything from nick
NOTIFY <mask> [ircnet [ircnet..]]
Add mask (nick) to notify list for specified ircnets..
UNNOTIFY <mask>
Remove mask from notify list.
LOG <CREATE/CLOSE/START/STOP/LIST>
CREATE <filename> [<+/->level ...] [#channel/nick [
[<+/->level ...] ...]
Create and start logging to file
Example: /log create mylog -all +msgs #linux +chan +public
(or simply #linux +all logs everything that appears in #linux
window).
CLOSE <filename>
Close log and remove from configuration
START <filename>
Start logging to file
STOP <filename>
Stop logging to file
LIST
List logs.
LOAD <plugin> [arguments]
Load plugin
UNLOAD <plugin>
Unload plugin

46
Makefile.am Normal file
View File

@ -0,0 +1,46 @@
# create default-config.h
config.h: default-config.h
default-config.h: config
./file2header.sh config > default-config.h
## if <internationalization support>
#SUBDIRS = po intl macros support # <your subdirs here>
## else
if BUILD_PLUGINS
PLUGINS=plugins
endif
if BUILD_SERVERTEST
SERVERTEST=servertest
endif
SUBDIRS = macros src $(PLUGINS) $(SERVERTEST)
## endif
## to automatically rebuild aclocal.m4 if any of the macros in
## `macros/' change
@MAINT@include macros/macros.dep
@MAINT@macros/macros.dep: macros/Makefile.am
@MAINT@ cd macros && $(MAKE) macros.dep
if HAVE_GNOME
appletdir = $(datadir)/applets/Network
applet_DATA = irssi.desktop
corbadir = $(sysconfdir)/CORBA/servers
corba_DATA = irssi.gnorba
endif
confdir = $(sysconfdir)/irssi
conf_DATA = config colorless.theme
EXTRA_DIST = window-views-patch.diff \
autogen.sh \
README-HEBREW \
COMMANDS \
file2header.sh \
irssi.spec.in \
irssi.spec \
$(conf_DATA) \
irssi.gnorba \
irssi.desktop

0
NEWS Normal file
View File

82
README Normal file
View File

@ -0,0 +1,82 @@
irssi
* ABOUT
Irssi is an IRC client made with GTK+ toolkit and (optional) GNOME libraries.
A small text mode version is also somewhat working, there's also a really
simple daemon version which just loads "bot" plugin (which doesn't exist).
I'd also like to see KDE version but someone else will have to do it.
* FEATURES
See COMMANDS file for list of all commands irssi knows.
I've been asked quite a lot about why should one use irssi, what does it do
that other IRC clients don't? Well, to tell you the truth, I have no idea :)
Still I've got a lot of mails saying it's the best GUI IRC client they've
ever used :) Let's see.. It should be easy to use, it has most of the
features IRC client needs and it's pretty stable. Here's a small list of what
it does:
- Nice configuration :) Especially the color settings.
- You can connect to multiple servers. Irssi is also IRC network aware so
you can specify some settings to work only in specified IRC networks.
- Automatically connect to IRC server(s) at startup, automatically join to
channels when connected
- All code is nonblocking, it won't hang while connecting to server or
opening DCC connection. Host lookups are done in separate processes.
- DCC send, receive and chat with GUI
- GNOME panel support, channels and queries are displayed in GNOME panel
where you can easily see which channels have been updated (label turns to
red) and click in them to open the channel.
- Doubleclicking URL in text widget launches specified web/ftp/email client,
also doubleclicking channel/nick join to channel or creates query.
- Aliases, ignores, autoignoring when flooding, notify lists, completing
specified words with tab (like home&lt;tab&gt; -> http://my.home.page),
hilighting lines with specified texts
- Smart nick completion
- Configurable logging support
- You can use ZVT widget to print texts, it's really fast so you can be
joined to many high traffic channels and irssi won't slow up
- Plugins support, creating plugins is really easy.
- Lots of nice GUI stuff :)
* INSTALLATION
./configure
make
make install
Configure can use these parameters (all of these defaults to yes):
--with-proplist=dir Specify libPropList directory
--with-servertest Build test irc server which you can use to try crash
irc clients
--without-gnome Build without GNOME libraries
--without-gnome-panel Build without GNOME panel
--without-imlib Build without Imlib library
--without-socks Build without socks library
--without-textui Build without text mode version
--enable-memdebug Enable memory debugging, great for finding memory
leaks
--enable-gtk-hebrew Enable Hebrew support - see README-HEBREW
There's also some others, you can get a full list with ./configure --help
If you don't want to run irssi in panel, add --no-applet to command line
parameters.
* BUGS / SUGGESTIONS
See TODO file if it is already listed in there - if not send me email..
* AUTHOR
Timo Sirainen, cras@irccrew.org, cras/ircnet/#irssi, http://xlife.dhs.org/irssi/

43
README-HEBREW Normal file
View File

@ -0,0 +1,43 @@
Hebrew support in irssi
-----------------------
Before you can enjoy IRCing in Hebrew, you need to get two other things.
1. FriBidi, a free implementation of the Unicode BiDi algorithm).
See http://imagic.weizmann.ac.il/~dov/freesw/FriBidi/
2. hebxfonts, a collection of Unicode-encoded Hebrew fonts along
with the keyboard mappings to use them (the right Alt key will be
configured to generate Hebrew characters).
See http://metalab.unc.edu/pub/Linux/X11/fonts/
After you get these two, you should be ok to go. To enable the Hebrew
support, specify --enable-gtk-hebrew=<path>. If the path starts with a
tilde (~), it is taken relative to your home directory. Here's a good
idea:
configure --enable-gtk-hebrew=~/.gnome/irssi-hebrew.gtkrc
After compiling and installing, you should copy the supplied gtkrc
file to where you told the program it would find it. Say you're at the
root of the irssi source tree, typing:
cp src/gui-gnome/irssi-hebrew.gtkrc ~/.gnome/irssi-hebrew.gtkrc
would do the trick.
One last configuration task is done from within irssi. Fire it up,
then go to the preferences dialog box and select a Hebrew font.
(e.g., -misc-fixed-medium-r-normal-*-*-120-*-*-c-*-iso8859-8)
The Hebrew support is not complete; it works as expected (ie, reversing
stuff with the FriBidi thingy) for the text entry field and for the
output text. In other places, you may see Hebrew characters, only
going left-to-right; in yet other places, you may not see Hebrew at all.
I have no intention of making this any better; comprehensive support
for Hebrew should come from within the GTK+ widget set, and not by
patching applications.
Ronen Tzur <rtzur@shani.net>

140
TODO Normal file
View File

@ -0,0 +1,140 @@
- window goto active, name
*** Bugs
- If there's any empty lists in configuration file (like ircnets = ();),
libPropList crashes irssi at startup.. Irssi doesn't save any empty lists
now, but still this needs to be fixed in libPropList..
- after changing irssi-text's screen size to smaller it leaves some empty
lines to windows before printing text, redrawing screen moves the lines
back up.. hm..
- irssi can't find new themes in ~/.irssi/ while running - scan for new
themes when opening themes dialog? irssi-text also needs to be restarted
to use new themes..
- mirc ctcp togglemenuitem isn't updated right
- multiple dcc connections from different irc networks from same nick
doesn't work. Maybe create "server nick" and "refer nick" variables to
DCC_REC?
- gfloat doesn't work in formats .. why? In DCC messages kb and kb/s values
could be shown as floats..
*** text GUI
- statusbar:
- when starting to run out of space some items could be made smaller,
activity for example .. make some generic flag for items to use.
- activity: hilight number if window has message for you or hilighted
text
- "you have new mail"
- active server tag somewhere in window
- word wrapping doesn't work perfectly, if colors/bolds/etc are used, they're
treated as spaces. So things like (<newline>blah blah) can happen (/who)
- autojoining to channels, make the code common in gui-gnome and gui-text
*** Big things
- keyboard configuration
- session saving thing.. specify what channels/queries/dcc chats to open in
which window (real/tabbed/in same window with some other), what irc net
channels goes to where, what channels/queries to open at startup, etc.
use dialog with gtktree widget to change it.
- split windows with gtkpaned (check window-views-patch.diff)
- really transparently working irc proxy, saves scrollback buffers, etc.
Or maybe the existing ones already work?
- some sort of address book? our own irssi ctcp to ask for other irssi users
for their information (of course not without asking (except optionally))..
could be nice also to automatically update it, keep track of all seen
users gathered when joining channels, whois, who, etc. commands.
automatically updating information could be host masks, nicks, ips, seen in
channels, operator in channels, .. user specified checks like last topic or
mode changes or even msgs to you/some channel/with some keyword. great for
spying people ;) maybe even useful sometimes..
.. but what database would be best for this?
- GTK version: icons to toolbars, accelerators to menus
- Windows style MDI windows are possible with GtkFixed .. Some people would
like this.. too much job for me, it would need building the MDI windows
ourself (title bar, borders, resizing, etc.)
- online help, documentation, ...
- plugins:
- perl plugin .. implementation problems, C's structures need to be
handled some way .. like for server structure get_address(),
get_port(), set_address(), set_port() etc..
- other scripting plugins would be easier? scheme, tcl, pythong?
sula premirex uses scheme, it would probably be pretty easy to learn
from it how to do it to irssi :)
- IRC bot, eggdrop is too old, needs a replacement ;)
- DCC file server, I'm not too excited about this, maybe someone else
wants to do it..
- Multiplayer games! :) Chess, tic-tac-toe, othello, battleship, tetris,
etc. Existing games should probably be used .. though there doesn't
seem to be any of these (except tetris) for gnome right now..
- audio / video chat :)
*** Little things
- command line parameter handling, specify what server/ircnet to autoconnect
or none.
- /list:
- gui optional
- sort it by clicking the headers
- change the size of columns
- total number of channels
- copy/paste things in list?
- search the list
- log option: add the open/close time to log
- log directory, automatically log all channels and queries there
- overwrite/append
- all windows, just queries, only the channels in channel list
- you can be joined to same channels in different irc networks (or even
the same ircnet!) - create the logs to different directiories/names
- use different themes in different channels/queries?
- improve msgslevels and ignoring .. Like ignoring "chan" doesn't work now.
It could be changed to joins, parts, quits, topics, nicks, .. just rip all
the msglevels from bitchx and use them :)
- use server-idle instead of channel.query thing..
- lag meter
- possibility to display different colors in nicks from different people..
and different colors for word hilighting too
- /connect ircnet could connect to ircnet
- change some GLists to GHashTables, aliases at least
- check new irssi versions with http rather than with irssibot..
- implement requesting files with DCC GET from remote client for dcc file
servers. good for people behind firewalls.
- support for ircii translation tables (/usr/lib/irc/translation/*)
- use different nicks/realnames in different irc networks
- zvt problems/todo:
- need some way to disable all the extra features, like sending 0x8e
messes up your fonts.
- the ugly cursor just keeps blinking
- when clicking an empty spot on screen it sometimes tells that there's
some weird crap in there..
- word wrapping
- notify list:
- dialog: keep track of hosts/realnames so after closing and opening the
dialog again they would show up..
- summary list (for irssi-text)
- nick-specific options:
- check for gone-flag changes (use userhosts instead of isons)
- create popup dialog
- run some command (like /exec as soon as I get that done :)
- gnome statubar:
- clock?
- dcc transfer meter (gtk progressbar)
- you could configure which events (whois, notify, etc.) to show in what
windows (all, current, status)
- gui for configuring plugin specific theme format texts
- awaylog (/log create ~/away.log -all +msgs or something), autoaway
- make window/save buffer and find work with zvt
- dcc send: allow selection of multiple files to send (also for dnd from
gmc!) Allow dropping files to anywhere in irssi.
- logging: longer format dd.mm.yy hh:mm:ss (configurable?)
- net split/join detection ? is this even needed? more harmful than useful?
- /timer, /clones
- run multiple commands with one alias (what was this needed for? can't
remember..)
- regexp for hilighting words?
- subcommands (dcc, window, ..) could use common function instead of copy and
pasting the same function all the time and modifying just two words...

25
acconfig.h Normal file
View File

@ -0,0 +1,25 @@
#undef HAVE_GTK
#undef HAVE_GNOME
#undef HAVE_GNOME_PANEL
#undef SYSCONFDIR
#undef PLUGINSDIR
#undef PERLSCRIPTDIR
#undef GTK_10
#undef HAVE_SOCKS_H
#undef HAVE_IMLIB
#undef MEM_DEBUG
#undef HAVE_IPV6
#undef GTK_HEBREW
#undef GTK_HEBREW_RC
#undef HAVE_NCURSES_USE_DEFAULT_COLORS
#undef HAVE_CURSES_IDCOK
#undef HAS_CURSES
#undef USE_SUNOS_CURSES
#undef USE_BSD_CURSES
#undef USE_SYSV_CURSES
#undef USE_NCURSES
#undef NO_COLOR_CURSES
#undef SCO_FLAVOR
#undef NCURSES_970530

21
autogen.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
# I'm too lazy to update version number into several places.. :)
version=`cat configure.in|grep AM_INIT_AUTOMAKE|perl -pe 's/^[^,]*,[ ]*([^\)]*).*/$1/'`
cat irssi.spec.in |sed s/^Version:/Version:\ $version/ > irssi.spec
PKG_NAME="Irssi"
(test -f $srcdir/configure.in \
## put other tests here
) || {
echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
echo " top-level $PKG_NAME directory"
exit 1
}
. $srcdir/macros/autogen.sh

101
colorless.theme Normal file
View File

@ -0,0 +1,101 @@
{
default_color = 7;
colors = {};
formats = {
line_start = "-!- ";
line_start_irssi = "-!- Irssi: ";
connecting = "Connecting to %_$1%_ [$2] port %_$3%_";
disconnected = "Disconnected from %_$1%_ [$2]";
join = "%_$1%_ [$2] has joined %_$3";
cannot_join = "Cannot join to channel %_$1%_ [$2]";
part = "%_$1%_ [$2] has left %_$3%_ [$4]";
kick = "%_$1%_ was kicked from $2 by %_$3%_ [$4]";
quit = "%_$1%_ [$2] has quit IRC [$3]";
names = "[%_Users%_($1)] $2";
endofnames = "%_$1%_: Total of %_$2%_ nicks [%_$3%_ ops, %_$4%_ voices, %_$5%_ normal]";
topic = "Topic for $1: $2";
no_topic = "No topic set for $1";
new_topic = "%_$1%_ changed the topic of $2 to: $3";
topic_unset = "Topic unset by %_$1%_ on $2";
topic_info = "Topic set by %_$1%_ [$2]";
chanmode_change = "mode/$1 [$2] by %_$3";
channel_mode = "mode/$1 [$2]";
banlist = "%_$1%_: ban $2";
banlist_long = "%_$1%_: ban $2 [by %_$3%_, $4 secs ago]";
ebanlist = "%_$1%_: ban exception $2";
ebanlist_long = "%_$1%_: ban exception $2 [by %_$3%_, $4 secs ago]";
invitelist = "%_$1%_: invite $2";
usermode_change = "Mode change [%_$1%_] for user $2";
your_nick_changed = "You're now known as $1";
nick_changed = "%_$1%_ is now known as $2";
your_nick_owned = "Your nick is owned by %_$4%_ [$2@$3]";
whois = "%_$1%_ [$2@$3]%N ircname : $4";
whois_idle_signon = " idle : $2 hours $3 mins $4 secs [signon: $5]";
own_msg = "<$1> $2";
own_msg_channel = "<$1:$2> $3";
own_msg_private = "[msg($1)] $2";
own_notice = "[notice($1)] $2";
own_me = " * $1 $2";
own_ctcp = "[ctcp($1)] $2 $3";
own_dcc = "[dcc($1)] $2";
pubmsg_me = "<$1> $2";
pubmsg_me_channel = "<$1:$2> $3";
pubmsg = "<$1> $2";
pubmsg_channel = "<$1:$2> $3";
msg_private = "[$1($2)] $3";
dcc_msg = "[$1(dcc)] $2";
notice_server = "!$1 $2";
notice_public = "-$1:$2- $3";
notice_private = "-$1($2)- $3";
action_dcc = " (*dcc*) $1 $2";
action_private = " (*) $1 $2";
action_public = " * $1 $2";
action_public_channel = " * $1:$2 $3";
ctcp_reply = "CTCP %_$1%_ reply from %_$2%_: $3";
ctcp_requested = ">>> %_$1%_ [$2] requested %_$3%_ from %_$4";
dcc_ctcp = ">>> DCC CTCP received from %_$1%_: $2";
dcc_chat = "DCC CHAT from %_$1%_ [$2 port $3]";
dcc_chat_not_found = "No DCC CHAT connection open to %_$1";
dcc_chat_connected = "DCC %_CHAT%_ connection with %_$1%_ [$2 port $3] established";
dcc_chat_disconnected = "DCC lost chat to %_$1";
dcc_send = "DCC SEND from %_$1%_ [$2 port $3]: $4 [$5 bytes]";
dcc_send_exists = "DCC already sending file $1 for %_$2%_";
dcc_send_not_found = "DCC not sending file $2 to %_$1";
dcc_send_file_not_found = "DCC file not found: $1";
dcc_send_connected = "DCC sending file $1 for %_$2%_ [$3 port $4]";
dcc_send_complete = "DCC sent file $1 [%_$2%_kb] for %_$3%_ in %_$4%_ secs [%_$5kb/s%_]";
dcc_send_aborted = "DCC aborted sending file $1 for %_$2%_";
dcc_get_not_found = "DCC no file offered by %_$1";
dcc_get_connected = "DCC receiving file $1 from %_$2%_ [$3 port $4]";
dcc_get_complete = "DCC received file $1 [$2kb] from %_$3%_ in %_$4%_ secs [$5kb/s]";
dcc_get_aborted = "DCC aborted receiving file $1 from %_$2%_";
dcc_unknown_ctcp = "DCC unknown ctcp $1 from %_$2%_ [$3]";
dcc_unknown_reply = "DCC unknown reply $1 from %_$2%_ [$3]";
dcc_unknown_command = "DCC unknown command: $1";
dcc_unknown_type = "DCC unknown type %_$1";
dcc_connect_error = "DCC can't connect to %_$1%_ port %_$2";
dcc_cant_create = "DCC can't create file $1";
dcc_rejected = "DCC $1 was rejected by %_$2%_ [$3]";
dcc_close = "DCC $1 close for %_$2%_ [$3]";
log_opened = "Log file $1 opened";
log_open_failed = "Couldn't open log file $1";
log_not_open = "Log file $1 not open";
log_closed = "Closed log file $1";
log_listentry = "$1: $2";
log_sublistentry = " + $1: $2";
ircjoin = "%_$1%_ [$2@$3] [%_$4%_] has joined to IRC";
plugin_cant_load = "Can't load plugin %_$1%_";
plugin_not_loaded = "Plugin %_$1%_ not loaded";
};
plugins = {
sample = "start stop";
};
pluginformats = {
sample = {
start = "Sample plugin loaded";
stop = "Sample plugin unloaded";
};
};
}

36
config Normal file
View File

@ -0,0 +1,36 @@
{
setupservers = (
{server = irc.funet.fi;ircnet = ircnet;port = 6667;autoconnect = No;}
);
ircnets = ({name = ircnet;});
channels = (
{
name = "#irssi";
ircnet = ircnet;
autojoin = No;
}
);
aliases = (
{alias = J;command = "/join &1";},
{alias = LEAVE;command = "/part &1";},
{alias = BYE;command = "/quit &1";},
{alias = WI;command = "/whois &1";},
{alias = WII;command = "/whois %1 %1";},
{alias = WW;command = "/whowas &1";},
{alias = W;command = "/who *";},
{alias = N;command = "/names *";},
{alias = M;command = "/msg &1";},
{alias = T;command = "/topic &1";},
{alias = C;command = "/clear";},
{alias = CL;command = "/clear";},
{alias = K;command = "/kick &1";},
{alias = KB;command = "/kickban &1";},
{alias = KN;command = "/knockout &1";},
{alias = B;command = "/ban &1";},
{alias = UB;command = "/unban &1";},
{alias = IG;command = "/ignore &1";},
{alias = UNIG;command = "/unignore &1";}
);
}

363
configure.in Normal file
View File

@ -0,0 +1,363 @@
AC_INIT(src)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(irssi, 0.7.16)
AM_MAINTAINER_MODE
AM_ACLOCAL_INCLUDE(macros)
AC_ISC_POSIX
AC_PROG_CC
AC_PROG_CPP
AC_STDC_HEADERS
AC_ARG_PROGRAM
AM_PROG_LIBTOOL
AC_CHECK_HEADERS(string.h stdlib.h unistd.h dirent.h sys/ioctl.h)
GNOME_INIT
AC_ARG_WITH(proplist,
[ --with-proplist Specify libPropList location],
proplist_dir=$withval)
AC_ARG_WITH(socks,
[ --with-socks Build with socks support],
if test x$withval = xyes; then
want_socks=yes
else
if test "x$withval" = xno; then
want_socks=no
else
want_socks=yes
fi
fi,
want_socks=no)
AC_ARG_WITH(imlib,
[ --with-imlib Build with imlib support],
if test x$withval = xyes; then
want_imlib=yes
else
if test "x$withval" = xno; then
want_imlib=no
else
want_imlib=yes
fi
fi,
want_imlib=yes)
AC_ARG_WITH(gnome-panel,
[ --with-gnome-panel Build with gnome panel applet support],
if test x$withval = xyes; then
want_gnome_panel=yes
else
if test "x$withval" = xno; then
want_gnome_panel=no
else
want_gnome_panel=yes
fi
fi,
want_gnome_panel=yes)
AC_ARG_WITH(textui,
[ --with-textui Build irssi-text],
if test x$withval = xyes; then
want_textui=yes
else
if test "x$withval" = xno; then
want_textui=no
else
want_textui=yes
fi
fi,
want_textui=yes)
AC_ARG_WITH(plugins,
[ --with-plugins Build plugins],
if test x$withval = xyes; then
want_plugins=yes
else
if test "x$withval" = xno; then
want_plugins=no
else
want_plugins=yes
fi
fi,
want_plugins=yes)
AC_ARG_WITH(servertest,
[ --with-servertest Build servertest],
if test x$withval = xyes; then
want_servertest=yes
else
if test "x$withval" = xno; then
want_servertest=no
else
want_servertest=yes
fi
fi,
want_servertest=no)
AC_ARG_ENABLE(memdebug,
[ --enable-memdebug Enable memory debugging],
if test x$enableval = xyes; then
want_memdebug=yes
else
if test "x$enableval" = xno; then
want_memdebug=no
else
want_memdebug=yes
fi
fi,
want_memdebug=no)
AC_ARG_ENABLE(ipv6,
[ --enable-ipv6 Enable IPv6 support],
if test x$enableval = xyes; then
want_ipv6=yes
else
if test "x$enableval" = xno; then
want_ipv6=no
else
want_ipv6=yes
fi
fi,
want_ip6=no)
AC_ARG_ENABLE(gtk-hebrew,
[ --enable-gtk-hebrew Enable Hebrew support],
if test "x$enableval" = xno; then
want_gtk_hebrew=no
HEBREW_LIBS=""
else
AC_DEFINE(GTK_HEBREW)
AC_DEFINE_UNQUOTED(GTK_HEBREW_RC, "$enableval")
HEBREW_LIBS="-lfribidi"
want_gtk_hebrew=yes
fi,
want_gtk_hebrew=no)
dnl **
dnl ** just some generic stuff...
dnl **
AC_CHECK_FUNCS(mkfifo)
AC_CHECK_LIB(socket, socket, [
LIBS="$LIBS -lsocket"
])
AC_CHECK_LIB(nsl, inet_addr, [
LIBS="$LIBS -lnsl"
], -lsocket)
# gcc specific options
if test "x$ac_cv_prog_gcc" = "xyes"; then
CFLAGS="$CFLAGS -Wall"
fi
if test "x$prefix" = "xNONE"; then
prefix="/usr/local"
else
prefix=$prefix
fi
AM_CONDITIONAL(BUILD_PLUGINS, test "x$want_plugins" = "xyes")
AM_CONDITIONAL(BUILD_SERVERTEST, test "x$want_servertest" = "xyes")
AC_DEFINE_UNQUOTED(SYSCONFDIR, "$prefix/etc")
AC_DEFINE_UNQUOTED(PLUGINSDIR, "$prefix/lib/irssi/plugins")
dnl **
dnl ** check for libPropList
dnl **
if test "x$proplist_dir" = "x"; then
proplib=
else
proplib=-L$proplist_dir/lib
fi
AC_CHECK_LIB(PropList, PLSave, [
LIBS="$LIBS $proplib -lPropList"
if test "x$proplist_dir" != "x"; then
CFLAGS="$CFLAGS -I$proplist_dir/include"
fi
], [
echo "ERROR: Irssi needs libPropList for configuration file handling."
echo "Go get it from http://xlife.dhs.org/irssi/download.php"
AC_ERROR(["libPropList not found"])
], $LIBS $proplib -lPropList)
dnl **
dnl ** check for socks
dnl **
if test "x$want_socks" = "xyes"; then
AC_CHECK_LIB(socks, connect, [
LIBS="$LIBS -lsocks"
AC_CHECK_HEADER(socks.h, [
AC_DEFINE(HAVE_SOCKS_H)
CFLAGS="$CFLAGS -DSOCKS"
AC_MSG_RESULT(["socks5 library found, building with it"])
], [
AC_MSG_RESULT(["socks4 library found, building with it"])
CFLAGS="$CFLAGS -Dconnect=Rconnect -Dgetsockname=Rgetsockname -Dgetpeername=Rgetpeername -Dbind=Rbind -Daccept=Raccept -Dlisten=Rlisten -Dselect=Rselect"
])
])
fi
dnl **
dnl ** check for gnome
dnl **
if test "x$want_gnome" = "xyes"; then
if test "x$GNOME_LIBS" = "x"; then
want_gnome="no";
fi
fi
AM_CONDITIONAL(HAVE_GNOME, test "x$want_gnome" = "xyes")
if test "x$want_gnome" = "xyes"; then
AC_DEFINE(HAVE_GTK)
AC_DEFINE(HAVE_GNOME)
GNOME_SUPPORT_CHECKS
GUI_CFLAGS="$GNOME_INCLUDEDIR"
dnl **
dnl ** check for gnome panel applet library
dnl **
if test "x$want_gnome_panel" = "xyes"; then
AC_CHECK_LIB(panel_applet, applet_widget_init, [
GUI_LIBS="$GNOME_LIBDIR $GNOMEGNORBA_LIBS $ZVT_LIBS -lpanel_applet"
AC_DEFINE(HAVE_GNOME_PANEL)
], [
GUI_LIBS="$GNOME_LIBDIR $GNOMEUI_LIBS $ZVT_LIBS"
want_gnome_panel="no"
], $GNOME_LIBDIR $GNOMEGNORBA_LIBS -lpanel_applet)
else
GUI_LIBS="$GNOME_LIBDIR $GNOMEUI_LIBS $ZVT_LIBS"
fi
else
want_gnome_panel="no"
AC_DEFINE(HAVE_GTK)
AM_PATH_GTK(1.2.0)
GUI_CFLAGS="$GTK_CFLAGS"
GUI_LIBS="$GTK_LIBS"
if test "x$gtk_config_minor_version" = "x0"; then
AC_DEFINE(GTK_10)
fi
if test "x$want_imlib" = "xyes"; then
AM_PATH_GDK_IMLIB(, [define_imlib=true])
if test x$define_imlib = xtrue; then
AC_DEFINE(HAVE_IMLIB)
GUI_CFLAGS="$GUI_CFLAGS $GDK_IMLIB_CFLAGS"
GUI_LIBS="$GDK_IMLIB_LIBS"
fi
fi
fi
if test "x$GUI_LIBS" != "x"; then
GUI_LIBS="$GUI_LIBS $HEBREW_LIBS"
fi
AC_SUBST(GUI_LIBS)
AC_SUBST(GUI_CFLAGS)
AM_CONDITIONAL(BUILD_GNOMEUI, test "x$GUI_LIBS" != "x")
AM_CONDITIONAL(HAVE_GNOME_PANEL, test "x$want_gnome_panel" = "xyes")
dnl **
dnl ** gui-text checks
dnl **
AM_PATH_GLIB(1.2.0,,, gmodule)
dnl **
dnl ** curses checks
dnl **
if test "x$want_textui" = "xyes"; then
AC_CHECK_CURSES
if test "x$ncurses_version" != "x"; then
AC_CHECK_LIB(ncurses, use_default_colors, [
AC_DEFINE(HAVE_NCURSES_USE_DEFAULT_COLORS)
],, $CURSES_LIBS)
AC_CHECK_LIB(ncurses, idcok, [
AC_DEFINE(HAVE_CURSES_IDCOK)
],, $CURSES_LIBS)
else
AC_CHECK_LIB(curses, idcok, [
AC_DEFINE(HAVE_CURSES_IDCOK)
],, $CURSES_LIBS)
fi
else
has_curses=false
fi
AM_CONDITIONAL(HAS_CURSES, test "$has_curses" = true)
dnl **
dnl ** memory debugging
dnl **
if test "x$want_memdebug" = "xyes"; then
AC_DEFINE(MEM_DEBUG)
fi
AM_CONDITIONAL(BUILD_MEMDEBUG, test "x$want_memdebug" = "xyes")
dnl **
dnl ** IPv6 support
dnl **
if test "x$want_ipv6" = "xyes"; then
AC_DEFINE(HAVE_IPV6)
fi
dnl **
dnl ** internationalization support
dnl **
dnl ALL_LINGUAS=""
dnl AM_GNU_GETTEXT
dnl AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
AC_OUTPUT(
Makefile
dnl ## internationalization support
dnl po/Makefile.in
dnl intl/Makefile
macros/Makefile
src/Makefile
src/irc-base/Makefile
src/irc-extra/Makefile
src/ui-common/Makefile
src/gui-none/Makefile
src/gui-text/Makefile
src/gui-gnome/Makefile
src/gui-gnome/help/Makefile
src/gui-gnome/help/C/Makefile
src/gui-gnome/pixmaps/Makefile
src/lib-config/Makefile
src/lib-nongui/Makefile
src/settings/Makefile
servertest/Makefile
plugins/Makefile
plugins/sample/Makefile
plugins/speech/Makefile
plugins/sound/Makefile
plugins/proxy/Makefile
plugins/external/Makefile
plugins/bot/Makefile
stamp.h)
dnl **
dnl ** internationalization support
dnl **
dnl stamp.h],[sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile])

5
file2header.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
echo "gchar *default_config ="
cat $1|sed 's/\\/\\\\/g'|sed 's/"/\\"/g'|sed 's/^/\"/'|sed 's/$/\\n\"/'
echo ";"

6
irssi.desktop Normal file
View File

@ -0,0 +1,6 @@
[Desktop Entry]
Name=irssi
Comment=irssi IRC client
Exec=irssi
Terminal=0
Type=Application

5
irssi.gnorba Normal file
View File

@ -0,0 +1,5 @@
[irssi]
type=exe
repo_id=IDL:GNOME/Applet:1.0
description=irssi IRC client
location_info=irssi

87
irssi.spec.in Normal file
View File

@ -0,0 +1,87 @@
Name: irssi
Version:
Release: 1
Packager: Red Hat Contrib|Net <rhcn-bugs@redhat.com>
Vendor: Timo Sirainen <cras@irccrew.org>
Distribution: Red Hat Contrib|Net
Summary: Irssi is a GTK based IRC client
Copyright: GPL
Group: X11/Applications/Networking
URL: http://xlife.dhs.org/irssi/
Source: http://xlife.dhs.org/irssi/files/%{name}-%{version}.tar.bz2
Requires: gtk+
Prefix: /usr
BuildRoot: /tmp/%{name}-%{version}
%changelog
* Sun Aug 29 1999 JT Traub <jtraub@dragoncat.net>
- Updated to 0.7.15 sources
- Fixed config stuff that changed since last version.
* Thu Mar 25 1999 JT Traub <jtraub@dragoncat.net>
- Updated sources
* Sat Mar 13 1999 JT Traub <jtraub@dragoncat.net>
- Updated to 0.7.4 sources
- Added the irssi-text bin to the package.
* Mon Feb 22 1999 JT Traub <jtraub@dragoncat.net>
- Made spec file compliant with RHCN guidelines.
* Sun Feb 13 1999 JT Traub <jtraub@dragoncat.net>
- Updated to 0.6.0 sources.
- Cleaned up spec file to make it relocatable on install
* Sun Feb 7 1999 JT Traub <jtraub@dragoncat.net>
- Updated sources to 0.5.0
- removed obsolete patch lines
* Sat Feb 3 1999 JT Traub <jtraub@dragoncat.net>
- Updated sources to 0.4.0
- Deleted old patch line
* Sat Jan 30 1999 JT Traub <jtraub@dragoncat.net>
- Updated sources to 0.3.6
- Updated spec to install the .desktop file.
- Removed the now obsolete patch lines
* Wed Jan 27 1999 JT Traub <jtraub@dragoncat.net>
- Upgraded to 0.3.5
* Sun Jan 24 1999 JT Traub <jtraub@dragoncat.net>
- First attempt at building this
%description
Irssi is a GTK based GUI IRC client by Timo Sirainen <cras@irccrew.org>.
More information can be found at http://xlife.dhs.org/irssi/.
%prep
%setup
%build
./configure --prefix=%{prefix}
make
%install
rm -rf $RPM_BUILD_ROOT
make prefix=$RPM_BUILD_ROOT%{prefix} install
strip $RPM_BUILD_ROOT%{prefix}/bin/irssi
strip $RPM_BUILD_ROOT%{prefix}/bin/irssi-text
strip $RPM_BUILD_ROOT%{prefix}/bin/irssi-bot
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr (-,root,root)
%doc AUTHORS COPYING INSTALL ChangeLog README TODO NEWS
%attr(755,root,root) %{prefix}/bin/irssi
%attr(755,root,root) %{prefix}/bin/irssi-text
%attr(755,root,root) %{prefix}/bin/irssi-bot
%attr(644,root,root) %config %{prefix}/etc/irssi/*
%attr(644,root,root) %{prefix}/etc/CORBA/servers/irssi.gnorba
%attr(644,root,root) %{prefix}/share/applets/Network/irssi.desktop
%attr(644,root,root) %{prefix}/share/gnome/help/irssi/C/*
%attr(644,root,root) %{prefix}/lib/irssi/plugins/*

8
servertest/.cvsignore Normal file
View File

@ -0,0 +1,8 @@
*.la
*.lo
.deps
.libs
Makefile
Makefile.in
so_locations
ircserver

13
servertest/Makefile.am Normal file
View File

@ -0,0 +1,13 @@
bin_PROGRAMS = ircserver
INCLUDES = $(GLIB_CFLAGS) -I$(top_srcdir)/src
if BUILD_MEMDEBUG
memdebug_src=../src/irc-base/memdebug.o
else
memdebug_src=
endif
ircserver_LDADD = -lglib ../src/irc-base/network.o $(memdebug_src)
ircserver_SOURCES = server.c

463
servertest/server.c Normal file
View File

@ -0,0 +1,463 @@
#include <common.h>
#include <irc-base/network.h>
#define FLOOD_TIMEOUT 100000
typedef struct
{
gchar *name;
GList *nicks;
}
CHANNEL_REC;
GList *channels;
gchar *clientnick, *clienthost;
int clienth;
/* Read a line */
gint read_line(gboolean socket, gint handle, GString *output, GString *buffer)
{
gchar tmpbuf[512];
gint recvlen, pos;
g_return_val_if_fail(handle != -1, -1);
g_return_val_if_fail(output != NULL, -1);
g_return_val_if_fail(buffer != NULL, -1);
g_string_truncate(output, 0);
recvlen = socket ?
net_receive(handle, tmpbuf, sizeof(tmpbuf)-1) :
read(handle, tmpbuf, sizeof(tmpbuf)-1);
if (recvlen <= 0)
{
if (buffer->len > 0)
{
/* no new data got but still something in buffer.. */
for (pos = 0; pos < buffer->len; pos++)
{
if (buffer->str[pos] == 13 || buffer->str[pos] == 10)
{
recvlen = 0;
break;
}
}
if (recvlen < 0 && buffer->len > 0)
{
/* connection closed and last line is missing \n ..
just add it so we can see if it had anything useful.. */
recvlen = 0;
g_string_append_c(buffer, '\n');
}
}
if (recvlen < 0) return -1;
}
else
{
/* append received data to buffer */
tmpbuf[recvlen] = '\0';
g_string_append(buffer, tmpbuf);
}
for (pos = 0; pos < buffer->len; pos++)
{
if (buffer->str[pos] == 13 || buffer->str[pos] == 10)
{
/* end of line */
buffer->str[pos] = '\0';
g_string_assign(output, buffer->str);
if (buffer->str[pos] == 13 && buffer->str[pos+1] == 10)
{
/* skip \n too */
pos++;
}
g_string_erase(buffer, 0, pos+1);
return 1;
}
}
/* EOL wasn't found, wait for more data.. */
return 0;
}
void client_send(char *text)
{
write(clienth, text, strlen(text));
write(clienth, "\r\n", 2);
}
void makerand(char *str, int len)
{
for (; len > 0; len--)
*str++ = (rand() % 20)+'A';
}
void makerand2(char *str, int len)
{
#if 0
gchar c;
while (len > 0)
{
c = rand() & 255;
if (c != 0 && c != 13 && c != 10)
{
*str++ = c;
len--;
}
}
#else
makerand(str, len);
#endif
}
void send_cmd(void)
{
static gint nicks = 0;
GList *tmp;
char str[512];
int pos;
/* send msg to every channel */
str[511] = '\0';
for (tmp = g_list_first(channels); tmp != NULL; tmp = tmp->next)
{
CHANNEL_REC *rec = tmp->data;
makerand(str, 511);
str[0] = ':';
str[10] = '!';
str[20] = '@';
switch (rand() % 10)
{
case 0:
/* join */
pos = 2+sprintf(str+2, "%d", nicks++); /* don't use same nick twice */
str[pos] = '-';
str[10] = '\0';
g_list_append(rec->nicks, g_strdup(str+1));
str[10] = '!';
sprintf(str+30, " JOIN :%s", rec->name);
break;
case 1:
/* part */
if (g_list_length(rec->nicks) > 1 && rand() % 3 == 0)
{
gchar *nick;
nick = g_list_nth(rec->nicks, rand()%(g_list_length(rec->nicks)-1)+1)->data;
if (rand() % 3 == 0)
sprintf(str, ":kicker!some@where KICK %s %s :go away", rec->name, nick);
else if (rand() % 3 == 0)
sprintf(str, ":%s!dunno@where QUIT %s :i'm outta here", nick, rec->name);
else
sprintf(str, ":%s!dunno@where PART %s", nick, rec->name);
rec->nicks = g_list_remove(rec->nicks, nick);
g_free(nick);
}
else
str[0] = '\0';
break;
case 2:
/* nick change */
if (g_list_length(rec->nicks) > 1)
{
gchar *nick;
nick = g_list_nth(rec->nicks, rand()%(g_list_length(rec->nicks)-1)+1)->data;
pos = sprintf(str, ":%s!dunno@where NICK ", nick);
str[pos] = '_';
str[50] = '\0';
rec->nicks = g_list_remove(rec->nicks, nick);
rec->nicks = g_list_append(rec->nicks, g_strdup(str+pos));
g_free(nick);
}
else
str[0] = '\0';
break;
case 3:
/* topic */
pos = 30+sprintf(str+30, " TOPIC %s :", rec->name);
str[pos] = 'x';
break;
case 4:
/* mode */
sprintf(str+30, " MODE %s :%cnt", rec->name, (rand() & 1) ? '+' : '-');
break;
case 5:
/* notice */
pos = 30+sprintf(str+30, " NOTICE %s :", rec->name);
str[pos] = 'X';
break;
case 6:
/* nick mode change */
if (g_list_length(rec->nicks) > 1)
{
gchar *nick;
nick = g_list_nth(rec->nicks, rand()%(g_list_length(rec->nicks)-1)+1)->data;
pos = sprintf(str, ":server MODE %s +%c %s", rec->name, rand()&1 ? 'o' : 'v', nick);
str[pos] = '_';
str[50] = '\0';
rec->nicks = g_list_remove(rec->nicks, nick);
rec->nicks = g_list_append(rec->nicks, g_strdup(str+pos));
g_free(nick);
}
else
str[0] = '\0';
break;
default:
pos = 30+sprintf(str+30, " PRIVMSG %s :", rec->name);
makerand2(str+pos, 511-pos);
if (rand() % 4 == 0)
{
pos += sprintf(str+pos, "\001ACTION ");
str[510] = 1;
}
else if (rand() % 10 == 0)
{
pos += sprintf(str+pos, "\001VERSION\001");
pos++;
}
else if (rand() % 2 == 0)
{
pos += sprintf(str+pos, "%s: ", clientnick);
}
str[pos] = 'X';
break;
}
client_send(str);
}
makerand(str, 511);
str[0] = ':';
str[10] = '!';
str[20] = '@';
switch (rand() % 11)
{
case 0:
/* join */
if (g_list_length(channels) < 20)
{
CHANNEL_REC *rec;
int n, pos;
n = (rand()%20)+25;
pos = sprintf(str, ":%s!%s JOIN :", clientnick, clienthost);
str[pos] = '#';
str[n] = '\0';
rec = g_new(CHANNEL_REC, 1);
rec->name = g_strdup(str+pos);
rec->nicks = g_list_append(NULL, g_strdup(clientnick));
channels = g_list_append(channels, rec);
client_send(str);
sprintf(str, ":server 353 %s = %s :@%s", clientnick, rec->name, clientnick);
client_send(str);
sprintf(str, ":server 366 %s %s :End of /NAMES list.", clientnick, rec->name);
}
else
str[0] = '\0';
break;
case 1:
/* leave channel (by kick) */
if (g_list_length(channels) > 3)
{
CHANNEL_REC *chan;
chan = g_list_nth(channels, rand()%g_list_length(channels))->data;
if (rand() % 3 != 0)
{
pos = sprintf(str, ":%s!%s PART %s :", clientnick, clienthost, chan->name);
str[pos] = 'x';
}
else
{
str[0] = ':';
sprintf(str+30, " KICK %s %s :byebye", chan->name, clientnick);
}
g_free(chan->name);
g_list_foreach(chan->nicks, (GFunc) g_free, NULL); g_list_free(chan->nicks);
g_free(chan);
channels = g_list_remove(channels, chan);
}
else
str[0] = '\0';
break;
case 2:
/* ctcp version */
sprintf(str+30, " PRIVMSG %s :\001VERSION\001", clientnick);
break;
case 3:
/* ctcp ping */
sprintf(str+30, " PRIVMSG %s :\001PING\001", clientnick);
break;
case 4:
/* user mode */
sprintf(str+30, " MODE %s :%ciw", clientnick, (rand() & 1) ? '+' : '-');
break;
case 5:
/* msg */
pos = 30+sprintf(str+30, " PRIVMSG %s :", clientnick);
str[pos] = 'X';
break;
case 6:
/* notice */
pos = 30+sprintf(str+30, " NOTICE %s :", clientnick);
str[pos] = 'X';
break;
case 7:
/* invite */
pos = 30+sprintf(str+30, " INVITE %s", clientnick);
str[pos] = 'X';
break;
case 8:
/* error */
pos = sprintf(str, ":server ERROR :");
str[pos] = 'X';
break;
case 9:
/* wallops */
pos = sprintf(str, ":server WALLOPS :");
str[pos] = 'X';
break;
case 10:
/* ping */
pos = sprintf(str, ":server PING :");
str[pos] = 'X';
break;
}
client_send(str);
}
void handle_command(char *str)
{
if (strncmp(str, "NICK ", 5) == 0)
{
clientnick = g_strdup(str+5); /* got the nick */
}
}
guint gui_timeout_add(guint32 interval, GUITimeoutFunction function, gpointer data)
{
return -1;
}
int main(void)
{
static fd_set fdset;
struct timeval tv;
int serverh, port;
IPADDR ip;
#ifdef HAVE_IPV6
if (net_gethostname("::1", &ip) != 0)
{
printf("net_gethostname()\n");
return 1;
}
#else
if (net_gethostname("127.0.0.1", &ip) != 0)
{
printf("net_gethostname()\n");
return 1;
}
#endif
srand(0);
port = 6660;
serverh = net_listen(&ip, &port);
if (serverh == -1)
{
printf("listen()\n");
return 1;
}
clienth = -1; channels = NULL;
for (;;)
{
FD_ZERO(&fdset);
if (clienth != -1) FD_SET(clienth, &fdset);
FD_SET(serverh, &fdset);
tv.tv_sec = 0;
tv.tv_usec = FLOOD_TIMEOUT;
if (select((serverh > clienth ? serverh : clienth)+1, &fdset, NULL, NULL, &tv) <= 0)
{
/* nothing happened, bug the client with some commands.. */
if (clienth != -1 && clientnick != NULL) send_cmd();
}
else
{
if (FD_ISSET(serverh, &fdset))
{
/* client connecting! */
if (clienth != -1)
{
/* only one client allowed.. */
int handle;
handle = net_accept(serverh, NULL, &port);
if (handle != -1)
{
client_send("Only one client allowed");
close(handle);
continue;
}
}
else
{
IPADDR clientip;
clienth = net_accept(serverh, &clientip, &port);
if (clienth != -1)
{
clienthost = g_strdup(net_ip2host(&clientip));
client_send(":server 001 pla");
client_send(":server 002 plapla");
client_send(":server 003 plaplapla");
client_send(":server 004 connected!");
}
}
}
else
{
/* clients sending something.. */
GString *str, *buf;
int ret;
str = g_string_new(NULL);
buf = g_string_new(NULL);
do
{
ret = read_line(TRUE, clienth, str, buf);
if (ret == -1)
{
/* client disconnected */
close(clienth);
clienth = -1;
break;
}
if (ret == 1) handle_command(str->str);
}
while (ret == 1);
g_string_free(str, TRUE);
g_string_free(buf, TRUE);
}
}
}
return 0;
}

2
src/.cvsignore Normal file
View File

@ -0,0 +1,2 @@
Makefile
Makefile.in

17
src/Makefile.am Normal file
View File

@ -0,0 +1,17 @@
if HAS_CURSES
TEXTUI=gui-text
endif
if BUILD_GNOMEUI
GNOMEUI=gui-gnome
endif
noinst_HEADERS = \
common.h \
common-setup.h \
irssi-plugin.h \
irssi-plugin-gui.h
SUBDIRS = irc-base irc-extra ui-common lib-config lib-nongui settings $(GNOMEUI) $(TEXTUI) gui-none
EXTRA_DIST = signal.doc

125
src/common-setup.h Normal file
View File

@ -0,0 +1,125 @@
#ifndef __COMMON_SETUP_H
#define __COMMON_SETUP_H
#define DCC_FILE_CREATE_MODE 0644
#define LOG_FILE_CREATE_MODE 0644
#define CMD_CHAR '/'
/* How often to check if there's anyone to be unignored in autoignore list */
#define AUTOIGNORE_TIMECHECK 10000
/* How often to check if there's anyone to be unbanned in knockout list */
#define KNOCKOUT_TIMECHECK 10000
/* How often to check users in notify list */
#define NOTIFY_TIMECHECK 30000
/* How often to check for gone status of nick */
#define MAX_GONE_REFRESH_TIME 300
/* Maximum time to wait for more JOINs before sending massjoin signal */
#define MAX_MASSJOIN_WAIT 5000
/* lists */
extern GList *aliases, *ignores, *completions, *notifies, *hilights;
/* look and feel */
extern gboolean toggle_show_menubar;
extern gboolean toggle_show_toolbar;
extern gboolean toggle_show_statusbar;
extern gboolean toggle_show_nicklist;
extern gboolean toggle_show_timestamps;
extern gboolean toggle_hide_text_style;
extern gboolean toggle_bell_beeps;
extern gboolean toggle_actlist_moves;
extern gboolean toggle_privmsg_beeps;
extern gboolean toggle_use_status_window;
extern gboolean toggle_use_msgs_window;
extern gboolean toggle_autoraise_msgs_window;
extern gboolean toggle_autocreate_query;
extern gboolean toggle_notifylist_popups;
extern gboolean toggle_use_tabbed_windows;
extern gint tab_orientation;
/* misc */
extern gchar *url_www_client;
extern gchar *url_ftp_client;
extern gchar *url_mail_client;
extern gchar *ctcp_version_reply;
extern gchar *default_quit_message;
extern gchar *default_user_mode;
extern gint max_command_history;
extern gint max_textwidget_lines;
extern gint rawlog_lines;
extern gint block_remove_lines;
extern gint knockout_time; /* How many seconds to keep /knockouted ban */
extern gboolean check_irssi_versions; /* Check if there's new irssi version available */
/* nick completion */
extern gchar *completion_char;
extern gboolean completion_disable_auto;
extern gint completion_keep_publics;
extern gint completion_keep_ownpublics;
extern gint completion_keep_privates;
/* flood protection */
extern gint flood_timecheck; /* Flood check timeout */
extern gint flood_max_msgs; /* Max msgs in FLOOD_TIMECHECK msecs before considered as flooding */
extern gint autoignore_time; /* How many seconds to keep someone autoignored */
extern gint ctcp_timecheck; /* CTCP reply send timeout */
extern gint max_ctcp_queue; /* Max CTCP reply queue length */
extern gint cmd_queue_speed; /* Minimum timeout before sending the next command to server */
/* dcc */
extern gboolean toggle_dcc_autodisplay_dialog;
extern gboolean toggle_dcc_autoget;
extern gboolean toggle_dcc_autorename;
extern gint dcc_max_autoget_size;
extern gchar *dcc_download_path;
extern gboolean toggle_dcc_fast_send;
extern gchar *dcc_upload_path;
extern gboolean toggle_dcc_mirc_ctcp;
extern gint dcc_block_size;
extern gint dcc_timeout;
/* servers */
typedef struct
{
gchar *server;
gchar *ircnet;
gchar *password;
gint port;
gboolean autoconnect;
time_t last_connect; /* to avoid reconnecting too fast.. */
}
SETUP_SERVER_REC;
/* servers */
extern GList *setupservers; /* list of local servers */
extern GList *ircnets; /* list of available ircnets */
extern gint server_reconnect_time; /* reconnect to server no sooner than n seconds */
extern gchar *source_host; /* Our own IP to use */
extern gboolean source_host_ok; /* Use source_host_ip .. */
extern IPADDR source_host_ip; /* Resolved address */
extern gchar *default_nick, *alternate_nick, *user_name, *real_name;
extern gboolean toggle_skip_motd;
/* IRC proxy */
extern gboolean toggle_use_ircproxy;
extern gchar *proxy_address;
extern gint proxy_port;
extern gchar *proxy_string;
/* appearance */
extern gboolean toggle_use_zvt;
extern gboolean toggle_use_transparency;
extern gboolean toggle_shaded_transparency;
extern gint panel_max_channels;
#endif

114
src/common.h Normal file
View File

@ -0,0 +1,114 @@
#ifndef __COMMON_H
#define __COMMON_H
#define IRSSI_AUTHOR "Timo Sirainen <cras@irccrew.org>"
#define IRSSI_WEBSITE "http://xlife.dhs.org/irssi/"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h>
#include <stdarg.h>
#include <ctype.h>
# ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif
#include <errno.h>
#include <time.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <sys/utsname.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifdef HAVE_DIRENT_H
# include <dirent.h>
#endif
#include <fcntl.h>
#ifdef HAVE_SOCKS_H
#include <socks.h>
#endif
#include <netdb.h>
#include <sys/socket.h>
#include <signal.h>
#include <sys/signal.h>
#include <sys/param.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <glib.h>
#include <gmodule.h>
typedef struct
{
gushort family;
#ifdef HAVE_IPV6
struct in6_addr addr;
#else
struct in_addr addr;
#endif
}
IPADDR;
#include "lib-config/irssi-config.h"
#include "common-setup.h"
/* GUI library must provide these functions: */
typedef enum
{
GUI_INPUT_READ = 1 << 0,
GUI_INPUT_WRITE = 1 << 1,
GUI_INPUT_EXCEPTION = 1 << 2
} GUIInputCondition;
typedef void (*GUIInputFunction) (gpointer data, gint handle, GUIInputCondition condition);
typedef gint (*GUITimeoutFunction) (gpointer data);
gint gui_input_add(gint handle, GUIInputCondition condition,
GUIInputFunction function, gpointer data);
void gui_input_remove(gint tag);
guint gui_timeout_add(guint32 interval, GUITimeoutFunction function, gpointer data);
void gui_timeout_remove(gint tag);
#ifdef MEM_DEBUG
void ig_mem_profile(void);
void ig_set_data(gchar *data);
gpointer ig_malloc(gint size, gchar *file, gint line);
gpointer ig_malloc0(gint size, gchar *file, gint line);
gpointer ig_realloc(gpointer mem, gulong size, gchar *file, gint line);
gchar *ig_strdup(const char *str, gchar *file, gint line);
gchar *ig_strconcat(const char *str, ...);
gchar *ig_strdup_printf(const gchar *format, ...) G_GNUC_PRINTF (1, 2);
void ig_free(gpointer p);
GString *ig_string_new(gchar *str);
void ig_string_free(GString *str, gboolean freeit);
#define g_malloc(a) ig_malloc(a, __FILE__, __LINE__)
#define g_malloc0(a) ig_malloc0(a, __FILE__, __LINE__)
#define g_realloc(a,b) ig_realloc(a, b, __FILE__, __LINE__)
#define g_strdup(a) ig_strdup(a, __FILE__, __LINE__)
#define g_strconcat ig_strconcat
#define g_strdup_printf ig_strdup_printf
#define g_strdup_vprintf ig_strdup_vprintf
#define g_free ig_free
#define g_string_new ig_string_new
#define g_string_free ig_string_free
#endif
#endif

11
src/irssi-plugin-gui.h Normal file
View File

@ -0,0 +1,11 @@
/* This contains all the necessary includes for creating GUI widgets to
plugins */
#ifdef HAVE_GTK
#include "gui-gnome/irssi.h"
#include "gui-gnome/setup-int.h"
#endif
#if defined (HAVE_CURSES) || defined (HAVE_SLANG)
#include "gui-text/irssi.h"
#endif

9
src/irssi-plugin.h Normal file
View File

@ -0,0 +1,9 @@
/* This contains all the necessary includes for irssi plugins.
irc-extra/plugins.h and irc-extra/plugins-commands.h has all the plugin
management functions */
#include "common.h"
#include "irc-base/irc-base.h"
#include "irc-extra/irc-extra.h"
#include "ui-common/ui-common.h"
#include "settings/settings.h"

178
src/signal.doc Normal file
View File

@ -0,0 +1,178 @@
IRC base
--------
* Requires to work properly:
"gui exit", CHANNEL_REC
"gui channel open", CHANNEL_REC
"send command", gchar *command, SERVER_REC, CHANNEL_REC
* Provides signals:
bans.c:
"ban new", BAN_REC
"ban remove", BAN_REC
"ban exception new", BAN_REC
"ban exception remove", BAN_REC
"ban type changed", gchar *bantype
channels.c:
"channel created", CHANNEL_REC
"channel destroyed", CHANNEL_REC
"channel name changed", CHANNEL_REC
"channel topic changed", CHANNEL_REC
"channel query", CHANNEL_REC
"channel sync", CHANNEL_REC
ctcp.c:
"ctcp msg "<cmd>, gchar *args, SERVER_REC, gchar *nick, gchar *addr, gchar *target
"default ctcp msg", gchar *args, SERVER_REC, gchar *nick, gchar *addr, gchar *target
"ctcp reply "<cmd>, gchar *args, SERVER_REC, gchar *nick, gchar *addr, gchar *target
"default ctcp reply", gchar *args, SERVER_REC, gchar *nick, gchar *addr, gchar *target
irc.c:
"send command", gchar *args, SERVER_REC
"command "<cmd>, gchar *args, SERVER_REC, CHANNEL_REC
"default command", gchar *args, SERVER_REC, CHANNEL_REC
"server event", gchar *args, SERVER_REC, gchar *sender_nick, gchar *sender_address
"event "<cmd>, gchar *args, SERVER_REC, gchar *sender_nick, gchar *sender_address
"default event", gchar *args, SERVER_REC, gchar *sender_nick, gchar *sender_address
modes.c:
"invitelist new", CHANNEL_REC, gchar *mask
"invitelist remove", CHANNEL_REC, gchar *mask
"channel mode changed", CHANNEL_REC
"user mode changed", SERVER_REC
"nick mode changed", CHANNEL_REC, NICK_REC
nicklist.c:
"nicklist new" CHANNEL_REC, NICK_REC
"nicklist remove" CHANNEL_REC, NICK_REC
"nicklist changed" CHANNEL_REC, NICK_REC, gchar *oldnick
"server nick changed" SERVER_REC
"massjoin" CHANNEL_REC, GList of NICK_RECs
server.c:
"server connect failed", SERVER_REC
"server connected", SERVER_REC
"server connecting", SERVER_REC, gulong *ip
"server looking", SERVER_REC
"server disconnected", SERVER_REC
"event connected", SERVER_REC
signal.c:
"signal", gchar *name, ...
IRC extra
---------
* Requires to work properly:
"print text stripped", SERVER_REC, gchar *channel, GINT_TO_POINTER(level), gchar *text
"plugin add menu", gchar *menuitem, void (*unload_func) (gpointer, PLUGIN_REC), PLUGIN_REC
* Provides signals:
dcc.c:
"dcc ctcp"<cmd>, gchar *args, DCC_REC
"default dcc ctcp", gchar *args, DCC_REC
"dcc unknown ctcp", gchar *args, gchar *sender, gchar *sendaddr
"dcc reply"<cmd>, gchar *args, DCC_REC
"default dcc reply"<cmd>, gchar *args, DCC_REC
"dcc unknown reply", gchar *args, gchar *sender, gchar *sendaddr
"dcc chat message", DCC_REC, gchar *msg
"dcc created", DCC_REC
"dcc destroyed", DCC_REC
"dcc connected", DCC_REC
"dcc rejecting", DCC_REC
"dcc closed", DCC_REC
"dcc chat message", DCC_REC, gchar *msg
"dcc transfer update", DCC_REC
"dcc request", DCC_REC
"dcc get receive", DCC_REC
"dcc error connect", DCC_REC
"dcc error file create", DCC_REC, gchar *filename
"dcc error file not found", gchar *nick, gchar *filename
"dcc error get not found", gchar *nick
"dcc error send exists", gchar *nick, gchar *filename
"dcc error unknown type", gchar *type
"dcc error close not found", gchar *type, gchar *nick, gchar *filename
flood.c:
"flood", SERVER_REC, gchar *nick, gchar *host, gchar *level, gchar *target
ignore.c:
"autoignore new", SERVER_REC, AUTOIGNORE_REC
"autoignore remove", SERVER_REC, AUTOIGNORE_REC
"ignore new", LIST_REC
"ignore change", LIST_REC
"ignore remove", LIST_REC
log.c:
"log created", LOG_REC
"log destroyed", LOG_REC
"log opened", LOG_REC
"log closed", LOG_REC
"log written", LOG_REC, gchar *line
"log item created", LOG_REC, LOG_ITEM_REC
"log item destroyed", LOG_REC, LOG_ITEM_REC
notifylist.c:
"notifylist new", LIST_REC
"notifylist remove", LIST_REC
"notifylist joined", SERVER_REC, gchar *nick, gchar *username, gchar *host, gchar *realname
"notifylist left", SERVER_REC, gchar *nick
plugins.c:
"plugin created", PLUGIN_REC
"plugin destroyed", PLUGIN_REC
"plugin cant load", gchar *name
"plugin already loaded", gchar *name
"plugin not loaded", gchar *name
UI common
---------
* Requires to work properly:
"gui print text", CHANNEL_REC, GINT_TO_POINTER fg, bg, flags, gchar *text
"gui window goto", GINT_TO_POINTER(number)
( "print text finished", CHANNEL_REC ) - can be used to determine when
all "gui print text"s are sent
* Provides signals:
ui-printtext.c:
"print text", SERVER_REC, gchar *channel, GINT_TO_POINTER(level), gchar *text
"print text stripped", SERVER_REC, gchar *channel, GINT_TO_POINTER(level), gchar *text
ui-themes.c:
"theme created", THEME_REC
"theme destroyed", THEME_REC
ui-windows.c:
"window created", WINDOW_REC
"window destroyed", WINDOW_REC

0
stamp.h.in Normal file
View File

2672
window-views-patch.diff Normal file

File diff suppressed because it is too large Load Diff