"dcc error file not found" -> "dcc error file open". Print the actual error

message based on errno, don't just assume the file wasn't found.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1471 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-05-11 12:43:59 +00:00 committed by cras
commit cb28685574
6 changed files with 13 additions and 9 deletions

View file

@ -64,13 +64,15 @@ static void dcc_closed(SEND_DCC_REC *dcc)
}
}
static void dcc_error_file_not_found(const char *nick, const char *fname)
static void dcc_error_file_open(const char *nick, const char *fname,
void *error)
{
g_return_if_fail(nick != NULL);
g_return_if_fail(fname != NULL);
printformat(NULL, NULL, MSGLEVEL_DCC,
IRCTXT_DCC_SEND_FILE_NOT_FOUND, fname);
IRCTXT_DCC_SEND_FILE_OPEN_ERROR, fname,
g_strerror(GPOINTER_TO_INT(error)));
}
static void dcc_error_send_exists(const char *nick, const char *fname)
@ -124,7 +126,7 @@ void fe_dcc_send_init(void)
{
signal_add("dcc connected", (SIGNAL_FUNC) dcc_connected);
signal_add("dcc closed", (SIGNAL_FUNC) dcc_closed);
signal_add("dcc error file not found", (SIGNAL_FUNC) dcc_error_file_not_found);
signal_add("dcc error file open", (SIGNAL_FUNC) dcc_error_file_open);
signal_add("dcc error send exists", (SIGNAL_FUNC) dcc_error_send_exists);
signal_add("dcc error close not found", (SIGNAL_FUNC) dcc_error_close_not_found);
signal_add("complete command dcc send", (SIGNAL_FUNC) sig_dcc_send_complete);
@ -135,7 +137,7 @@ void fe_dcc_send_deinit(void)
{
signal_remove("dcc connected", (SIGNAL_FUNC) dcc_connected);
signal_remove("dcc closed", (SIGNAL_FUNC) dcc_closed);
signal_remove("dcc error file not found", (SIGNAL_FUNC) dcc_error_file_not_found);
signal_remove("dcc error file open", (SIGNAL_FUNC) dcc_error_file_open);
signal_remove("dcc error send exists", (SIGNAL_FUNC) dcc_error_send_exists);
signal_remove("dcc error close not found", (SIGNAL_FUNC) dcc_error_close_not_found);
signal_remove("complete command dcc send", (SIGNAL_FUNC) sig_dcc_send_complete);

View file

@ -45,7 +45,7 @@ FORMAT_REC fecommon_irc_dcc_formats[] = {
{ "dcc_send_channel", "{dcc DCC SEND from {nick $0} [$1 port $2]: $3 [$4 bytes] requested in channel {channel $5}}", 6, { 0, 0, 1, 0, 2, 0 } },
{ "dcc_send_exists", "{dcc DCC already sending file {dccfile $0} for {nick $1}}", 2, { 0, 0 } },
{ "dcc_send_not_found", "{dcc DCC not sending file {dccfile $1} to {nick $0}}", 2, { 0, 0 } },
{ "dcc_send_file_not_found", "{dcc DCC file not found: {dccfile $0}}", 1, { 0 } },
{ "dcc_send_file_open_error", "{dcc DCC can't open file {dccfile $0}: $1}", 2, { 0, 0 } },
{ "dcc_send_connected", "{dcc DCC sending file {dccfile $0} for {nick $1} [$2 port $3]}", 4, { 0, 0, 0, 1 } },
{ "dcc_send_complete", "{dcc DCC sent file {dccfile $0} [{hilight $1}kB] for {nick $2} in {hilight $3} secs [{hilight $4kB/s}]}", 5, { 0, 2, 0, 2, 3 } },
{ "dcc_send_aborted", "{dcc DCC aborted sending file {dccfile $0} for {nick $1}}", 2, { 0, 0 } },

View file

@ -23,7 +23,7 @@ enum {
IRCTXT_DCC_SEND_CHANNEL,
IRCTXT_DCC_SEND_EXISTS,
IRCTXT_DCC_SEND_NOT_FOUND,
IRCTXT_DCC_SEND_FILE_NOT_FOUND,
IRCTXT_DCC_SEND_FILE_OPEN_ERROR,
IRCTXT_DCC_SEND_CONNECTED,
IRCTXT_DCC_SEND_COMPLETE,
IRCTXT_DCC_SEND_ABORTED,