comparison libpurple/protocols/msn/slpcall.c @ 24398:b27908701f66

For some reason the slpmsg and slplink functions don't have underscores in the names, but the slpcall functions do. So rename msn_slp_call_blah to msn_slpcall_blah
author Mark Doliner <mark@kingant.net>
date Thu, 13 Nov 2008 08:01:36 +0000
parents 33697964e62b
children 9bdaf273c0ff
comparison
equal deleted inserted replaced
24397:33697964e62b 24398:b27908701f66
32 /************************************************************************** 32 /**************************************************************************
33 * Main 33 * Main
34 **************************************************************************/ 34 **************************************************************************/
35 35
36 static gboolean 36 static gboolean
37 msn_slp_call_timeout(gpointer data) 37 msn_slpcall_timeout(gpointer data)
38 { 38 {
39 MsnSlpCall *slpcall; 39 MsnSlpCall *slpcall;
40 40
41 slpcall = data; 41 slpcall = data;
42 42
44 purple_debug_info("msn", "slpcall_timeout: slpcall(%p)\n", slpcall); 44 purple_debug_info("msn", "slpcall_timeout: slpcall(%p)\n", slpcall);
45 #endif 45 #endif
46 46
47 if (!slpcall->pending && !slpcall->progress) 47 if (!slpcall->pending && !slpcall->progress)
48 { 48 {
49 msn_slp_call_destroy(slpcall); 49 msn_slpcall_destroy(slpcall);
50 return FALSE; 50 return FALSE;
51 } 51 }
52 52
53 slpcall->progress = FALSE; 53 slpcall->progress = FALSE;
54 54
55 return TRUE; 55 return TRUE;
56 } 56 }
57 57
58 MsnSlpCall * 58 MsnSlpCall *
59 msn_slp_call_new(MsnSlpLink *slplink) 59 msn_slpcall_new(MsnSlpLink *slplink)
60 { 60 {
61 MsnSlpCall *slpcall; 61 MsnSlpCall *slpcall;
62 62
63 g_return_val_if_fail(slplink != NULL, NULL); 63 g_return_val_if_fail(slplink != NULL, NULL);
64 64
70 70
71 slpcall->slplink = slplink; 71 slpcall->slplink = slplink;
72 72
73 msn_slplink_add_slpcall(slplink, slpcall); 73 msn_slplink_add_slpcall(slplink, slpcall);
74 74
75 slpcall->timer = purple_timeout_add(MSN_SLPCALL_TIMEOUT, msn_slp_call_timeout, slpcall); 75 slpcall->timer = purple_timeout_add(MSN_SLPCALL_TIMEOUT, msn_slpcall_timeout, slpcall);
76 76
77 return slpcall; 77 return slpcall;
78 } 78 }
79 79
80 void 80 void
81 msn_slp_call_destroy(MsnSlpCall *slpcall) 81 msn_slpcall_destroy(MsnSlpCall *slpcall)
82 { 82 {
83 GList *e; 83 GList *e;
84 84
85 #ifdef MSN_DEBUG_SLPCALL 85 #ifdef MSN_DEBUG_SLPCALL
86 purple_debug_info("msn", "slpcall_destroy: slpcall(%p)\n", slpcall); 86 purple_debug_info("msn", "slpcall_destroy: slpcall(%p)\n", slpcall);
123 123
124 g_free(slpcall); 124 g_free(slpcall);
125 } 125 }
126 126
127 void 127 void
128 msn_slp_call_init(MsnSlpCall *slpcall, MsnSlpCallType type) 128 msn_slpcall_init(MsnSlpCall *slpcall, MsnSlpCallType type)
129 { 129 {
130 slpcall->session_id = rand() % 0xFFFFFF00 + 4; 130 slpcall->session_id = rand() % 0xFFFFFF00 + 4;
131 slpcall->id = rand_guid(); 131 slpcall->id = rand_guid();
132 slpcall->type = type; 132 slpcall->type = type;
133 } 133 }
134 134
135 void 135 void
136 msn_slp_call_session_init(MsnSlpCall *slpcall) 136 msn_slpcall_session_init(MsnSlpCall *slpcall)
137 { 137 {
138 if (slpcall->session_init_cb) 138 if (slpcall->session_init_cb)
139 slpcall->session_init_cb(slpcall); 139 slpcall->session_init_cb(slpcall);
140 140
141 slpcall->started = TRUE; 141 slpcall->started = TRUE;
142 } 142 }
143 143
144 void 144 void
145 msn_slp_call_invite(MsnSlpCall *slpcall, const char *euf_guid, 145 msn_slpcall_invite(MsnSlpCall *slpcall, const char *euf_guid,
146 int app_id, const char *context) 146 int app_id, const char *context)
147 { 147 {
148 MsnSlpLink *slplink; 148 MsnSlpLink *slplink;
149 MsnSlpMessage *slpmsg; 149 MsnSlpMessage *slpmsg;
150 char *header; 150 char *header;
183 g_free(header); 183 g_free(header);
184 g_free(content); 184 g_free(content);
185 } 185 }
186 186
187 void 187 void
188 msn_slp_call_close(MsnSlpCall *slpcall) 188 msn_slpcall_close(MsnSlpCall *slpcall)
189 { 189 {
190 g_return_if_fail(slpcall != NULL); 190 g_return_if_fail(slpcall != NULL);
191 g_return_if_fail(slpcall->slplink != NULL); 191 g_return_if_fail(slpcall->slplink != NULL);
192 192
193 send_bye(slpcall, "application/x-msnmsgr-sessionclosebody"); 193 send_bye(slpcall, "application/x-msnmsgr-sessionclosebody");
194 msn_slplink_unleash(slpcall->slplink); 194 msn_slplink_unleash(slpcall->slplink);
195 msn_slp_call_destroy(slpcall); 195 msn_slpcall_destroy(slpcall);
196 } 196 }
197 197
198 MsnSlpCall * 198 MsnSlpCall *
199 msn_slp_process_msg(MsnSlpLink *slplink, MsnSlpMessage *slpmsg) 199 msn_slp_process_msg(MsnSlpLink *slplink, MsnSlpMessage *slpmsg)
200 { 200 {
232 else if (slpmsg->flags == 0x100) 232 else if (slpmsg->flags == 0x100)
233 { 233 {
234 slpcall = slplink->directconn->initial_call; 234 slpcall = slplink->directconn->initial_call;
235 235
236 if (slpcall != NULL) 236 if (slpcall != NULL)
237 msn_slp_call_session_init(slpcall); 237 msn_slpcall_session_init(slpcall);
238 } 238 }
239 #endif 239 #endif
240 240
241 return slpcall; 241 return slpcall;
242 } 242 }