Commit b94e0ded authored by stettberger's avatar stettberger

Basic recieving of Files

Key trusting for servers and clients
/link support improvement in irc_shell
parent ead5d259
......@@ -6,7 +6,7 @@
import re, sys, os
ircdir="%s/irc"%os.environ['HOME']
browser="firefox %s"
browser="firefox \"%s\""
def read_file_reverse(filename, callback, many=1):
fd=open(filename, "r")
......@@ -30,7 +30,7 @@ def read_file_reverse(filename, callback, many=1):
fd.close()
def parse_url(line):
regex=".*(?P<url>(?:(?:[hH][tT]{2}[Pp][sS]?)|(?:[fF][Tt][Pp]))://[a-zA-Z&\?.0-9+\-_~#/]*).*"
regex=".*(?P<url>(?:(?:[hH][tT]{2}[Pp][sS]?)|(?:[fF][Tt][Pp]))://[a-zA-Z&\?.0-9+\-_=~#/]*).*"
if re.match(regex, line):
return re.match(regex, line).groups("url")[0]
return None
......
......@@ -8,7 +8,7 @@ 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:yellow:(http:\/\/[a-zA-Z&\?.0-9+\-_~=#/]+)
cs_re_s:magenta:^..:.. \[.*\] [<>]([^<>]*)[<>].*$
# Watches Errors and other status messages
......
......@@ -182,6 +182,39 @@ void rm_query(Query *peer) {
free(peer);
}
void add_transfer(int num, SilcUInt32 id, SilcClientEntry sender, int type) {
Transfer *t, *tmp;
t=malloc(sizeof(Transfer));
NULL_TEST(t);
if(!transfers)
transfers=t;
else{
tmp=transfers;
while(tmp->next)
tmp=tmp->next;
tmp->next=t;
}
t->number=num;
t->id=id;
t->silc=sender;
t->type=type;
t->status=FILE_STATUS_WAIT;
t->next=NULL;
}
void rm_transfer(Transfer *t) {
Transfer *tmp;
if (t==transfers) {
transfers=transfers->next;
}
else
for (tmp=transfers; tmp; tmp=tmp->next)
if(tmp->id==t->id)
tmp->next=t->next;
free(t->path);
free(t);
}
void handle_query_input ( Query *peer ){
static char buf[PIPE_BUF];
char *path;
......
This diff is collapsed.
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