Mercurial > pidgin.yaz
changeset 23300:5cdd93dac7a2
Delete trailing whitespace
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Fri, 06 Jun 2008 22:46:04 +0000 |
parents | b2f91d7d3427 |
children | deb5edab9fc9 |
files | libpurple/protocols/msn/contact.c libpurple/protocols/msn/contact.h libpurple/protocols/msn/dialog.c libpurple/protocols/msn/error.c libpurple/protocols/msn/msn.c libpurple/protocols/msn/msnutils.c libpurple/protocols/msn/notification.c libpurple/protocols/msn/notification.h libpurple/protocols/msn/object.c libpurple/protocols/msn/oim.c libpurple/protocols/msn/servconn.c libpurple/protocols/msn/slp.c libpurple/protocols/msn/soap.c libpurple/protocols/msn/soap.h libpurple/protocols/msn/state.c libpurple/protocols/msn/user.c libpurple/protocols/msn/user.h libpurple/protocols/msn/userlist.c libpurple/protocols/msn/userlist.h |
diffstat | 19 files changed, 172 insertions(+), 172 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/msn/contact.c Fri Jun 06 22:35:27 2008 +0000 +++ b/libpurple/protocols/msn/contact.c Fri Jun 06 22:46:04 2008 +0000 @@ -1,5 +1,5 @@ /** - * @file contact.c + * @file contact.c * get MSN contacts via SOAP request * created by MaYuan<mayuan2006@gmail.com> * @@ -80,7 +80,7 @@ state->session = session; return state; -} +} void msn_callback_state_free(MsnCallbackState *state) @@ -217,7 +217,7 @@ g_return_if_fail(contact->session != NULL); g_return_if_fail(contact->session->user != NULL); g_return_if_fail(contact->session->user->passport != NULL); - + purple_debug_info("msnab","Creating an Address Book.\n"); body = g_strdup_printf(MSN_ADD_ADDRESSBOOK_TEMPLATE, contact->session->user->passport); @@ -247,7 +247,7 @@ user->membership_id[list] = atoi(member_id); } - msn_got_lst_user(session, user, 1 << list, NULL); + msn_got_lst_user(session, user, 1 << list, NULL); g_free(passport); g_free(type); @@ -269,7 +269,7 @@ char *lastchange_str = xmlnode_get_data(lastchange); xmlnode *membership; - purple_debug_info("msncl","last change: %s\n", lastchange_str); + purple_debug_info("msncl","last change: %s\n", lastchange_str); purple_account_set_string(session->account, "CLLastChange", lastchange_str); @@ -480,7 +480,7 @@ if (phone_type && !strcmp(phone_type, "ContactPhoneMobile")) { xmlnode *number; - + if ((number = xmlnode_get_child(contact_phone, "number"))) { xmlnode *messenger_enabled; char *is_messenger_enabled = NULL; @@ -489,8 +489,8 @@ mobile_number = xmlnode_get_data(number); if (mobile_number && - (messenger_enabled = xmlnode_get_child(contact_phone, "isMessengerEnabled")) - && (is_messenger_enabled = xmlnode_get_data(messenger_enabled)) + (messenger_enabled = xmlnode_get_child(contact_phone, "isMessengerEnabled")) + && (is_messenger_enabled = xmlnode_get_data(messenger_enabled)) && !strcmp(is_messenger_enabled, "true")) mobile = TRUE; @@ -679,7 +679,7 @@ gchar *errorcode = xmlnode_get_data(faultnode); purple_debug_info("MSNAB", "Error Code: %s\n", errorcode); - + if (g_str_equal(errorcode, "ABDoesNotExist")) { g_free(errorcode); return TRUE; @@ -823,7 +823,7 @@ if (resp != NULL) { MsnUserList *userlist = session->userlist; MsnUser *user; - + purple_debug_info("MSNCL","Contact added successfully\n"); // the code this block is replacing didn't send ADL for yahoo contacts, @@ -921,7 +921,7 @@ } void -msn_add_contact_to_group(MsnContact *contact, MsnCallbackState *state, +msn_add_contact_to_group(MsnContact *contact, MsnCallbackState *state, const char *passport, const char *groupId) { MsnUserList *userlist; @@ -934,11 +934,11 @@ g_return_if_fail(contact != NULL); g_return_if_fail(contact->session != NULL); g_return_if_fail(contact->session->userlist != NULL); - + userlist = contact->session->userlist; if (!strcmp(groupId, MSN_INDIVIDUALS_GROUP_ID) || !strcmp(groupId, MSN_NON_IM_GROUP_ID)) { - + user = msn_userlist_find_add_user(userlist, passport, passport); if (state->action & MSN_ADD_BUDDY) { @@ -956,13 +956,13 @@ return; } - purple_debug_info("MSNCL", "Adding user %s to group %s\n", passport, + purple_debug_info("MSNCL", "Adding user %s to group %s\n", passport, msn_userlist_find_group_name(userlist, groupId)); user = msn_userlist_find_user(userlist, passport); if (user == NULL) { purple_debug_warning("MSNCL", "Unable to retrieve user %s from the userlist!\n", passport); - msn_callback_state_free(state); + msn_callback_state_free(state); return; /* guess this never happened! */ } @@ -1007,7 +1007,7 @@ /*delete a Contact*/ void msn_delete_contact(MsnContact *contact, const char *contactId) -{ +{ gchar *body = NULL; gchar *contact_id_xml = NULL ; MsnCallbackState *state; @@ -1045,7 +1045,7 @@ purple_debug_info("MSNCL", "Contact %s deleted successfully from group %s in the server, but failed in the local list\n", state->who, state->old_group_name); } } - + msn_callback_state_free(state); } @@ -1057,15 +1057,15 @@ MsnCallbackState *state; gchar *body, *contact_id_xml; const gchar *groupId; - + g_return_if_fail(passport != NULL); g_return_if_fail(group_name != NULL); g_return_if_fail(contact != NULL); g_return_if_fail(contact->session != NULL); g_return_if_fail(contact->session->userlist != NULL); - + userlist = contact->session->userlist; - + groupId = msn_userlist_find_group_id(userlist, group_name); if (groupId != NULL) { purple_debug_info("MSNCL", "Deleting user %s from group %s\n", passport, group_name); @@ -1073,9 +1073,9 @@ purple_debug_warning("MSNCL", "Unable to retrieve group id from group %s !\n", group_name); return; } - + user = msn_userlist_find_user(userlist, passport); - + if (user == NULL) { purple_debug_warning("MSNCL", "Unable to retrieve user from passport %s!\n", passport); return; @@ -1099,7 +1099,7 @@ xmlnode_from_str(body, -1)), MSN_CONTACT_SERVER, MSN_ADDRESS_BOOK_POST_URL, msn_del_contact_from_group_read_cb, state); - + g_free(contact_id_xml); g_free(body); } @@ -1198,7 +1198,7 @@ } else { /* list == MSN_LIST_AL || list == MSN_LIST_BL */ partner_scenario = MSN_PS_BLOCK_UNBLOCK; - + member = g_strdup_printf(MSN_MEMBER_PASSPORT_XML, passport); } @@ -1226,13 +1226,13 @@ g_return_if_fail(state != NULL); g_return_if_fail(state->session != NULL); g_return_if_fail(state->session->contact != NULL); - + if (resp != NULL) { purple_debug_info("MSN CL", "Contact %s added successfully to %s list on server!\n", state->who, MsnMemberRole[state->list_id]); if (state->list_id == MSN_LIST_RL) { MsnUser *user = msn_userlist_find_user(state->session->userlist, state->who); - + if (user != NULL) { msn_user_set_op(user, MSN_LIST_RL_OP); } @@ -1274,9 +1274,9 @@ member = g_strdup_printf(MSN_MEMBER_PASSPORT_XML, state->who); - body = g_strdup_printf(MSN_CONTACT_ADD_TO_LIST_TEMPLATE, + body = g_strdup_printf(MSN_CONTACT_ADD_TO_LIST_TEMPLATE, MsnSoapPartnerScenarioText[partner_scenario], - MsnMemberRole[list], + MsnMemberRole[list], member); msn_soap_message_send(contact->session, @@ -1323,9 +1323,9 @@ msn_group_read_cb(MsnSoapMessage *req, MsnSoapMessage *resp, gpointer data) { MsnCallbackState *state = data; - + purple_debug_info("MSNCL", "Group request successful.\n"); - + g_return_if_fail(state->session != NULL); g_return_if_fail(state->session->userlist != NULL); g_return_if_fail(state->session->contact != NULL); @@ -1338,13 +1338,13 @@ if (state) { MsnSession *session = state->session; MsnUserList *userlist = session->userlist; - + if (state->action & MSN_RENAME_GROUP) { msn_userlist_rename_group_id(session->userlist, state->guid, state->new_group_name); } - + if (state->action & MSN_ADD_GROUP) { /* the response is taken from http://telepathy.freedesktop.org/wiki/Pymsn/MSNP/ContactListActions @@ -1364,7 +1364,7 @@ state->who, state->new_group_name); } else if (state->action & MSN_MOVE_BUDDY) { - msn_add_contact_to_group(session->contact, state, state->who, guid); + msn_add_contact_to_group(session->contact, state, state->who, guid); g_free(guid); return; } @@ -1374,16 +1374,16 @@ state->new_group_name); } } - + if (state->action & MSN_DEL_GROUP) { GList *l; - + msn_userlist_remove_group_id(session->userlist, state->guid); for (l = userlist->users; l != NULL; l = l->next) { msn_user_remove_group_id( (MsnUser *)l->data, state->guid); } } - + msn_callback_state_free(state); } } @@ -1396,7 +1396,7 @@ g_return_if_fail(session != NULL); g_return_if_fail(group_name != NULL); - + purple_debug_info("MSNCL","Adding group %s to contact list.\n", group_name); if (state == NULL) { @@ -1429,13 +1429,13 @@ const gchar *guid; g_return_if_fail(session != NULL); - + g_return_if_fail(group_name != NULL); purple_debug_info("MSNCL","Deleting group %s from contact list\n", group_name); - + guid = msn_userlist_find_group_id(session->userlist, group_name); - - /* if group uid we need to del is NULL, + + /* if group uid we need to del is NULL, * we need to delete nothing */ if (guid == NULL) { @@ -1451,7 +1451,7 @@ state = msn_callback_state_new(session); msn_callback_state_set_action(state, MSN_DEL_GROUP); msn_callback_state_set_guid(state, guid); - + body = g_strdup_printf(MSN_GROUP_DEL_TEMPLATE, guid); msn_soap_message_send(session, @@ -1470,14 +1470,14 @@ gchar *body = NULL; const gchar * guid; MsnCallbackState *state; - + g_return_if_fail(session != NULL); g_return_if_fail(session->userlist != NULL); g_return_if_fail(old_group_name != NULL); g_return_if_fail(new_group_name != NULL); - + purple_debug_info("MSN CL", "Renaming group %s to %s.\n", old_group_name, new_group_name); - + guid = msn_userlist_find_group_id(session->userlist, old_group_name); if (guid == NULL) return; @@ -1492,10 +1492,10 @@ } msn_callback_state_set_action(state, MSN_RENAME_GROUP); - + body = g_markup_printf_escaped(MSN_GROUP_RENAME_TEMPLATE, guid, new_group_name); - + msn_soap_message_send(session, msn_soap_message_new(MSN_GROUP_RENAME_SOAP_ACTION, xmlnode_from_str(body, -1)),
--- a/libpurple/protocols/msn/contact.h Fri Jun 06 22:35:27 2008 +0000 +++ b/libpurple/protocols/msn/contact.h Fri Jun 06 22:46:04 2008 +0000 @@ -349,7 +349,7 @@ #define MSN_GROUP_RENAME_SOAP_ACTION "http://www.msn.com/webservices/AddressBook/ABGroupUpdate" #define MSN_GROUP_RENAME_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\"><soap:Header><ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\"><ApplicationId>09607671-1C32-421F-A6A6-CBFAA51AB5F4</ApplicationId><IsMigration>false</IsMigration><PartnerScenario>Timer</PartnerScenario></ABApplicationHeader><ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\"><ManagedGroupRequest>false</ManagedGroupRequest></ABAuthHeader></soap:Header><soap:Body><ABGroupUpdate xmlns=\"http://www.msn.com/webservices/AddressBook\"><abId>00000000-0000-0000-0000-000000000000</abId><groups><Group><groupId>%s</groupId><groupInfo><name>%s</name></groupInfo><propertiesChanged>GroupName </propertiesChanged></Group></groups></ABGroupUpdate></soap:Body></soap:Envelope>" -typedef enum +typedef enum { MSN_ADD_BUDDY = 0x01, MSN_MOVE_BUDDY = 0x02, @@ -383,7 +383,7 @@ MsnSession *session; }; -typedef enum +typedef enum { MSN_PS_INITIAL, MSN_PS_SAVE_CONTACT, @@ -404,34 +404,34 @@ void msn_callback_state_set_uid(MsnCallbackState *state, const gchar *uid); void msn_callback_state_set_old_group_name(MsnCallbackState *state, const gchar *old_group_name); -void msn_callback_state_set_new_group_name(MsnCallbackState *state, +void msn_callback_state_set_new_group_name(MsnCallbackState *state, const gchar *new_group_name); void msn_callback_state_set_guid(MsnCallbackState *state, const gchar *guid); void msn_callback_state_set_list_id(MsnCallbackState *state, MsnListId list_id); -void msn_callback_state_set_action(MsnCallbackState *state, +void msn_callback_state_set_action(MsnCallbackState *state, MsnCallbackAction action); void msn_contact_connect(MsnContact *contact); -void msn_get_contact_list(MsnContact * contact, +void msn_get_contact_list(MsnContact * contact, const MsnSoapPartnerScenario partner_scenario, const char *update); -void msn_get_address_book(MsnContact *contact, +void msn_get_address_book(MsnContact *contact, const MsnSoapPartnerScenario partner_scenario, const char * update, const char * gupdate); /* contact SOAP operations */ void msn_update_contact(MsnContact *contact, const char* nickname); -void msn_add_contact(MsnContact *contact, MsnCallbackState *state, +void msn_add_contact(MsnContact *contact, MsnCallbackState *state, const char *passport); void msn_delete_contact(MsnContact *contact, const char *contactId); -void msn_add_contact_to_group(MsnContact *contact, MsnCallbackState *state, +void msn_add_contact_to_group(MsnContact *contact, MsnCallbackState *state, const char *passport, const char *groupId); -void msn_del_contact_from_group(MsnContact *contact, const char *passport, +void msn_del_contact_from_group(MsnContact *contact, const char *passport, const char *group_name); /* group operations */ -void msn_add_group(MsnSession *session, MsnCallbackState *state, +void msn_add_group(MsnSession *session, MsnCallbackState *state, const char* group_name); void msn_del_group(MsnSession *session, const gchar *group_name); void msn_contact_rename_group(MsnSession *session, const char *old_group_name,
--- a/libpurple/protocols/msn/dialog.c Fri Jun 06 22:35:27 2008 +0000 +++ b/libpurple/protocols/msn/dialog.c Fri Jun 06 22:46:04 2008 +0000 @@ -135,7 +135,7 @@ passport); } - purple_request_action(gc, NULL, msg, reason, PURPLE_DEFAULT_ACTION_NONE, + purple_request_action(gc, NULL, msg, reason, PURPLE_DEFAULT_ACTION_NONE, purple_connection_get_account(gc), data->who, NULL, data, 2, _("Yes"), G_CALLBACK(msn_add_cb),
--- a/libpurple/protocols/msn/error.c Fri Jun 06 22:35:27 2008 +0000 +++ b/libpurple/protocols/msn/error.c Fri Jun 06 22:46:04 2008 +0000 @@ -259,7 +259,7 @@ { char buf[MSN_BUF_LEN]; gboolean debug; - + g_snprintf(buf, sizeof(buf), _("MSN Error: %s\n"), msn_error_get_text(type, &debug)); if (debug)
--- a/libpurple/protocols/msn/msn.c Fri Jun 06 22:35:27 2008 +0000 +++ b/libpurple/protocols/msn/msn.c Fri Jun 06 22:46:04 2008 +0000 @@ -1594,10 +1594,10 @@ MsnSession *session; session = gc->proto_data; - + g_return_if_fail(session != NULL); g_return_if_fail(session->userlist != NULL); - + if (msn_userlist_find_group_with_name(session->userlist, old_name) != NULL) { msn_contact_rename_group(session, old_name, group->name); @@ -1677,7 +1677,7 @@ purple_debug_info("MSN", "This group can't be removed, returning.\n"); return ; } - + msn_del_group(session, group->name); }
--- a/libpurple/protocols/msn/msnutils.c Fri Jun 06 22:35:27 2008 +0000 +++ b/libpurple/protocols/msn/msnutils.c Fri Jun 06 22:46:04 2008 +0000 @@ -169,7 +169,7 @@ gchar *base64, *retval; g_return_val_if_fail(str != NULL, NULL); - + base64 = purple_base64_encode((guchar *)str, strlen(str)); retval = g_strdup_printf("=?utf-8?B?%s?=", base64); g_free(base64); @@ -509,7 +509,7 @@ *This algorithm reference with http://msnpiki.msnfanatic.com/index.php/MSNP11:Challenges */ #define BUFSIZE 256 -void +void msn_handle_chl(char *input, char *output) { PurpleCipher *cipher; @@ -538,7 +538,7 @@ /* Split it into four integers */ md5Parts = (unsigned int *)md5Hash; - for(i=0; i<4; i++){ + for(i=0; i<4; i++){ /* adjust endianess */ md5Parts[i] = GUINT_TO_LE(md5Parts[i]); @@ -578,7 +578,7 @@ /* adjust endianness */ for(i=0; i<4; i++) - newHashParts[i] = GUINT_TO_LE(newHashParts[i]); + newHashParts[i] = GUINT_TO_LE(newHashParts[i]); /* make a string of the parts */ newHash = (unsigned char *)newHashParts;
--- a/libpurple/protocols/msn/notification.c Fri Jun 06 22:35:27 2008 +0000 +++ b/libpurple/protocols/msn/notification.c Fri Jun 06 22:46:04 2008 +0000 @@ -336,7 +336,7 @@ } /* - * Windows Live Messenger 8.0 + * Windows Live Messenger 8.0 * Notice :CVR String discriminate! * reference of http://www.microsoft.com/globaldev/reference/oslocversion.mspx * to see the Local ID @@ -430,7 +430,7 @@ char *payload; gsize payload_len; int type; - + cmdproc = session->notification->cmdproc; g_return_if_fail(msg != NULL); payload = msn_message_gen_payload(msg, &payload_len); @@ -709,8 +709,8 @@ } display_name = purple_connection_get_display_name(session->account->gc); - if (display_name - && strcmp(display_name, + if (display_name + && strcmp(display_name, purple_account_get_username(session->account))) { msn_act_id(session->account->gc, display_name); } @@ -755,15 +755,15 @@ purple_debug_misc("MSN Notification", "Parsing received ADL XML data\n"); g_return_if_fail(payload != NULL); - + root = xmlnode_from_str(payload, (gssize) len); - + if (root == NULL) { purple_debug_info("MSN Notification", "Invalid XML!\n"); return; } for (domain_node = xmlnode_get_child(root, "d"); domain_node; domain_node = xmlnode_get_next_twin(domain_node)) { - const gchar * domain = NULL; + const gchar * domain = NULL; xmlnode *contact_node = NULL; domain = xmlnode_get_attrib(domain_node, "n"); @@ -1300,7 +1300,7 @@ type = cmd->params[1]; if (!strcmp(type, "MFN")) { friendlyname = purple_url_decode(cmd->params[2]); - + msn_update_contact(session->contact, friendlyname); purple_connection_set_display_name( @@ -1649,12 +1649,12 @@ purple_debug_error("MSN","Unable to parse GCF payload into a XML tree"); return; } - + buf = xmlnode_to_formatted_str(root, &xmllen); /* get the payload content */ purple_debug_info("MSNP14","GCF command payload:\n%.*s\n", xmllen, buf); - + g_free(buf); xmlnode_free(root); } @@ -1698,7 +1698,7 @@ passport = cmd->params[0]; user = msn_userlist_find_user(session->userlist, passport); - + psm_str = msn_get_psm(cmd->payload,len); msn_user_set_statusline(user, psm_str); g_free(psm_str); @@ -2005,7 +2005,7 @@ { case 1: minutes = atoi(g_hash_table_lookup(table, "Arg1")); - g_snprintf(buf, sizeof(buf), dngettext(PACKAGE, + g_snprintf(buf, sizeof(buf), dngettext(PACKAGE, "The MSN server will shut down for maintenance " "in %d minute. You will automatically be " "signed out at that time. Please finish any " @@ -2045,12 +2045,12 @@ adl_node = xmlnode_new("ml"); adl_node->child = NULL; - msn_add_contact_xml(notification->session, adl_node, who, list_op, + msn_add_contact_xml(notification->session, adl_node, who, list_op, MSN_USER_TYPE_PASSPORT); payload = xmlnode_to_str(adl_node,&payload_len); xmlnode_free(adl_node); - + msn_notification_post_adl(notification->servconn->cmdproc, payload,payload_len); g_free(payload); @@ -2155,11 +2155,11 @@ /*initial OIM notification*/ msn_table_add_msg_type(cbs_table, "text/x-msmsgsinitialmdatanotification", - initial_mdata_msg); + initial_mdata_msg); /*OIM notification when user online*/ msn_table_add_msg_type(cbs_table, "text/x-msmsgsoimnotification", - initial_mdata_msg); + initial_mdata_msg); msn_table_add_msg_type(cbs_table, "text/x-msmsgsinitialemailnotification", initial_email_msg);
--- a/libpurple/protocols/msn/notification.h Fri Jun 06 22:35:27 2008 +0000 +++ b/libpurple/protocols/msn/notification.h Fri Jun 06 22:46:04 2008 +0000 @@ -30,7 +30,7 @@ #define MSNP13_WLM_PRODUCT_ID "PROD01065C%ZFN6F" #define MSNP10_PRODUCT_KEY "VT6PX?UQTM4WM%YR" -#define MSNP10_PRODUCT_ID "PROD0038W!61ZTF9" +#define MSNP10_PRODUCT_ID "PROD0038W!61ZTF9" typedef struct _MsnNotification MsnNotification; @@ -71,7 +71,7 @@ * Closes a notification. * * It's first closed, and then disconnected. - * + * * @param notification The notification object to close. */ void msn_notification_close(MsnNotification *notification);
--- a/libpurple/protocols/msn/object.c Fri Jun 06 22:35:27 2008 +0000 +++ b/libpurple/protocols/msn/object.c Fri Jun 06 22:46:04 2008 +0000 @@ -172,7 +172,7 @@ base64 = purple_base64_encode(digest, sizeof(digest)); msn_object_set_sha1c(msnobj, base64); g_free(base64); - + return msnobj; }
--- a/libpurple/protocols/msn/oim.c Fri Jun 06 22:35:27 2008 +0000 +++ b/libpurple/protocols/msn/oim.c Fri Jun 06 22:46:04 2008 +0000 @@ -1,5 +1,5 @@ /** - * @file oim.c + * @file oim.c * get and send MSN offline Instant Message via SOAP request * Author * MaYuan<mayuan2006@gmail.com> @@ -91,7 +91,7 @@ const char* to_member, const char *msg) { MsnOimSendReq *request; - + request = g_new0(MsnOimSendReq, 1); request->from_member = g_strdup(from_member); request->friendname = g_strdup(friendname); @@ -109,7 +109,7 @@ g_free(req->friendname); g_free(req->to_member); g_free(req->oim_msg); - + g_free(req); } @@ -121,10 +121,10 @@ msn_oim_msg_to_str(MsnOim *oim, const char *body) { char *oim_body,*oim_base64; - - purple_debug_info("MSN OIM","encode OIM Message...\n"); + + purple_debug_info("MSN OIM","encode OIM Message...\n"); oim_base64 = purple_base64_encode((const guchar *)body, strlen(body)); - purple_debug_info("MSN OIM","encoded base64 body:{%s}\n",oim_base64); + purple_debug_info("MSN OIM","encoded base64 body:{%s}\n",oim_base64); oim_body = g_strdup_printf(MSN_OIM_MSG_TEMPLATE, oim->run_id,oim->send_seq,oim_base64); g_free(oim_base64); @@ -213,7 +213,7 @@ } /*post send single message request to oim server*/ -void +void msn_oim_send_msg(MsnOim *oim) { MsnOimSendReq *oim_request; @@ -333,7 +333,7 @@ gboolean offset_positive = TRUE; int tzhrs; int tzmins; - + for (t.tm_mon = 0; months[t.tm_mon] != NULL && strcmp(months[t.tm_mon], month_str) != 0; t.tm_mon++); @@ -462,7 +462,7 @@ } } -/* parse the oim XML data +/* parse the oim XML data * and post it to the soap server to get the Offline Message * */ void
--- a/libpurple/protocols/msn/servconn.c Fri Jun 06 22:35:27 2008 +0000 +++ b/libpurple/protocols/msn/servconn.c Fri Jun 06 22:46:04 2008 +0000 @@ -396,15 +396,15 @@ if (len <= 0) { switch (errno) { - case 0: + case 0: case EBADF: case EAGAIN: return; - + default: purple_debug_error("msn", "servconn read error," "len: %d, errno: %d, error: %s\n", len, errno, g_strerror(errno)); - msn_servconn_got_error(servconn, + msn_servconn_got_error(servconn, MSN_SERVCONN_ERROR_READ); return; }
--- a/libpurple/protocols/msn/slp.c Fri Jun 06 22:35:27 2008 +0000 +++ b/libpurple/protocols/msn/slp.c Fri Jun 06 22:46:04 2008 +0000 @@ -947,15 +947,15 @@ msn_release_buddy_icon_request_timeout(gpointer data) { MsnUserList *userlist = (MsnUserList *)data; - + /* Free one window slot */ - userlist->buddy_icon_window++; - + userlist->buddy_icon_window++; + /* Clear the tag for our former request timer */ userlist->buddy_icon_request_timer = 0; - + msn_release_buddy_icon_request(userlist); - + return FALSE; } @@ -1062,7 +1062,7 @@ } /* Wait BUDDY_ICON_DELAY ms before freeing our window slot and requesting the next icon. */ - userlist->buddy_icon_request_timer = purple_timeout_add(BUDDY_ICON_DELAY, + userlist->buddy_icon_request_timer = purple_timeout_add(BUDDY_ICON_DELAY, msn_release_buddy_icon_request_timeout, userlist); }
--- a/libpurple/protocols/msn/soap.c Fri Jun 06 22:35:27 2008 +0000 +++ b/libpurple/protocols/msn/soap.c Fri Jun 06 22:46:04 2008 +0000 @@ -1,5 +1,5 @@ /** - * @file soap.c + * @file soap.c * SOAP connection related process * Author * MaYuan<mayuan2006@gmail.com> @@ -107,7 +107,7 @@ /*ssl soap error callback*/ static void msn_soap_error_cb(PurpleSslConnection *gsc, PurpleSslErrorType error, void *data) -{ +{ MsnSoapConn * soapconn = data; g_return_if_fail(data != NULL); @@ -159,7 +159,7 @@ if (*handler > 0) { purple_input_remove(*handler); *handler = 0; - } + } #ifdef MSN_SOAP_DEBUG else { purple_debug_misc("MSN SOAP", "Handler inactive, not removing\n"); @@ -250,7 +250,7 @@ { gssize len, requested_len; char temp_buf[MSN_SOAP_READ_BUFF_SIZE]; - + if ( soapconn->need_to_read == 0 || soapconn->need_to_read > MSN_SOAP_READ_BUFF_SIZE) { requested_len = MSN_SOAP_READ_BUFF_SIZE; } @@ -264,7 +264,7 @@ len = read(soapconn->fd, temp_buf, requested_len); } - + if ( len <= 0 ) { switch (errno) { @@ -298,7 +298,7 @@ soapconn->read_len + len + 1); exit(EXIT_FAILURE); } - + } #if defined(MSN_SOAP_DEBUG) @@ -312,7 +312,7 @@ } /*read the whole SOAP server response*/ -static void +static void msn_soap_read_cb(gpointer data, gint source, PurpleInputCondition cond) { MsnSoapConn *soapconn = data; @@ -331,10 +331,10 @@ session = soapconn->session; g_return_if_fail(session != NULL); - + /*read the request header*/ len = msn_soap_read(soapconn); - + if ( len < 0 ) return; @@ -342,7 +342,7 @@ return; } - if ( (strstr(soapconn->read_buf, "HTTP/1.1 302") != NULL) + if ( (strstr(soapconn->read_buf, "HTTP/1.1 302") != NULL) || ( strstr(soapconn->read_buf, "HTTP/1.1 301") != NULL ) ) { /* Redirect. */ @@ -382,14 +382,14 @@ g_free(soapconn->login_host); soapconn->login_host = g_strdup(location); - + msn_soap_close_handler( &(soapconn->input_handler) ); msn_soap_close(soapconn); if (purple_ssl_connect(session->account, soapconn->login_host, PURPLE_SSL_DEFAULT_PORT, msn_soap_connect_cb, msn_soap_error_cb, soapconn) == NULL) { - + purple_debug_error("MSN SOAP", "Unable to connect to %s !\n", soapconn->login_host); // dispatch next request msn_soap_post(soapconn, NULL); @@ -429,7 +429,7 @@ g_free(soapconn->login_host); soapconn->login_host = g_strdup(location); - + msn_soap_close_handler( &(soapconn->input_handler) ); msn_soap_close(soapconn); @@ -489,7 +489,7 @@ } } } - + } else if (strstr(soapconn->read_buf, "HTTP/1.1 503 Service Unavailable")) { @@ -539,11 +539,11 @@ #if defined(MSN_SOAP_DEBUG) && !defined(_WIN32) node = xmlnode_from_str(soapconn->body, soapconn->body_len); - + if (node != NULL) { formattedxml = xmlnode_to_formatted_str(node, NULL); http_headers = g_strndup(soapconn->read_buf, soapconn->body - soapconn->read_buf); - + purple_debug_info("MSN SOAP","Data with XML payload received from the SOAP server:\n%s%s\n", http_headers, formattedxml); g_free(http_headers); g_free(formattedxml); @@ -572,22 +572,22 @@ if ( soapconn->read_cb != NULL ) { soapconn_is_valid = soapconn->read_cb(soapconn); } - + if (!soapconn_is_valid) { return; } /* dispatch next request in queue */ msn_soap_post(soapconn, NULL); - } + } return; } -void +void msn_soap_free_read_buf(MsnSoapConn *soapconn) { g_return_if_fail(soapconn != NULL); - + if (soapconn->read_buf) { g_free(soapconn->read_buf); } @@ -626,7 +626,7 @@ } total_len = strlen(soapconn->write_buf); - /* + /* * write the content to SSL server, */ len = purple_ssl_write(soapconn->gsc, @@ -690,7 +690,7 @@ soapconn->write_buf = write_buf; soapconn->written_len = 0; soapconn->written_cb = written_cb; - + msn_soap_free_read_buf(soapconn); /*clear the read buffer first*/ @@ -748,7 +748,7 @@ { g_return_if_fail(soapconn != NULL); g_return_if_fail(soapconn->soap_queue != NULL); - + if (soapconn->step == MSN_SOAP_CONNECTED || soapconn->step == MSN_SOAP_CONNECTED_IDLE) { @@ -868,7 +868,7 @@ else purple_debug_info("MSN SOAP","Failed to parse SOAP request being sent:\n%s\n", request_str); #endif - + /*free read buffer*/ // msn_soap_free_read_buf(soapconn); /*post it to server*/
--- a/libpurple/protocols/msn/soap.h Fri Jun 06 22:35:27 2008 +0000 +++ b/libpurple/protocols/msn/soap.h Fri Jun 06 22:46:04 2008 +0000 @@ -66,7 +66,7 @@ char *soap_action; char *body; - + gpointer data_cb; MsnSoapReadCbFunction read_cb; MsnSoapWrittenCbFunction written_cb;
--- a/libpurple/protocols/msn/state.c Fri Jun 06 22:35:27 2008 +0000 +++ b/libpurple/protocols/msn/state.c Fri Jun 06 22:46:04 2008 +0000 @@ -150,7 +150,7 @@ { xmlnode *payloadNode, *currentmediaNode; char *currentmedia; - + purple_debug_info("msn","msn get CurrentMedia\n"); payloadNode = xmlnode_from_str(xml_str, len); if (!payloadNode){ @@ -176,7 +176,7 @@ { xmlnode *payloadNode, *psmNode; char *psm; - + purple_debug_info("MSNP14","msn get PSM\n"); payloadNode = xmlnode_from_str(xml_str, len); if (!payloadNode){ @@ -217,7 +217,7 @@ return ret; } -/* set the MSN's PSM info,Currently Read from the status Line +/* set the MSN's PSM info,Currently Read from the status Line * Thanks for Cris Code */ void
--- a/libpurple/protocols/msn/user.c Fri Jun 06 22:35:27 2008 +0000 +++ b/libpurple/protocols/msn/user.c Fri Jun 06 22:46:04 2008 +0000 @@ -122,7 +122,7 @@ NULL); } else { purple_prpl_got_user_status_deactive(account, user->passport, "tune"); - } + } } if (user->idle) @@ -239,7 +239,7 @@ msn_user_unset_op(MsnUser *user, int list_op) { g_return_if_fail(user != NULL); - + user->list_op &= ~list_op; }
--- a/libpurple/protocols/msn/user.h Fri Jun 06 22:35:27 2008 +0000 +++ b/libpurple/protocols/msn/user.h Fri Jun 06 22:46:04 2008 +0000 @@ -69,7 +69,7 @@ char * uid; /*< User Id */ const char *status; /**< The state of the user. */ - char *statusline; /**< The state of the user. */ + char *statusline; /**< The state of the user. */ CurrentMedia media; /**< Current media of the user. */ gboolean idle; /**< The idle state of the user. */ @@ -135,7 +135,7 @@ /** * Sets the new statusline of user. - * + * * @param user The user. * @param state The statusline string. */ @@ -143,7 +143,7 @@ /** * Sets the current media of user. - * + * * @param user The user. * @param cmedia Current media. */
--- a/libpurple/protocols/msn/userlist.c Fri Jun 06 22:35:27 2008 +0000 +++ b/libpurple/protocols/msn/userlist.c Fri Jun 06 22:46:04 2008 +0000 @@ -48,7 +48,7 @@ { MsnSession *session = pa->gc->proto_data; MsnUserList *userlist = session->userlist; - + msn_userlist_add_buddy_to_list(userlist, pa->who, MSN_LIST_AL); msn_del_contact_from_list(session->contact, NULL, pa->who, MSN_LIST_PL); @@ -127,7 +127,7 @@ if (user == NULL) return FALSE; - + list_op = 1 << list_id; if (user->list_op & list_op) @@ -237,7 +237,7 @@ if (convo) { PurpleBuddy *buddy; char *msg; - + buddy = purple_find_buddy(account, passport); msg = g_strdup_printf( _("%s has added you to his or her buddy list."), @@ -246,7 +246,7 @@ PURPLE_MESSAGE_SYSTEM, time(NULL)); g_free(msg); } - + if (!(user->list_op & (MSN_LIST_AL_OP | MSN_LIST_BL_OP))) { /* @@ -341,7 +341,7 @@ passport = msn_user_get_passport(user); store = msn_user_get_store_name(user); - + msn_user_set_op(user, list_op); if (list_op & MSN_LIST_FL_OP) @@ -407,7 +407,7 @@ userlist->session = session; userlist->buddy_icon_requests = g_queue_new(); - + /* buddy_icon_window is the number of allowed simultaneous buddy icon requests. * XXX With smarter rate limiting code, we could allow more at once... 5 was the limit set when * we weren't retrieiving any more than 5 per MSN session. */ @@ -644,12 +644,12 @@ msn_userlist_rem_buddy(MsnUserList *userlist, const char *who) { MsnUser *user = NULL; - + g_return_if_fail(userlist != NULL); g_return_if_fail(userlist->session != NULL); g_return_if_fail(userlist->session->contact != NULL); g_return_if_fail(who != NULL); - + user = msn_userlist_find_user(userlist, who); msn_userlist_rem_buddy_from_list(userlist, who, MSN_LIST_FL); @@ -669,9 +669,9 @@ MsnListOp list_op = 1 << list_id; user = msn_userlist_find_user(userlist, who); - + g_return_if_fail(user != NULL); - + if ( !msn_userlist_user_is_in_list(user, list_id)) { list = lists[list_id]; purple_debug_info("MSN Userlist", "User %s is not in list %s, not removing.\n", who, list); @@ -690,14 +690,14 @@ MsnUser *user; MsnCallbackState *state = NULL; const char *group_id = NULL, *new_group_name; - + new_group_name = group_name == NULL ? MSN_INDIVIDUALS_GROUP_NAME : group_name; - + g_return_if_fail(userlist != NULL); g_return_if_fail(userlist->session != NULL); - + purple_debug_info("MSN Userlist", "Add user: %s to group: %s\n", who, new_group_name); state = msn_callback_state_new(userlist->session); @@ -709,9 +709,9 @@ /* only notify the user about problems adding to the friends list * maybe we should do something else for other lists, but it probably * won't cause too many problems if we just ignore it */ - + char *str = g_strdup_printf(_("Unable to add \"%s\"."), who); - + purple_notify_error(NULL, NULL, str, _("The username specified is invalid.")); g_free(str); @@ -725,7 +725,7 @@ { /* Whoa, we must add that group first. */ purple_debug_info("MSN Userlist", "Adding user %s to a new group, creating group %s first\n", who, new_group_name); - + msn_callback_state_set_action(state, MSN_ADD_BUDDY); msn_add_group(userlist->session, state, new_group_name); @@ -733,9 +733,9 @@ } else { msn_callback_state_set_guid(state, group_id); } - + /* XXX: adding user here may not be correct (should add them in the - * ACK to the ADL command), but for now we need to make sure they exist + * ACK to the ADL command), but for now we need to make sure they exist * early enough that the ILN command doesn't screw us up */ user = msn_userlist_find_add_user(userlist, who, who); @@ -751,7 +751,7 @@ return; } } - + purple_debug_info("MSN Userlist", "Adding user: %s to group id: %s\n", who, group_id); msn_callback_state_set_action(state, MSN_ADD_BUDDY); @@ -762,7 +762,7 @@ } void -msn_userlist_add_buddy_to_list(MsnUserList *userlist, const char *who, +msn_userlist_add_buddy_to_list(MsnUserList *userlist, const char *who, MsnListId list_id) { MsnUser *user = NULL; @@ -770,9 +770,9 @@ MsnListOp list_op = 1 << list_id; g_return_if_fail(userlist != NULL); - + user = msn_userlist_find_add_user(userlist, who, who); - + /* First we're going to check if it's already there. */ if (msn_userlist_user_is_in_list(user, list_id)) { @@ -780,16 +780,16 @@ purple_debug_info("MSN Userlist", "User '%s' is already in list: %s\n", who, list); return; } - + //store_name = (user != NULL) ? get_store_name(user) : who; - + //purple_debug_info("MSN Userlist", "store_name = %s\n", store_name); - + /* XXX: see XXX above, this should really be done when we get the response from the server */ - + msn_user_set_op(user, list_op); - + msn_notification_add_buddy_to_list(userlist->session->notification, list_id, who); } @@ -799,7 +799,7 @@ { MsnUser *user; gchar * group_id; - + g_return_val_if_fail(userlist != NULL, FALSE); g_return_val_if_fail(group_name != NULL, FALSE); g_return_val_if_fail(who != NULL, FALSE); @@ -815,7 +815,7 @@ purple_debug_error("MSN Userlist", "User %s not found!", who); return FALSE; } - + msn_user_add_group_id(user, group_id); return TRUE; @@ -832,7 +832,7 @@ g_return_val_if_fail(userlist != NULL, FALSE); g_return_val_if_fail(group_name != NULL, FALSE); g_return_val_if_fail(who != NULL, FALSE); - + purple_debug_info("MSN Userlist","Removing buddy with passport %s from group %s\n", who, group_name); if ( (group_id = msn_userlist_find_group_id(userlist, group_name)) == NULL) { @@ -856,7 +856,7 @@ { const char *new_group_id; MsnCallbackState *state; - + g_return_if_fail(userlist != NULL); g_return_if_fail(userlist->session != NULL); g_return_if_fail(userlist->session->contact != NULL); @@ -870,11 +870,11 @@ new_group_id = msn_userlist_find_group_id(userlist, new_group_name); if (new_group_id == NULL) - { + { msn_add_group(userlist->session, state, new_group_name); return; } - + /* add the contact to the new group, and remove it from the old one in * the callback */ @@ -928,6 +928,6 @@ (char *)l->data,NULL); msn_user_set_op(user, MSN_LIST_BL_OP); } - + }
--- a/libpurple/protocols/msn/userlist.h Fri Jun 06 22:35:27 2008 +0000 +++ b/libpurple/protocols/msn/userlist.h Fri Jun 06 22:46:04 2008 +0000 @@ -94,7 +94,7 @@ void msn_userlist_remove_group_id(MsnUserList *userlist, const char *group_id); void msn_userlist_rem_buddy(MsnUserList *userlist, const char *who); -void msn_userlist_add_buddy(MsnUserList *userlist, +void msn_userlist_add_buddy(MsnUserList *userlist, const char *who, const char *group_name); void msn_userlist_move_buddy(MsnUserList *userlist, const char *who, const char *old_group_name, @@ -106,7 +106,7 @@ const char *who, const char *group_name); -void msn_userlist_add_buddy_to_list(MsnUserList *userlist, const char *who, +void msn_userlist_add_buddy_to_list(MsnUserList *userlist, const char *who, MsnListId list_id); void msn_userlist_rem_buddy_from_list(MsnUserList *userlist, const char *who, MsnListId list_id);