comparison libpurple/protocols/msn/contact.c @ 20773:dcb28d9939ee

Keep MsnUser->list_op in sync. Silence compiler warnings about unused vars.
author Carlos Silva <typ0@pidgin.im>
date Thu, 04 Oct 2007 02:34:10 +0000
parents 8e53c75bb87c
children d1e8f4d63f01
comparison
equal deleted inserted replaced
20772:8e53c75bb87c 20773:dcb28d9939ee
1104 } else { 1104 } else {
1105 purple_debug_info("MSNCL","Contact %s added to group %s successfully on server, but failed in the local list\n", state->who, state->new_group_name); 1105 purple_debug_info("MSNCL","Contact %s added to group %s successfully on server, but failed in the local list\n", state->who, state->new_group_name);
1106 } 1106 }
1107 1107
1108 if (state->action & MSN_ADD_BUDDY) { 1108 if (state->action & MSN_ADD_BUDDY) {
1109 MsnUser *user = msn_userlist_find_user(userlist, state->who);
1110 1109
1111 if ( !msn_user_is_yahoo(soapconn->session->account, state->who) ) { 1110 if ( !msn_user_is_yahoo(soapconn->session->account, state->who) ) {
1112 1111
1113 msn_userlist_add_buddy_to_list(userlist, state->who, MSN_LIST_AL); 1112 msn_userlist_add_buddy_to_list(userlist, state->who, MSN_LIST_AL);
1114 msn_userlist_add_buddy_to_list(userlist, state->who, MSN_LIST_FL); 1113 msn_userlist_add_buddy_to_list(userlist, state->who, MSN_LIST_FL);
1424 MsnCallbackState *state = NULL; 1423 MsnCallbackState *state = NULL;
1425 1424
1426 g_return_val_if_fail(soapconn->data_cb != NULL, TRUE); 1425 g_return_val_if_fail(soapconn->data_cb != NULL, TRUE);
1427 g_return_val_if_fail(soapconn->session != NULL, FALSE); 1426 g_return_val_if_fail(soapconn->session != NULL, FALSE);
1428 g_return_val_if_fail(soapconn->session->contact != NULL, FALSE); 1427 g_return_val_if_fail(soapconn->session->contact != NULL, FALSE);
1428 g_return_val_if_fail(soapconn->session->userlist != NULL, FALSE);
1429 1429
1430 state = (MsnCallbackState *) soapconn->data_cb; 1430 state = (MsnCallbackState *) soapconn->data_cb;
1431 1431
1432 if (soapconn->body == NULL) { 1432 if (soapconn->body == NULL) {
1433 msn_callback_state_free(state); 1433 msn_callback_state_free(state);
1435 } 1435 }
1436 1436
1437 purple_debug_info("MSN CL", "Contact %s deleted successfully from %s list on server!\n", state->who, MsnMemberRole[state->list_id]); 1437 purple_debug_info("MSN CL", "Contact %s deleted successfully from %s list on server!\n", state->who, MsnMemberRole[state->list_id]);
1438 1438
1439 if (state->list_id == MSN_LIST_PL) { 1439 if (state->list_id == MSN_LIST_PL) {
1440 MsnUser *user = msn_userlist_find_user(soapconn->session->userlist, state->who);
1441
1442 if (user != NULL)
1443 msn_user_unset_op(user, MSN_LIST_PL_OP);
1444
1440 msn_add_contact_to_list(soapconn->session->contact, state, state->who, MSN_LIST_RL); 1445 msn_add_contact_to_list(soapconn->session->contact, state, state->who, MSN_LIST_RL);
1441 return TRUE; 1446 return TRUE;
1442 } 1447 }
1443 1448
1444 if (state->list_id == MSN_LIST_AL) { 1449 if (state->list_id == MSN_LIST_AL) {
1528 msn_add_contact_to_list_read_cb(MsnSoapConn *soapconn) 1533 msn_add_contact_to_list_read_cb(MsnSoapConn *soapconn)
1529 { 1534 {
1530 MsnCallbackState *state = NULL; 1535 MsnCallbackState *state = NULL;
1531 1536
1532 g_return_val_if_fail(soapconn->data_cb != NULL, TRUE); 1537 g_return_val_if_fail(soapconn->data_cb != NULL, TRUE);
1538 g_return_val_if_fail(soapconn->session != NULL, FALSE);
1539 g_return_val_if_fail(soapconn->session->userlist != NULL, FALSE);
1533 1540
1534 state = (MsnCallbackState *) soapconn->data_cb; 1541 state = (MsnCallbackState *) soapconn->data_cb;
1535 1542
1536 if (soapconn->body == NULL) { 1543 if (soapconn->body == NULL) {
1537 msn_callback_state_free(state); 1544 msn_callback_state_free(state);
1538 return TRUE; 1545 return TRUE;
1539 } 1546 }
1540 1547
1541 purple_debug_info("MSN CL", "Contact %s added successfully to %s list on server!\n", state->who, MsnMemberRole[state->list_id]); 1548 purple_debug_info("MSN CL", "Contact %s added successfully to %s list on server!\n", state->who, MsnMemberRole[state->list_id]);
1542 1549
1543 if (state->list_id == MSN_LIST_RL && (state->action & MSN_DENIED_BUDDY) ) { 1550 if (state->list_id == MSN_LIST_RL) {
1544 g_return_val_if_fail(soapconn->session != NULL, FALSE); 1551 MsnUser *user = msn_userlist_find_user(soapconn->session->userlist, state->who);
1545 g_return_val_if_fail(soapconn->session->contact != NULL, FALSE); 1552
1546 1553 if (user != NULL) {
1547 msn_add_contact_to_list(soapconn->session->contact, NULL, state->who, MSN_LIST_BL); 1554 msn_user_set_op(user, MSN_LIST_RL_OP);
1548 return TRUE; 1555 }
1556
1557 if (state->action & MSN_DENIED_BUDDY) {
1558 g_return_val_if_fail(soapconn->session->contact != NULL, FALSE);
1559
1560 msn_add_contact_to_list(soapconn->session->contact, NULL, state->who, MSN_LIST_BL);
1561 return TRUE;
1562 }
1549 } 1563 }
1550 1564
1551 if (state->list_id == MSN_LIST_AL) { 1565 if (state->list_id == MSN_LIST_AL) {
1552 purple_privacy_permit_add(soapconn->session->account, state->who, TRUE); 1566 purple_privacy_permit_add(soapconn->session->account, state->who, TRUE);
1553 } else if (state->list_id == MSN_LIST_BL) { 1567 } else if (state->list_id == MSN_LIST_BL) {