[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Ayttm-commits] CVS: ayttm/modules/msn2 msn.C,1.75,1.76
From: |
Colin Leroy <address@hidden> |
Subject: |
[Ayttm-commits] CVS: ayttm/modules/msn2 msn.C,1.75,1.76 |
Date: |
Wed, 19 Mar 2003 18:15:29 -0500 |
Update of /cvsroot/ayttm/ayttm/modules/msn2
In directory subversions:/tmp/cvs-serv32284/modules/msn2
Modified Files:
msn.C
Log Message:
better error handling in msn file tranfre
Index: msn.C
===================================================================
RCS file: /cvsroot/ayttm/ayttm/modules/msn2/msn.C,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -r1.75 -r1.76
--- msn.C 19 Mar 2003 18:19:43 -0000 1.75
+++ msn.C 19 Mar 2003 23:15:27 -0000 1.76
@@ -425,7 +425,7 @@
LList *msn_contacts = NULL;
-transfer_window * eb_find_window_tag(invitation_ftp * inv) {
+transfer_window * eb_find_window_by_inv(invitation_ftp * inv) {
llist * l = transfer_windows;
while(l!=NULL) {
if( ((transfer_window *)l->data)->inv == inv )
@@ -434,6 +434,15 @@
return NULL;
}
+transfer_window * eb_find_window_by_tag(int tag) {
+ llist * l = transfer_windows;
+ while(l!=NULL) {
+ if( ((transfer_window *)l->data)->window_tag == tag )
+ return ((transfer_window *)l->data);
+ }
+ return NULL;
+}
+
enum
{
MSN_ONLINE,
@@ -705,8 +714,6 @@
void eb_msn_send_file(eb_local_account *from, eb_account *to, char *file)
{
-
-// do_error_dialog("MSN does not support file sending at the moment",
"Not supported");
struct stat stats;
eb_msn_local_account_data *mlad =
(eb_msn_local_account_data *)from->protocol_local_account_data;
@@ -994,7 +1001,7 @@
void ext_filetrans_success(invitation_ftp * inv) {
sprintf(buf, _("File %s transfered."), inv->filename);
do_error_dialog(buf, _("File transfered"));
- transfer_window * t_win = eb_find_window_tag(inv);
+ transfer_window * t_win = eb_find_window_by_inv(inv);
if (t_win) {
progress_window_close(t_win->window_tag);
msn_del_from_llist(transfer_windows, t_win);
@@ -1005,7 +1012,7 @@
{
sprintf(buf, "File transfer failed: %s\nThe file sender must have a
public IP,\n and his firewall must allow TCP connections to port 1863.", msg);
do_error_dialog(buf, "Transfer failed");
- transfer_window * t_win = eb_find_window_tag(inv);
+ transfer_window * t_win = eb_find_window_by_inv(inv);
if (t_win) {
progress_window_close(t_win->window_tag);
msn_del_from_llist(transfer_windows, t_win);
@@ -1015,9 +1022,8 @@
void ext_filetrans_progress(invitation_ftp * inv, char * status, unsigned long
recv, unsigned long total)
{
int tag=-1;
- eb_debug(DBG_MSN, "%s: (%lu/%lu bytes transferred)\n", status, recv,
total);
transfer_window * t_win = NULL;
- t_win = eb_find_window_tag(inv);
+ t_win = eb_find_window_by_inv(inv);
if (t_win != NULL)
tag = t_win->window_tag;
update_progress(tag, recv);
@@ -1778,6 +1784,15 @@
eb_debug(DBG_MSN, "Got switchboard connection\n");
}
+void eb_msn_filesend_cancel(int tag)
+{
+ transfer_window *w = eb_find_window_by_tag(tag);
+ if (w) {
+ eb_debug(DBG_MSN,"cancelling FTP transfer with %s\n",
w->inv->other_user);
+ msn_filetrans_cancel(w->inv);
+ }
+}
+
void ext_user_joined(msnconn * conn, char * username, char * friendlyname, int
is_initial)
{
eb_chat_room * ecr;
@@ -1840,6 +1855,7 @@
int tag = progress_window_new(filename, inv->filesize);
#endif
transfer_window * t_win = new transfer_window;
+ progress_window_set_close_cb(tag, eb_msn_filesend_cancel);
t_win->inv = inv;
t_win->window_tag = tag;
msn_add_to_llist(transfer_windows, t_win);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Ayttm-commits] CVS: ayttm/modules/msn2 msn.C,1.75,1.76,
Colin Leroy <address@hidden> <=
- Prev by Date:
[Ayttm-commits] CVS: ayttm/src progress_window.c,1.7,1.8 progress_window.h,1.3,1.4
- Next by Date:
[Ayttm-commits] CVS: ayttm/modules/msn2/libmsn2 msn_core.C,1.33,1.34
- Previous by thread:
[Ayttm-commits] CVS: ayttm/src progress_window.c,1.7,1.8 progress_window.h,1.3,1.4
- Next by thread:
[Ayttm-commits] CVS: ayttm/modules/msn2/libmsn2 msn_core.C,1.33,1.34
- Index(es):