Commit 33b66f84 authored by stettberger's avatar stettberger

Manpage and FAQ

parent 6ed4f14b
......@@ -24,13 +24,13 @@ si.o: ${FILES}
${CC} -c ${CFLAGS} ${TARGET}.c
clean:
rm -f ${TARGET} *~ *.o *core
install:
install: all
@mkdir -p ${DESTDIR}${DOCDIR}
@mkdir -p ${DESTDIR}${BINDIR}
@mkdir -p ${DESTDIR}${MAN1DIR}
@install -d ${DESTDIR}${BINDIR} ${DESTDIR}${MAN1DIR}
@install -m 644 COPYING README ${DESTDIR}${DOCDIR}
@install -m 644 COPYING README FAQ buddylist ${DESTDIR}${DOCDIR}
@install -m 775 si ${DESTDIR}${BINDIR}
@install -m 444 si.1 ${DESTDIR}${MAN1DIR}
@echo "installed si"
......@@ -42,8 +42,9 @@ uninstall:
@echo "uninstalled si"
dist: clean
@mkdir -p si-${VERSION}
@cp -R Makefile README COPYING config.mk si.c si.1 buddylist.c mit.c mm.c si-${VERSION}
@mkdir -p si-${VERSION}/contrib
@cp -R Makefile README COPYING FAQ config.mk si.c si.1 buddylist.c mit.c mm.c si-${VERSION}
@cp -R contrib/buddylist contrib/multitailrc si-${VERSION}/contrib
@tar -cf si-${VERSION}.tar si-${VERSION}
@gzip si-${VERSION}.tar
@rm -rf si-${VERSION}
......
L I C E N S E :=
Copyright(C) 2006 Christian Dietrich <stettberger@gmx.de>
Copyright(C) 2006,2007 Christian Dietrich <stettberger@gmx.de>
si - silc imporved
Some parts of the Code are NOT under GPL. They are licensed unter MIT/X.
......@@ -51,7 +51,7 @@ I N S T A L A T I O N :=
I F I T D O E S N O T W O R K :=
please contact me at <stettberger@gmx.de>, but be patient.
please contact me at <stettberger@brokenpipe.de>, but be patient.
L A S T B U T N O T L E A S T :=
......
#!/usr/bin/python
import socket, select, os, sys, re, time
import curses
class BuddyList:
def __init__(self, server, prefix="%s/irc"%os.environ['HOME'], buffer=1024):
self.server=os.path.join(prefix,server)
self.server=os.path.join(self.server, "buddylist")
self.socket=socket.socket(socket.AF_UNIX, socket.SOCK_STREAM,0)
self.buffer=buffer
try:
self.socket.connect(self.server)
except:
self.socket=None
def has_data(self):
try:
(iwtd, owtd, ewtd)=select.select([self.socket],[],[],0.05)
except:
return False
if len(iwtd)==0:
return False
return True
def get_buddylist(self):
self.socket.send("getbuddylist\n")
text=self.socket.recv(self.buffer)
ret=[]
for i in text.split('\n'):
(status, nickname)=i.split(",",2)
if(status=="END"):
return ret
ret.append([status, nickname])
return ret
def read(self):
return self.socket.recv(self.buffer).replace("\n", "")
class DeMultiplexer:
def __init__(self, prefix="%s/irc"%os.environ['HOME']):
self.servers=[]
self.scr=None
self.buddylist=[]
for i in os.walk(prefix):
if "buddylist" in i[2]:
server=BuddyList(i[0].replace(prefix, "")[1:])
if server.socket==None:
continue
self.servers.append(server)
def init_curses(self):
self.scr = curses.initscr()
curses.start_color()
curses.noecho()
curses.init_pair(1, curses.COLOR_GREEN, curses.COLOR_BLACK)
curses.init_pair(2, curses.COLOR_RED, curses.COLOR_BLACK)
curses.init_pair(3, curses.COLOR_BLUE, curses.COLOR_BLACK)
self.scr.attron(curses.A_BOLD)
def sort_buddylist(self):
online=[]
away=[]
gone=[]
detach=[]
for i in self.buddylist:
if "D" in i[0]: detach.append(i)
elif "G" in i[0]: gone.append(i)
elif "I" in i[0]: away.append(i)
else: online.append(i)
self.buddylist=[]
for i in online: self.buddylist.append(i)
for i in away: self.buddylist.append(i)
for i in gone: self.buddylist.append(i)
for i in detach: self.buddylist.append(i)
def refresh(self):
self.buddylist=[]
for i in self.servers:
for x in i.get_buddylist():
self.buddylist.append(x)
self.scr.clear()
self.sort_buddylist()
for i in self.buddylist:
if "D" in i[0]:
self.scr.addstr("[%s] %s\n"%(i[0], i[1]), curses.color_pair(3))
elif "G" in i[0]:
self.scr.addstr("[%s] %s\n"%(i[0], i[1]), curses.color_pair(3) | curses.A_BOLD)
elif "I" in i[0]:
self.scr.addstr("[%s] %s\n"%(i[0], i[1]), curses.color_pair(2) | curses.A_BOLD)
else:
self.scr.addstr("[%s] %s\n"%(i[0], i[1]), curses.color_pair(1) | curses.A_BOLD)
self.scr.refresh()
def run(self):
self.init_curses()
self.refresh()
try:
while True:
for i in self.servers:
if i.has_data():
if i.read() == "update":
self.refresh()
time.sleep(1)
except:
curses.endwin()
fd=DeMultiplexer()
fd.run()
sys.exit(1)
#allow_8bit:yes
colorscheme:irc
# messages
cs_re_s:magenta,,bold:^..:.. [<].*(stettberger)[>].*$
cs_re_s:yellow,,bold:^..:.. <([^<>]+)>.+$
cs_re_s:green:^..:.. [<].*stettberger[>](.*)$
cs_re_s:yellow:^..:.. .*(stettberger)[,:].*$
cs_re_s:cyan:^(..:..).*$
cs_re_s:yellow:^..:.. (\[.*\]).*$
cs_re:yellow:(http:\/\/[a-zA-Z&\?.0-9+\=+-_~#/]+)
cs_re_s:magenta:^..:.. \[.*\] <([^<>]*)>.*$
cs_re_s:red:^..:.. \[.*\] >([^<>]*)<.*$
cs_re_s:red:^..:.. >([^<>]*)<.*$
# Watches Errors and other status messages
cs_re_s:blue:^..:...*(-!-)
cs_re_s:green:^..:...*(-\?!-)
cs_re_s:red:^..:...*-!- (Error [^\s]+:)
cs_re_s:yellow:^..:...*-!- (Watch:)
# Status lines
cs_re_s:cyan,,bold:^..:.. -!- ([^ \(\[]*)
cs_re_s:cyan:^..:.. -!- [^ \(\[]*(.*) has
cs_re_s:green:^..:.. -!- [^ \(\[]*.* (has) quit (.*)
cs_re_s:red:^..:.. -!- [^ \(\[]*.* (quit)
cs_re_s:green:^..:.. -!- [^ \(\[]*(.*)
cs_re_s:,,bold:_([^ ]*)_
titlebar:%m %u@%h %f (%t) [%l]
tail:/usr/bin/turbotail
.de FN
\fI\|\\$1\|\fP\\$2
..
.TH SI 1 "May 26, 2007"
.SH NAME
si \- silc improved
......@@ -76,9 +79,57 @@ join a channel
.TP
.FN /query " nickname"
start a private conversation with the user
.TP
.FN /leave " channel"
leave a channel
.TP
.FN /chaninfo " <topic|mode>"
print inforation about a channel
.TP
.FN /update
refresh the buddylist
.TP
.FN /me " action"
send an action message
.TP
.FN /file
.RS
.TP
.FN list
list all filetransfers
.TP
.FN accept " <number>"
accept a filetransfer
.TP
.FN send " <nick> <path> [-no-listener]"
send an filetransfer a file. With -no-listener the other side has to bind
.TP
.FN close " <number>"
close a filetransfer
.RE
.TP
.FN /names
print users on a channel
.TP
.FN /msg " <user> <message>
send private message to user
.TP
.FN /set
.RS
.TP
.FN signed " <on|off>
send signed messages
.TP
.FN signal_detach " <on|off>"
detach the session on an signal (e.g. SIGTERM), so i can be resumed with next connect
.TP
.FN auto_away " <on|off>"
set usermode to away after a few minutes of inactiviy
.RE
.TP
.FN /mime " <mime-type> [-buffer]>"
open an fifo for sending mime messages
.TP
Everything which is not a command, i.e. not starting with a slash, will simply be posted into the channel or to the server.
.TP
.FH out file usage
......
......@@ -626,7 +626,7 @@ proc_channels_input(Channel *c, char *buf)
/* MIME command */
else if (!strncmp("mime ", &buf[1], 5)) {
int i, b = FALSE;
unsigned int i, b = FALSE;
char **argv;
SilcUInt32 *argv_lens, *argv_types, argc;
silc_parse_command_line((unsigned char *)buf,
......@@ -704,7 +704,7 @@ proc_queries_input (Query *peer, char *buf )
/* MIME command */
else if (! strncmp("mime ", &buf[1], 5)) {
int i, b = FALSE;
unsigned int i, b = FALSE;
char **argv;
SilcUInt32 *argv_lens, *argv_types, argc;
silc_parse_command_line((unsigned char *)buf,
......@@ -879,7 +879,7 @@ silc_verify_message(SilcClientEntry sender, SilcMessagePayload message)
const unsigned char *pk_data;
SilcUInt32 pk_datalen;
int i;
unsigned int i;
char *fpKey;
SilcPublicKey pk = silc_message_signed_get_public_key(message, &pk_data,
&pk_datalen);
......@@ -1233,8 +1233,8 @@ run(void)
}
/* Install the SigHandler for SIGINT */
if(signal(SIGINT, sig_handler));
if(signal(SIGTERM, sig_handler));
signal(SIGINT, sig_handler);
signal(SIGTERM, sig_handler);
/* Ignore some SIGPIPE */
signal(SIGPIPE, SIG_IGN);
......@@ -1523,7 +1523,7 @@ silc_command_reply(SilcClient client, SilcClientConnection conn,
SilcPublicKey key;
void *entry;
char *filename, *pos;
int i;
unsigned int i;
type=va_arg(va, int);
entry=va_arg(va, void *);
......@@ -1534,8 +1534,8 @@ silc_command_reply(SilcClient client, SilcClientConnection conn,
char *fpKey = silc_hash_fingerprint(0, pk, pk_len);
char *fp=malloc(strlen(fpKey)+1);
NULL_TEST(fp);
for (i=0; i<strlen(fpKey); i++){
if (fpKey[i]==' ')
for (i = 0; i < strlen(fpKey); i++){
if (fpKey[i] == ' ')
fp[i]='_';
else
fp[i]=fpKey[i];
......@@ -1954,7 +1954,7 @@ verify_public_key(SilcPublicKey key, int remote)
unsigned char *pk;
SilcUInt32 pk_len;
char *fp, *path;
int tmp;
unsigned int tmp;
DIR *dir;
struct dirent *entry;
pk = silc_pkcs_public_key_encode(key, &pk_len);
......@@ -2006,7 +2006,7 @@ silc_verify_public_key(SilcClient client, SilcClientConnection conn,
{
char *fingerprint, *path, *pos;
unsigned char *pk;
int tmp;
unsigned int tmp;
SilcUInt32 pk_len;
pk = silc_pkcs_public_key_encode(pkey, &pk_len);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment