From: <may...@us...> - 2006-08-26 13:03:30
|
Revision: 17045 Author: mayuan2006 Date: 2006-08-26 06:03:11 -0700 (Sat, 26 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=17045&view=rev Log Message: ----------- add a MIME encode function,processing utf-8 and base64 encode committed by MaYuan<may...@gm...> Modified Paths: -------------- branches/soc-2006-msnp13/src/protocols/msn/contact.c branches/soc-2006-msnp13/src/protocols/msn/msn-utils.c branches/soc-2006-msnp13/src/protocols/msn/msn-utils.h branches/soc-2006-msnp13/src/protocols/msn/msn.c Modified: branches/soc-2006-msnp13/src/protocols/msn/contact.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/contact.c 2006-08-26 12:54:39 UTC (rev 17044) +++ branches/soc-2006-msnp13/src/protocols/msn/contact.c 2006-08-26 13:03:11 UTC (rev 17045) @@ -430,10 +430,6 @@ xmlnode_free(node); msn_soap_free_read_buf(contact->soapconn); - - msn_notification_dump_contact(session); - msn_set_psm(session); - msn_session_finish_login(session); } static void @@ -450,6 +446,11 @@ // gaim_debug_misc("msn", "soap contact server Reply: {%s}\n", soapconn->read_buf); msn_parse_addressbook(contact); + + msn_notification_dump_contact(session); + msn_set_psm(session); + msn_session_finish_login(session); + /*free the read buffer*/ msn_soap_free_read_buf(soapconn); } Modified: branches/soc-2006-msnp13/src/protocols/msn/msn-utils.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/msn-utils.c 2006-08-26 12:54:39 UTC (rev 17044) +++ branches/soc-2006-msnp13/src/protocols/msn/msn-utils.c 2006-08-26 13:03:11 UTC (rev 17045) @@ -146,6 +146,18 @@ g_free(cur); } +/*encode the str to RFC2047 style + * Currently only support the UTF-8 and base64 encode + */ +char * +msn_encode_mime(char *str) +{ + char *base64; + + base64 = gaim_base64_encode(str,strlen(str)); + return g_strdup_printf("=?utf-8?B?%s?=",base64); +} + /* * We need this because we're only supposed to encode spaces in the font * names. gaim_url_encode() isn't acceptable. Modified: branches/soc-2006-msnp13/src/protocols/msn/msn-utils.h =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/msn-utils.h 2006-08-26 12:54:39 UTC (rev 17044) +++ branches/soc-2006-msnp13/src/protocols/msn/msn-utils.h 2006-08-26 13:03:11 UTC (rev 17045) @@ -24,6 +24,9 @@ #ifndef _MSN_UTILS_H_ #define _MSN_UTILS_H_ +/*encode the str to RFC2047 style*/ +char * msn_encode_mime(char *str); + /** * Generate the Random GUID */ Modified: branches/soc-2006-msnp13/src/protocols/msn/msn.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/msn.c 2006-08-26 12:54:39 UTC (rev 17044) +++ branches/soc-2006-msnp13/src/protocols/msn/msn.c 2006-08-26 13:03:11 UTC (rev 17045) @@ -893,7 +893,7 @@ gaim_debug_info("MaYuan","prepare to send offline Message\n"); session = gc->proto_data; oim = session->oim; - friendname = g_strdup_printf("=?utf-8?B?Y2xpZW50?="); + friendname = msn_encode_mime(account->username); msn_oim_prep_send_msg_info(oim, gaim_account_get_username(account),friendname,who, message); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |