Mercurial > pidgin.yaz
annotate src/protocols/msn/msnslp.c @ 7499:e71678bfbe3f
[gaim-migrate @ 8112]
italian
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Thu, 13 Nov 2003 11:44:20 +0000 |
parents | 08ce2a94d9c7 |
children | 3a48ade4f510 |
rev | line source |
---|---|
6701 | 1 /** |
2 * @file msnslp.c MSNSLP support | |
3 * | |
4 * gaim | |
5 * | |
6 * Copyright (C) 2003 Christian Hammond <chipx86@gnupdate.org> | |
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 | |
19 * along with this program; if not, write to the Free Software | |
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
21 */ | |
6786
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
22 #include "msn.h" |
6701 | 23 #include "msnslp.h" |
24 | |
25 MsnSlpSession * | |
26 msn_slp_session_new(MsnSwitchBoard *swboard, gboolean local_initiated) | |
27 { | |
28 MsnSlpSession *slpsession; | |
29 | |
30 g_return_val_if_fail(swboard != NULL, NULL); | |
31 | |
32 slpsession = g_new0(MsnSlpSession, 1); | |
33 | |
34 slpsession->swboard = swboard; | |
35 slpsession->local_initiated = local_initiated; | |
36 | |
37 return slpsession; | |
38 } | |
39 | |
40 void | |
41 msn_slp_session_destroy(MsnSlpSession *session) | |
42 { | |
43 g_return_if_fail(session != NULL); | |
44 | |
6883
ac638b90da44
[gaim-migrate @ 7429]
Christian Hammond <chipx86@chipx86.com>
parents:
6868
diff
changeset
|
45 if (session->orig_body != NULL) |
ac638b90da44
[gaim-migrate @ 7429]
Christian Hammond <chipx86@chipx86.com>
parents:
6868
diff
changeset
|
46 g_free(session->orig_body); |
ac638b90da44
[gaim-migrate @ 7429]
Christian Hammond <chipx86@chipx86.com>
parents:
6868
diff
changeset
|
47 |
ac638b90da44
[gaim-migrate @ 7429]
Christian Hammond <chipx86@chipx86.com>
parents:
6868
diff
changeset
|
48 if (session->outgoing_msg != NULL) |
ac638b90da44
[gaim-migrate @ 7429]
Christian Hammond <chipx86@chipx86.com>
parents:
6868
diff
changeset
|
49 msn_message_unref(session->outgoing_msg); |
ac638b90da44
[gaim-migrate @ 7429]
Christian Hammond <chipx86@chipx86.com>
parents:
6868
diff
changeset
|
50 |
ac638b90da44
[gaim-migrate @ 7429]
Christian Hammond <chipx86@chipx86.com>
parents:
6868
diff
changeset
|
51 if (session->call_id != NULL) |
ac638b90da44
[gaim-migrate @ 7429]
Christian Hammond <chipx86@chipx86.com>
parents:
6868
diff
changeset
|
52 g_free(session->call_id); |
ac638b90da44
[gaim-migrate @ 7429]
Christian Hammond <chipx86@chipx86.com>
parents:
6868
diff
changeset
|
53 |
6701 | 54 g_free(session); |
55 } | |
56 | |
6786
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
57 gboolean |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
58 msn_slp_session_msg_received(MsnSlpSession *slpsession, MsnMessage *msg) |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
59 { |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
60 const char *body; |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
61 |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
62 g_return_val_if_fail(slpsession != NULL, TRUE); |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
63 g_return_val_if_fail(msg != NULL, TRUE); |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
64 g_return_val_if_fail(msg->msnslp_message, TRUE); |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
65 g_return_val_if_fail(!strcmp(msn_message_get_content_type(msg), |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
66 "application/x-msnmsgrp2p"), TRUE); |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
67 |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
68 body = msn_message_get_body(msg); |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
69 |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
70 if (strlen(body) == 0) |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
71 { |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
72 /* ACK. Ignore it. */ |
6842
bd433a45a463
[gaim-migrate @ 7387]
Christian Hammond <chipx86@chipx86.com>
parents:
6831
diff
changeset
|
73 gaim_debug_info("msn", "Received MSNSLP ACK\n"); |
bd433a45a463
[gaim-migrate @ 7387]
Christian Hammond <chipx86@chipx86.com>
parents:
6831
diff
changeset
|
74 |
6786
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
75 return FALSE; |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
76 } |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
77 |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
78 /* Now send an ack, since we got this. */ |
6868
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
79 msn_slp_session_send_ack(slpsession, msg); |
6786
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
80 |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
81 return FALSE; |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
82 } |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
83 |
6868
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
84 static void |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
85 send_msg_part(MsnSlpSession *slpsession, MsnMessage *msg) |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
86 { |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
87 msg->msnslp_header.length = |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
88 (slpsession->orig_len - slpsession->offset > 1202 |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
89 ? 1202 : slpsession->orig_len - slpsession->offset); |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
90 |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
91 if (slpsession->offset > 0) |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
92 { |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
93 if (msg->bin_content) |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
94 { |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
95 msn_message_set_bin_data(msg, |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
96 slpsession->orig_body + slpsession->offset, |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
97 msg->msnslp_header.length); |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
98 } |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
99 else |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
100 { |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
101 msn_message_set_body(msg, |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
102 slpsession->orig_body + slpsession->offset); |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
103 } |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
104 } |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
105 |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
106 msg->msnslp_header.offset_1 = slpsession->offset; |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
107 |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
108 msn_switchboard_send_msg(slpsession->swboard, msg); |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
109 |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
110 if (slpsession->offset + msg->msnslp_header.length == slpsession->orig_len) |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
111 { |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
112 msn_message_destroy(msg); |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
113 |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
114 g_free(slpsession->orig_body); |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
115 |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
116 slpsession->offset = 0; |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
117 slpsession->orig_len = 0; |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
118 slpsession->orig_body = NULL; |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
119 slpsession->outgoing_msg = NULL; |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
120 } |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
121 else |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
122 slpsession->offset += msg->msnslp_header.length; |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
123 } |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
124 |
6701 | 125 void |
6786
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
126 msn_slp_session_send_msg(MsnSlpSession *slpsession, MsnMessage *msg) |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
127 { |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
128 g_return_if_fail(slpsession != NULL); |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
129 g_return_if_fail(msg != NULL); |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
130 g_return_if_fail(msg->msnslp_message); |
6868
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
131 g_return_if_fail(slpsession->outgoing_msg == NULL); |
6786
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
132 |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
133 msg->msnslp_header.session_id = slpsession->session_id; |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
134 |
6868
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
135 slpsession->outgoing_msg = msn_message_ref(msg); |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
136 |
6786
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
137 if (slpsession->base_id == 0) |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
138 { |
6868
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
139 slpsession->base_id = rand() % 0x0FFFFFF0 + 4; |
6786
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
140 slpsession->prev_msg_id = slpsession->base_id; |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
141 } |
6868
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
142 else if (slpsession->offset == 0) |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
143 slpsession->prev_msg_id = ++slpsession->base_id; |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
144 |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
145 msg->msnslp_header.id = slpsession->prev_msg_id; |
7475 | 146 /*msg->msnslp_header.ack_session_id = rand() % 0xFFFFFF00;*/ |
6883
ac638b90da44
[gaim-migrate @ 7429]
Christian Hammond <chipx86@chipx86.com>
parents:
6868
diff
changeset
|
147 msg->msnslp_header.ack_session_id = 0x1407C7DE; |
6868
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
148 |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
149 msn_message_set_charset(msg, NULL); |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
150 |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
151 if (msg->msnslp_header.session_id != 0) |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
152 msg->msnslp_footer.app_id = 1; |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
153 |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
154 if (msg->bin_content) |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
155 { |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
156 const void *temp; |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
157 |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
158 temp = msn_message_get_bin_data(msg, &slpsession->orig_len); |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
159 |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
160 slpsession->orig_body = g_memdup(temp, slpsession->orig_len); |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
161 } |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
162 else |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
163 { |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
164 slpsession->orig_body = g_strdup(msn_message_get_body(msg)); |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
165 slpsession->orig_len = strlen(slpsession->orig_body); |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
166 } |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
167 |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
168 msg->msnslp_header.total_size_1 = slpsession->orig_len; |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
169 |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
170 send_msg_part(slpsession, msg); |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
171 } |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
172 |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
173 void |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
174 msn_slp_session_send_ack(MsnSlpSession *slpsession, MsnMessage *acked_msg) |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
175 { |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
176 MsnMessage *msg; |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
177 gboolean new_base_id = FALSE; |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
178 |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
179 g_return_if_fail(slpsession != NULL); |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
180 g_return_if_fail(acked_msg != NULL); |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
181 g_return_if_fail(acked_msg->msnslp_message); |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
182 g_return_if_fail(slpsession->outgoing_msg == NULL); |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
183 |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
184 msg = msn_message_new_msnslp_ack(acked_msg); |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
185 |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
186 if (slpsession->base_id == 0) |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
187 { |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
188 slpsession->base_id = rand() % 0x0FFFFE00 + 10; |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
189 slpsession->prev_msg_id = slpsession->base_id; |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
190 |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
191 new_base_id = TRUE; |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
192 } |
6786
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
193 else |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
194 slpsession->prev_msg_id = ++slpsession->base_id; |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
195 |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
196 msg->msnslp_header.id = slpsession->prev_msg_id; |
6800
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6786
diff
changeset
|
197 |
6868
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
198 if (new_base_id) |
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
199 slpsession->prev_msg_id -= 4; |
6827
1cfbb731aa1f
[gaim-migrate @ 7372]
Christian Hammond <chipx86@chipx86.com>
parents:
6800
diff
changeset
|
200 |
6786
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
201 msn_switchboard_send_msg(slpsession->swboard, msg); |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
202 } |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
203 |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
204 void |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
205 msn_slp_session_request_user_display(MsnSlpSession *slpsession, |
6800
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6786
diff
changeset
|
206 MsnUser *local_user, |
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6786
diff
changeset
|
207 MsnUser *remote_user, |
6786
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
208 const MsnObject *obj) |
6701 | 209 { |
6786
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
210 MsnMessage *invite_msg; |
6842
bd433a45a463
[gaim-migrate @ 7387]
Christian Hammond <chipx86@chipx86.com>
parents:
6831
diff
changeset
|
211 long session_id; |
6786
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
212 char *msnobj_data; |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
213 char *msnobj_base64; |
6827
1cfbb731aa1f
[gaim-migrate @ 7372]
Christian Hammond <chipx86@chipx86.com>
parents:
6800
diff
changeset
|
214 char *branch; |
6786
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
215 char *content; |
6800
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6786
diff
changeset
|
216 char *body; |
6786
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
217 |
6800
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6786
diff
changeset
|
218 g_return_if_fail(slpsession != NULL); |
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6786
diff
changeset
|
219 g_return_if_fail(local_user != NULL); |
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6786
diff
changeset
|
220 g_return_if_fail(remote_user != NULL); |
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6786
diff
changeset
|
221 g_return_if_fail(obj != NULL); |
6786
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
222 |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
223 msnobj_data = msn_object_to_string(obj); |
7106
db6bd3e794d8
[gaim-migrate @ 7671]
Christian Hammond <chipx86@chipx86.com>
parents:
6883
diff
changeset
|
224 msnobj_base64 = gaim_base64_encode(msnobj_data, strlen(msnobj_data)); |
6786
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
225 g_free(msnobj_data); |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
226 |
6868
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
227 #if 0 |
6800
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6786
diff
changeset
|
228 if ((c = strchr(msnobj_base64, '=')) != NULL) |
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6786
diff
changeset
|
229 *c = '\0'; |
6868
ab80de7a74d1
[gaim-migrate @ 7414]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
230 #endif |
6800
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6786
diff
changeset
|
231 |
6842
bd433a45a463
[gaim-migrate @ 7387]
Christian Hammond <chipx86@chipx86.com>
parents:
6831
diff
changeset
|
232 session_id = rand() % 0xFFFFFF00 + 4; |
6827
1cfbb731aa1f
[gaim-migrate @ 7372]
Christian Hammond <chipx86@chipx86.com>
parents:
6800
diff
changeset
|
233 |
1cfbb731aa1f
[gaim-migrate @ 7372]
Christian Hammond <chipx86@chipx86.com>
parents:
6800
diff
changeset
|
234 branch = g_strdup_printf("%4X%4X-%4X-%4X-%4X-%4X%4X%4X", |
1cfbb731aa1f
[gaim-migrate @ 7372]
Christian Hammond <chipx86@chipx86.com>
parents:
6800
diff
changeset
|
235 rand() % 0xAAFF + 0x1111, |
1cfbb731aa1f
[gaim-migrate @ 7372]
Christian Hammond <chipx86@chipx86.com>
parents:
6800
diff
changeset
|
236 rand() % 0xAAFF + 0x1111, |
1cfbb731aa1f
[gaim-migrate @ 7372]
Christian Hammond <chipx86@chipx86.com>
parents:
6800
diff
changeset
|
237 rand() % 0xAAFF + 0x1111, |
1cfbb731aa1f
[gaim-migrate @ 7372]
Christian Hammond <chipx86@chipx86.com>
parents:
6800
diff
changeset
|
238 rand() % 0xAAFF + 0x1111, |
1cfbb731aa1f
[gaim-migrate @ 7372]
Christian Hammond <chipx86@chipx86.com>
parents:
6800
diff
changeset
|
239 rand() % 0xAAFF + 0x1111, |
1cfbb731aa1f
[gaim-migrate @ 7372]
Christian Hammond <chipx86@chipx86.com>
parents:
6800
diff
changeset
|
240 rand() % 0xAAFF + 0x1111, |
1cfbb731aa1f
[gaim-migrate @ 7372]
Christian Hammond <chipx86@chipx86.com>
parents:
6800
diff
changeset
|
241 rand() % 0xAAFF + 0x1111, |
1cfbb731aa1f
[gaim-migrate @ 7372]
Christian Hammond <chipx86@chipx86.com>
parents:
6800
diff
changeset
|
242 rand() % 0xAAFF + 0x1111); |
1cfbb731aa1f
[gaim-migrate @ 7372]
Christian Hammond <chipx86@chipx86.com>
parents:
6800
diff
changeset
|
243 |
6883
ac638b90da44
[gaim-migrate @ 7429]
Christian Hammond <chipx86@chipx86.com>
parents:
6868
diff
changeset
|
244 slpsession->call_id = g_strdup_printf("%4X%4X-%4X-%4X-%4X-%4X%4X%4X", |
ac638b90da44
[gaim-migrate @ 7429]
Christian Hammond <chipx86@chipx86.com>
parents:
6868
diff
changeset
|
245 rand() % 0xAAFF + 0x1111, |
ac638b90da44
[gaim-migrate @ 7429]
Christian Hammond <chipx86@chipx86.com>
parents:
6868
diff
changeset
|
246 rand() % 0xAAFF + 0x1111, |
ac638b90da44
[gaim-migrate @ 7429]
Christian Hammond <chipx86@chipx86.com>
parents:
6868
diff
changeset
|
247 rand() % 0xAAFF + 0x1111, |
ac638b90da44
[gaim-migrate @ 7429]
Christian Hammond <chipx86@chipx86.com>
parents:
6868
diff
changeset
|
248 rand() % 0xAAFF + 0x1111, |
ac638b90da44
[gaim-migrate @ 7429]
Christian Hammond <chipx86@chipx86.com>
parents:
6868
diff
changeset
|
249 rand() % 0xAAFF + 0x1111, |
ac638b90da44
[gaim-migrate @ 7429]
Christian Hammond <chipx86@chipx86.com>
parents:
6868
diff
changeset
|
250 rand() % 0xAAFF + 0x1111, |
ac638b90da44
[gaim-migrate @ 7429]
Christian Hammond <chipx86@chipx86.com>
parents:
6868
diff
changeset
|
251 rand() % 0xAAFF + 0x1111, |
ac638b90da44
[gaim-migrate @ 7429]
Christian Hammond <chipx86@chipx86.com>
parents:
6868
diff
changeset
|
252 rand() % 0xAAFF + 0x1111); |
6786
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
253 |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
254 content = g_strdup_printf( |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
255 "EUF-GUID: {A4268EEC-FEC5-49E5-95C3-F126696BDBF6}\r\n" |
6883
ac638b90da44
[gaim-migrate @ 7429]
Christian Hammond <chipx86@chipx86.com>
parents:
6868
diff
changeset
|
256 "SessionID: %lu\r\n" |
6786
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
257 "AppID: 1\r\n" |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
258 "Context: %s", |
6842
bd433a45a463
[gaim-migrate @ 7387]
Christian Hammond <chipx86@chipx86.com>
parents:
6831
diff
changeset
|
259 session_id, |
6786
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
260 msnobj_base64); |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
261 |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
262 g_free(msnobj_base64); |
6701 | 263 |
6800
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6786
diff
changeset
|
264 body = g_strdup_printf( |
6786
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
265 "INVITE MSNMSGR:%s MSNSLP/1.0\r\n" |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
266 "To: <msnmsgr:%s>\r\n" |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
267 "From: <msnmsgr:%s>\r\n" |
6827
1cfbb731aa1f
[gaim-migrate @ 7372]
Christian Hammond <chipx86@chipx86.com>
parents:
6800
diff
changeset
|
268 "Via: MSNSLP/1.0/TLP ;branch={%s}\r\n" |
6786
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
269 "CSeq: 0\r\n" |
6827
1cfbb731aa1f
[gaim-migrate @ 7372]
Christian Hammond <chipx86@chipx86.com>
parents:
6800
diff
changeset
|
270 "Call-ID: {%s}\r\n" |
6786
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
271 "Max-Forwards: 0\r\n" |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
272 "Content-Type: application/x-msnmsgr-sessionreqbody\r\n" |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
273 "Content-Length: %d\r\n" |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
274 "\r\n" |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
275 "%s" |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
276 "\r\n\r\n", |
6800
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6786
diff
changeset
|
277 msn_user_get_passport(remote_user), |
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6786
diff
changeset
|
278 msn_user_get_passport(remote_user), |
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6786
diff
changeset
|
279 msn_user_get_passport(local_user), |
6827
1cfbb731aa1f
[gaim-migrate @ 7372]
Christian Hammond <chipx86@chipx86.com>
parents:
6800
diff
changeset
|
280 branch, |
6883
ac638b90da44
[gaim-migrate @ 7429]
Christian Hammond <chipx86@chipx86.com>
parents:
6868
diff
changeset
|
281 slpsession->call_id, |
7386 | 282 (int)strlen(content) + 5, |
6786
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
283 content); |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
284 |
6800
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6786
diff
changeset
|
285 g_free(content); |
6827
1cfbb731aa1f
[gaim-migrate @ 7372]
Christian Hammond <chipx86@chipx86.com>
parents:
6800
diff
changeset
|
286 g_free(branch); |
6800
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6786
diff
changeset
|
287 |
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6786
diff
changeset
|
288 gaim_debug_misc("msn", "Message = {%s}\n", body); |
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6786
diff
changeset
|
289 |
6831
a372cf34387e
[gaim-migrate @ 7376]
Christian Hammond <chipx86@chipx86.com>
parents:
6827
diff
changeset
|
290 invite_msg = msn_message_new_msnslp(); |
6800
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6786
diff
changeset
|
291 |
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6786
diff
changeset
|
292 msn_message_set_sender(invite_msg, local_user); |
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6786
diff
changeset
|
293 msn_message_set_receiver(invite_msg, remote_user); |
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6786
diff
changeset
|
294 |
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6786
diff
changeset
|
295 msn_message_set_body(invite_msg, body); |
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6786
diff
changeset
|
296 |
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6786
diff
changeset
|
297 g_free(body); |
6786
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
298 |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
299 msn_slp_session_send_msg(slpsession, invite_msg); |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
300 |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
301 msn_message_destroy(invite_msg); |
6701 | 302 } |
6786
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
303 |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
304 gboolean |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
305 msn_p2p_msg(MsnServConn *servconn, MsnMessage *msg) |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
306 { |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
307 MsnSwitchBoard *swboard = servconn->data; |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
308 gboolean session_ended = FALSE; |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
309 |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
310 if (swboard->slp_session == NULL) |
6800
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6786
diff
changeset
|
311 swboard->slp_session = msn_slp_session_new(swboard, FALSE); |
6786
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
312 |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
313 session_ended = msn_slp_session_msg_received(swboard->slp_session, msg); |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
314 |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
315 if (session_ended) |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
316 msn_slp_session_destroy(swboard->slp_session); |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
317 |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
318 return FALSE; |
8efafdc38718
[gaim-migrate @ 7325]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
319 } |