summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2004-07-11 16:07:40 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2004-07-11 16:07:40 +0000
commit5133583132f8f741fd161d9bb2aa547b602af158 (patch)
tree574b477815f51d19a1c00daa44e6d390a04ecef4 /src
parent0fe183b8c94061601416e35f28b755ca41303a12 (diff)
downloadirssi-5133583132f8f741fd161d9bb2aa547b602af158.zip
Some DCC SERVER fixes.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3266 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r--src/irc/dcc/dcc-server.c12
-rw-r--r--src/irc/dcc/dcc.c1
2 files changed, 6 insertions, 7 deletions
diff --git a/src/irc/dcc/dcc-server.c b/src/irc/dcc/dcc-server.c
index 0a073a9d..f2ac0250 100644
--- a/src/irc/dcc/dcc-server.c
+++ b/src/irc/dcc/dcc-server.c
@@ -114,10 +114,10 @@ static void dcc_server_update_flags(SERVER_DCC_REC *dcc, const char *flags)
}
/* Initialize DCC record */
-static void dcc_init_server_rec(SERVER_DCC_REC *dcc, IRC_SERVER_REC *server)
+static void dcc_init_server_rec(SERVER_DCC_REC *dcc, IRC_SERVER_REC *server,
+ const char *mynick, const char *servertag)
{
g_return_if_fail(dcc != NULL);
- g_return_if_fail(server != NULL);
g_return_if_fail(IS_DCC_SERVER(dcc));
MODULE_DATA_INIT(dcc);
@@ -127,8 +127,8 @@ static void dcc_init_server_rec(SERVER_DCC_REC *dcc, IRC_SERVER_REC *server)
dcc->nick = NULL;
dcc->tagconn = dcc->tagread = dcc->tagwrite = -1;
dcc->server = server;
- dcc->mynick = g_strdup(server != NULL ? server->nick : "??");
- dcc->servertag = server != NULL ? g_strdup(server->tag) : NULL;
+ dcc->mynick = g_strdup(mynick);
+ dcc->servertag = g_strdup(servertag);
dcc_conns = g_slist_append(dcc_conns, dcc);
signal_emit("dcc created", 1, dcc);
@@ -142,7 +142,7 @@ static SERVER_DCC_REC *dcc_server_create(IRC_SERVER_REC *server, const char *fla
dcc->orig_type = dcc->type = DCC_SERVER_TYPE;
dcc_server_update_flags(dcc, flags);
- dcc_init_server_rec(dcc, server);
+ dcc_init_server_rec(dcc, server, dcc->mynick, dcc->servertag);
return dcc;
}
@@ -158,7 +158,7 @@ static SERVER_DCC_REC *dcc_server_clone(SERVER_DCC_REC *dcc)
newdcc->accept_chat = dcc->accept_chat;
newdcc->accept_fserve = dcc->accept_fserve;
- dcc_init_server_rec(newdcc, dcc->server);
+ dcc_init_server_rec(newdcc, dcc->server, dcc->mynick, dcc->servertag);
return newdcc;
}
diff --git a/src/irc/dcc/dcc.c b/src/irc/dcc/dcc.c
index 42129794..ef3d29ef 100644
--- a/src/irc/dcc/dcc.c
+++ b/src/irc/dcc/dcc.c
@@ -78,7 +78,6 @@ void dcc_init_rec(DCC_REC *dcc, IRC_SERVER_REC *server, CHAT_DCC_REC *chat,
g_return_if_fail(dcc != NULL);
g_return_if_fail(nick != NULL);
g_return_if_fail(arg != NULL);
- g_return_if_fail(server != NULL || chat != NULL);
MODULE_DATA_INIT(dcc);
dcc->created = time(NULL);