Mercurial > pidgin.yaz
comparison src/protocols/msn/switchboard.c @ 5475:ad9887c91a59
[gaim-migrate @ 5871]
Fixed our support for the standard. I misread the discussion and used an
alternative proposal. So now we use the new, correct one.
Basically, what this means to the users is that 0.64 users will still see
0.63 MSN buddy icons, but 0.63 won't see 0.64's. No big deal.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Thu, 22 May 2003 01:31:56 +0000 |
parents | c6efac0e28ff |
children | 4f72b611f0ee |
comparison
equal
deleted
inserted
replaced
5474:0b355ec51083 | 5475:ad9887c91a59 |
---|---|
28 | 28 |
29 /************************************************************************** | 29 /************************************************************************** |
30 * Utility functions | 30 * Utility functions |
31 **************************************************************************/ | 31 **************************************************************************/ |
32 static gboolean | 32 static gboolean |
33 __send_clientinfo(MsnSwitchBoard *swboard) | 33 __send_clientcaps(MsnSwitchBoard *swboard) |
34 { | 34 { |
35 MsnMessage *msg; | 35 MsnMessage *msg; |
36 | 36 |
37 if (swboard->buddy_icon_xfer != NULL) | 37 if (swboard->buddy_icon_xfer != NULL) |
38 return TRUE; | 38 return TRUE; |
39 | 39 |
40 msg = msn_message_new(); | 40 msg = msn_message_new(); |
41 msn_message_set_content_type(msg, "text/x-clientinfo"); | 41 msn_message_set_content_type(msg, "text/x-clientcaps"); |
42 msn_message_set_charset(msg, NULL); | 42 msn_message_set_charset(msg, NULL); |
43 msn_message_set_attr(msg, "User-Agent", NULL); | 43 msn_message_set_attr(msg, "User-Agent", NULL); |
44 msn_message_set_body(msg, MSN_CLIENTINFO); | 44 msn_message_set_body(msg, MSN_CLIENTINFO); |
45 | 45 |
46 if (!msn_switchboard_send_msg(swboard, msg)) { | 46 if (!msn_switchboard_send_msg(swboard, msg)) { |
87 MsnSwitchBoard *swboard = servconn->data; | 87 MsnSwitchBoard *swboard = servconn->data; |
88 | 88 |
89 if (swboard->chat != NULL) | 89 if (swboard->chat != NULL) |
90 gaim_chat_add_user(GAIM_CHAT(swboard->chat), gc->username, NULL); | 90 gaim_chat_add_user(GAIM_CHAT(swboard->chat), gc->username, NULL); |
91 | 91 |
92 return __send_clientinfo(swboard); | 92 return __send_clientcaps(swboard); |
93 } | 93 } |
94 | 94 |
95 static gboolean | 95 static gboolean |
96 __bye_cmd(MsnServConn *servconn, const char *command, const char **params, | 96 __bye_cmd(MsnServConn *servconn, const char *command, const char **params, |
97 size_t param_count) | 97 size_t param_count) |
194 | 194 |
195 return FALSE; | 195 return FALSE; |
196 } | 196 } |
197 } | 197 } |
198 | 198 |
199 return __send_clientinfo(swboard); | 199 return __send_clientcaps(swboard); |
200 } | 200 } |
201 | 201 |
202 static gboolean | 202 static gboolean |
203 __msg_cmd(MsnServConn *servconn, const char *command, const char **params, | 203 __msg_cmd(MsnServConn *servconn, const char *command, const char **params, |
204 size_t param_count) | 204 size_t param_count) |
316 | 316 |
317 return TRUE; | 317 return TRUE; |
318 } | 318 } |
319 | 319 |
320 static gboolean | 320 static gboolean |
321 __clientinfo_msg(MsnServConn *servconn, const MsnMessage *msg) | 321 __clientcaps_msg(MsnServConn *servconn, const MsnMessage *msg) |
322 { | 322 { |
323 MsnSession *session = servconn->session; | 323 MsnSession *session = servconn->session; |
324 MsnSwitchBoard *swboard = servconn->data; | 324 MsnSwitchBoard *swboard = servconn->data; |
325 MsnUser *user; | 325 MsnUser *user; |
326 GHashTable *clientinfo; | 326 GHashTable *clientcaps; |
327 const char *value; | 327 const char *value; |
328 | 328 |
329 user = msn_user_new(session, servconn->msg_passport, NULL); | 329 user = msn_user_new(session, servconn->msg_passport, NULL); |
330 | 330 |
331 clientinfo = msn_message_get_hashtable_from_body(msg); | 331 clientcaps = msn_message_get_hashtable_from_body(msg); |
332 | 332 |
333 if ((value = g_hash_table_lookup(clientinfo, "Buddy-Icons")) != NULL) | 333 if ((value = g_hash_table_lookup(clientcaps, "Buddy-Icons")) != NULL) |
334 msn_buddy_icon_invite(swboard); | 334 msn_buddy_icon_invite(swboard); |
335 | 335 |
336 return TRUE; | 336 return TRUE; |
337 } | 337 } |
338 | 338 |
421 | 421 |
422 /* Register the message type callbacks. */ | 422 /* Register the message type callbacks. */ |
423 msn_servconn_register_msg_type(servconn, "text/plain", __plain_msg); | 423 msn_servconn_register_msg_type(servconn, "text/plain", __plain_msg); |
424 msn_servconn_register_msg_type(servconn, "text/x-msmsgscontrol", | 424 msn_servconn_register_msg_type(servconn, "text/x-msmsgscontrol", |
425 __control_msg); | 425 __control_msg); |
426 msn_servconn_register_msg_type(servconn, "text/x-clientcaps", | |
427 __clientcaps_msg); | |
426 msn_servconn_register_msg_type(servconn, "text/x-clientinfo", | 428 msn_servconn_register_msg_type(servconn, "text/x-clientinfo", |
427 __clientinfo_msg); | 429 __clientcaps_msg); |
428 msn_servconn_register_msg_type(servconn, "application/x-buddyicon", | 430 msn_servconn_register_msg_type(servconn, "application/x-buddyicon", |
429 msn_buddy_icon_msg); | 431 msn_buddy_icon_msg); |
430 | 432 |
431 /* Save these for future use. */ | 433 /* Save these for future use. */ |
432 switchboard_commands = servconn->commands; | 434 switchboard_commands = servconn->commands; |