source: protocols/bee_ft.c @ c1d9c95

Last change on this file since c1d9c95 was 17a6ee9, checked in by Wilmer van der Gaast <wilmer@…>, at 2010-04-11T14:37:06Z

Including DCC stuff again, with a wonderful extra layer of abstraction.
Some hooks are missing so sending files doesn't work yet. Receiving also
still seems to have some issues. On the plus side, at least the MSN/Jabber
modules work again.

  • Property mode set to 100644
File size: 2.0 KB
RevLine 
[17a6ee9]1/********************************************************************\
2* BitlBee -- An IRC to other IM-networks gateway                     *
3*                                                                    *
4* Copyright 2010 Wilmer van der Gaast <wilmer@gaast.net>             *
5\********************************************************************/
6
7/*
8  This program is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation; either version 2 of the License, or
11  (at your option) any later version.
12
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  GNU General Public License for more details.
17
18  You should have received a copy of the GNU General Public License with
19  the Debian GNU/Linux distribution in /usr/share/common-licenses/GPL;
20  if not, write to the Free Software Foundation, Inc., 59 Temple Place,
21  Suite 330, Boston, MA  02111-1307  USA
22*/
23
24#define BITLBEE_CORE
25#include "bitlbee.h"
26#include "ft.h"
27
28file_transfer_t *imcb_file_send_start( struct im_connection *ic, char *handle, char *file_name, size_t file_size )
29{
30        bee_t *bee = ic->bee; 
31        bee_user_t *bu = bee_user_by_handle( bee, ic, handle );
32       
33        if( bee->ui->ft_in_start )
34                return bee->ui->ft_in_start( bee, bu, file_name, file_size );
35        else
36                return NULL;
37}
38
39gboolean imcb_file_recv_start( struct im_connection *ic, file_transfer_t *ft )
40{
41        bee_t *bee = ic->bee;
42       
43        if( bee->ui->ft_out_start )
44                return bee->ui->ft_out_start( ic, ft );
45        else
46                return FALSE;
47}
48
49void imcb_file_canceled( struct im_connection *ic, file_transfer_t *file, char *reason )
50{
51        bee_t *bee = ic->bee;
52       
53        if( file->canceled )
54                file->canceled( file, reason );
55       
56        if( bee->ui->ft_close )
57                bee->ui->ft_close( ic, file );
58}
59
60void imcb_file_finished( struct im_connection *ic, file_transfer_t *file )
61{
62        bee_t *bee = ic->bee;
63       
64        if( bee->ui->ft_finished )
65                bee->ui->ft_finished( ic, file );
66}
Note: See TracBrowser for help on using the repository browser.