Tue, 22 Jun 2010 22:44:28 +0000
Destroy Parts when the SlpMessage is destroyed.
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
1 | /** |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
2 | * @file slpcall.h SLP Call functions |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
3 | * |
| 15884 | 4 | * purple |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
5 | * |
| 15884 | 6 | * Purple is the legal property of its developers, whose names are too numerous |
|
9198
e8eb6d5eb9eb
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
7 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
e8eb6d5eb9eb
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
8 | * source distribution. |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
9 | * |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
10 | * This program is free software; you can redistribute it and/or modify |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
11 | * it under the terms of the GNU General Public License as published by |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
12 | * the Free Software Foundation; either version 2 of the License, or |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
13 | * (at your option) any later version. |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
14 | * |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
15 | * This program is distributed in the hope that it will be useful, |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
18 | * GNU General Public License for more details. |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
19 | * |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
20 | * You should have received a copy of the GNU General Public License |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
21 | * along with this program; if not, write to the Free Software |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
15884
diff
changeset
|
22 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
23 | */ |
|
29305
202cb72ed5b0
Minor header file cleanup. Mostly I wanted to move some enums above some #includes
Mark Doliner <markdoliner@pidgin.im>
parents:
28694
diff
changeset
|
24 | #ifndef MSN_SLPCALL_H |
|
202cb72ed5b0
Minor header file cleanup. Mostly I wanted to move some enums above some #includes
Mark Doliner <markdoliner@pidgin.im>
parents:
28694
diff
changeset
|
25 | #define MSN_SLPCALL_H |
|
202cb72ed5b0
Minor header file cleanup. Mostly I wanted to move some enums above some #includes
Mark Doliner <markdoliner@pidgin.im>
parents:
28694
diff
changeset
|
26 | |
|
202cb72ed5b0
Minor header file cleanup. Mostly I wanted to move some enums above some #includes
Mark Doliner <markdoliner@pidgin.im>
parents:
28694
diff
changeset
|
27 | typedef struct _MsnSlpCall MsnSlpCall; |
|
202cb72ed5b0
Minor header file cleanup. Mostly I wanted to move some enums above some #includes
Mark Doliner <markdoliner@pidgin.im>
parents:
28694
diff
changeset
|
28 | |
|
202cb72ed5b0
Minor header file cleanup. Mostly I wanted to move some enums above some #includes
Mark Doliner <markdoliner@pidgin.im>
parents:
28694
diff
changeset
|
29 | typedef enum |
|
202cb72ed5b0
Minor header file cleanup. Mostly I wanted to move some enums above some #includes
Mark Doliner <markdoliner@pidgin.im>
parents:
28694
diff
changeset
|
30 | { |
|
202cb72ed5b0
Minor header file cleanup. Mostly I wanted to move some enums above some #includes
Mark Doliner <markdoliner@pidgin.im>
parents:
28694
diff
changeset
|
31 | MSN_SLPCALL_ANY, |
|
202cb72ed5b0
Minor header file cleanup. Mostly I wanted to move some enums above some #includes
Mark Doliner <markdoliner@pidgin.im>
parents:
28694
diff
changeset
|
32 | MSN_SLPCALL_DC |
|
202cb72ed5b0
Minor header file cleanup. Mostly I wanted to move some enums above some #includes
Mark Doliner <markdoliner@pidgin.im>
parents:
28694
diff
changeset
|
33 | } MsnSlpCallType; |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
34 | |
|
11137
cf40226ddff7
[gaim-migrate @ 13201]
Mark Doliner <markdoliner@pidgin.im>
parents:
10296
diff
changeset
|
35 | #include "internal.h" |
|
29305
202cb72ed5b0
Minor header file cleanup. Mostly I wanted to move some enums above some #includes
Mark Doliner <markdoliner@pidgin.im>
parents:
28694
diff
changeset
|
36 | |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
37 | #include "slplink.h" |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
38 | |
|
10225
0dfea1bc8695
[gaim-migrate @ 11357]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9259
diff
changeset
|
39 | /* The official client seems to timeout slp calls after 5 minutes */ |
|
24619
5ece4c87ea96
Use purple_timeout_add_seconds() instead of purple_timeout_add() in a
Mark Doliner <markdoliner@pidgin.im>
parents:
24618
diff
changeset
|
40 | #define MSN_SLPCALL_TIMEOUT 300 |
|
10225
0dfea1bc8695
[gaim-migrate @ 11357]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9259
diff
changeset
|
41 | |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
42 | struct _MsnSlpCall |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
43 | { |
|
24618
190103ba3381
For some reason the slpmsg and slplink functions don't have underscores
Mark Doliner <markdoliner@pidgin.im>
parents:
24615
diff
changeset
|
44 | /* Our parent slplink */ |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
45 | MsnSlpLink *slplink; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
46 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
47 | MsnSlpCallType type; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
48 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
49 | /* Call-ID */ |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
50 | char *id; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
51 | char *branch; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
52 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
53 | long session_id; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
54 | long app_id; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
55 | |
|
10296
9badf1cedc6e
[gaim-migrate @ 11476]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10225
diff
changeset
|
56 | gboolean pending; /**< A flag that states if we should wait for this |
|
9badf1cedc6e
[gaim-migrate @ 11476]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10225
diff
changeset
|
57 | slpcall to start and do not time out. */ |
|
9badf1cedc6e
[gaim-migrate @ 11476]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10225
diff
changeset
|
58 | gboolean progress; /**< A flag that states if there has been progress since |
|
9badf1cedc6e
[gaim-migrate @ 11476]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10225
diff
changeset
|
59 | the last time out. */ |
|
9badf1cedc6e
[gaim-migrate @ 11476]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10225
diff
changeset
|
60 | gboolean wasted; /**< A flag that states if this slpcall is going to be |
|
9badf1cedc6e
[gaim-migrate @ 11476]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10225
diff
changeset
|
61 | destroyed. */ |
|
9badf1cedc6e
[gaim-migrate @ 11476]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10225
diff
changeset
|
62 | gboolean started; /**< A flag that states if this slpcall's session has |
|
9badf1cedc6e
[gaim-migrate @ 11476]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10225
diff
changeset
|
63 | been initiated. */ |
|
9badf1cedc6e
[gaim-migrate @ 11476]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10225
diff
changeset
|
64 | |
|
30066
25742b976ce2
Initial support for direct connections. Preliminary patch from ticket #247
Gábor Szuromi <kukkerman@gmail.com>
parents:
29305
diff
changeset
|
65 | gboolean wait_for_socket; |
|
25742b976ce2
Initial support for direct connections. Preliminary patch from ticket #247
Gábor Szuromi <kukkerman@gmail.com>
parents:
29305
diff
changeset
|
66 | |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
67 | void (*progress_cb)(MsnSlpCall *slpcall, |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
68 | gsize total_length, gsize len, gsize offset); |
|
23938
4570d6e22b9e
Get rid of MsnSlpSession entirely. It only seems to link to MsnSlpCall
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
19859
diff
changeset
|
69 | void (*session_init_cb)(MsnSlpCall *slpcall); |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
70 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
71 | /* Can be checksum, or smile */ |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
72 | char *data_info; |
| 30067 | 73 | |
|
23991
7f0f58aafd57
take an extra reference to PurpleXfer so we can check whether the whole
Ka-Hing Cheung <khc@pidgin.im>
parents:
23938
diff
changeset
|
74 | PurpleXfer *xfer; |
|
28694
76761af122e8
A quick and dirty hack to make MSN use the in-core code to perform FT.
Paul Aurich <darkrain42@pidgin.im>
parents:
25105
diff
changeset
|
75 | union { |
|
76761af122e8
A quick and dirty hack to make MSN use the in-core code to perform FT.
Paul Aurich <darkrain42@pidgin.im>
parents:
25105
diff
changeset
|
76 | GByteArray *incoming_data; |
|
76761af122e8
A quick and dirty hack to make MSN use the in-core code to perform FT.
Paul Aurich <darkrain42@pidgin.im>
parents:
25105
diff
changeset
|
77 | struct { |
|
76761af122e8
A quick and dirty hack to make MSN use the in-core code to perform FT.
Paul Aurich <darkrain42@pidgin.im>
parents:
25105
diff
changeset
|
78 | gsize len; |
|
76761af122e8
A quick and dirty hack to make MSN use the in-core code to perform FT.
Paul Aurich <darkrain42@pidgin.im>
parents:
25105
diff
changeset
|
79 | const guchar *data; |
|
76761af122e8
A quick and dirty hack to make MSN use the in-core code to perform FT.
Paul Aurich <darkrain42@pidgin.im>
parents:
25105
diff
changeset
|
80 | } outgoing; |
|
76761af122e8
A quick and dirty hack to make MSN use the in-core code to perform FT.
Paul Aurich <darkrain42@pidgin.im>
parents:
25105
diff
changeset
|
81 | } u; |
|
76761af122e8
A quick and dirty hack to make MSN use the in-core code to perform FT.
Paul Aurich <darkrain42@pidgin.im>
parents:
25105
diff
changeset
|
82 | MsnSlpMessage *xfer_msg; /* A dirty hack */ |
|
9198
e8eb6d5eb9eb
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
83 | |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
84 | MsnSlpCb cb; |
|
13126
afce0fe97885
[gaim-migrate @ 15487]
Evan Schoenberg <evands@pidgin.im>
parents:
11137
diff
changeset
|
85 | void (*end_cb)(MsnSlpCall *slpcall, MsnSession *session); |
|
10225
0dfea1bc8695
[gaim-migrate @ 11357]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9259
diff
changeset
|
86 | |
|
24615
9a156dbd94c4
msn_slplink_remove_slpcall() shouldn't be responsible for setting
Mark Doliner <markdoliner@pidgin.im>
parents:
24614
diff
changeset
|
87 | guint timer; |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
88 | }; |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
89 | |
|
24618
190103ba3381
For some reason the slpmsg and slplink functions don't have underscores
Mark Doliner <markdoliner@pidgin.im>
parents:
24615
diff
changeset
|
90 | MsnSlpCall *msn_slpcall_new(MsnSlpLink *slplink); |
|
190103ba3381
For some reason the slpmsg and slplink functions don't have underscores
Mark Doliner <markdoliner@pidgin.im>
parents:
24615
diff
changeset
|
91 | void msn_slpcall_init(MsnSlpCall *slpcall, MsnSlpCallType type); |
|
190103ba3381
For some reason the slpmsg and slplink functions don't have underscores
Mark Doliner <markdoliner@pidgin.im>
parents:
24615
diff
changeset
|
92 | void msn_slpcall_session_init(MsnSlpCall *slpcall); |
|
190103ba3381
For some reason the slpmsg and slplink functions don't have underscores
Mark Doliner <markdoliner@pidgin.im>
parents:
24615
diff
changeset
|
93 | void msn_slpcall_destroy(MsnSlpCall *slpcall); |
|
190103ba3381
For some reason the slpmsg and slplink functions don't have underscores
Mark Doliner <markdoliner@pidgin.im>
parents:
24615
diff
changeset
|
94 | void msn_slpcall_invite(MsnSlpCall *slpcall, const char *euf_guid, |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
95 | int app_id, const char *context); |
|
24618
190103ba3381
For some reason the slpmsg and slplink functions don't have underscores
Mark Doliner <markdoliner@pidgin.im>
parents:
24615
diff
changeset
|
96 | void msn_slpcall_close(MsnSlpCall *slpcall); |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
97 | |
|
29305
202cb72ed5b0
Minor header file cleanup. Mostly I wanted to move some enums above some #includes
Mark Doliner <markdoliner@pidgin.im>
parents:
28694
diff
changeset
|
98 | #endif /* MSN_SLPCALL_H */ |