- Timestamp:
- 07/09/07 10:02:18 (2 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
Mulberry/branches/v4.1d1/Sources_Common/Mail/INET_Clients/IMSP/CIMSPClient.cp
r19 r86 21 21 22 22 #include "CAdbkACL.h" 23 #include "CAddressBook.h" 23 24 #include "CCharSpecials.h" 24 25 #include "CGeneralException.h" … … 27 28 #include "CINETCommon.h" 28 29 #include "CMailControl.h" 29 #include "CRemoteAddressBook.h"30 30 #include "CRFC822.h" 31 31 #include "CStatusWindow.h" 32 32 #include "CStringUtils.h" 33 34 #include "CVCardMapper.h" 35 36 #include "CVCardAddressBook.h" 37 #include "CVCardVCard.h" 33 38 34 39 #if __dest_os == __mac_os || __dest_os == __mac_os_x … … 217 222 mAuthAnonAllowed = mLastResponse.CheckUntagged(cIMAP_AUTHANON, true); 218 223 mSTARTTLSAllowed = mLastResponse.CheckUntagged(cSTARTTLS, true); 224 225 // IMSP always has ACLs 226 GetAdbkOwner()->SetHasACL(true); 219 227 } 220 228 … … 381 389 // Operations on address books 382 390 383 // Find all adbks below this path 384 void CIMSPClient::_FindAllAdbks(const cdstring& path) 391 void CIMSPClient::_ListAddressBooks(CAddressBook* root) 385 392 { 386 393 // Must add wildcard and quote value 387 cdstring qvalue = path;394 cdstring qvalue = (root->IsProtocol() ? cdstring::null_str : root->GetName()); 388 395 qvalue += cWILDCARD; 389 396 … … 396 403 } 397 404 405 // Find all adbks below this path 406 void CIMSPClient::_FindAllAdbks(const cdstring& path) 407 { 408 // Must add wildcard and quote value 409 cdstring qvalue = path; 410 qvalue += cWILDCARD; 411 412 // Send ADDRESSBOOK message to server 413 INETStartSend("Status::IMSP::AddressBooks", "Error::IMSP::OSErrAddressBooks", "Error::IMSP::NoBadAddressBooks"); 414 INETSendString(cADDRESSBOOK); 415 INETSendString(cSpace); 416 INETSendString(qvalue, eQueueProcess); 417 INETFinishSend(); 418 } 419 398 420 // Create adbk 399 421 void CIMSPClient::_CreateAdbk(const CAddressBook* adbk) … … 405 427 INETSendString(adbk->GetName(), eQueueProcess); 406 428 INETFinishSend(); 429 } 430 431 bool CIMSPClient::_AdbkChanged(const CAddressBook* adbk) 432 { 433 // No way to tell if there have been changes on the server, so return true to force entire sync 434 return true; 407 435 } 408 436 … … 431 459 } 432 460 461 void CIMSPClient::_SizeAdbk(CAddressBook* adbk) 462 { 463 // Does nothing 464 } 465 433 466 // Operations with addresses 467 468 // Find all addresses in adbk 469 void CIMSPClient::_ReadFullAddressBook(CAddressBook* adbk) 470 { 471 _FindAllAddresses(adbk); 472 } 473 474 // Write all addresses in adbk 475 void CIMSPClient::_WriteFullAddressBook(CAddressBook* adbk) 476 { 477 478 } 434 479 435 480 // Find all addresses in adbk … … 615 660 } 616 661 662 // Calendar 663 temp = addr->GetCalendar(); 664 temp.ConvertFromOS(); 665 if (!temp.empty()) 666 { 667 INETSendString(cSpace); 668 INETSendString(cADDRESS_CALENDAR); 669 INETSendString(cSpace); 670 INETSendString(temp, eQueueProcess); 671 } 672 617 673 // Company 618 674 temp = addr->GetCompany(); … … 1369 1425 } 1370 1426 1371 if (noselect)1372 {1373 // Add name only to list1374 cdstring* hier_name = new cdstring(adbk_name);1375 GetAdbkOwner()->GetAdbkList()->push_back(hier_name, noinferiors);1376 }1377 else1378 {1379 1427 // Add adress book to list 1380 CRemoteAddressBook* adbk = new CRemoteAddressBook(GetAdbkOwner(), adbk_name); 1381 GetAdbkOwner()->GetAdbkList()->push_back(adbk, noinferiors); 1382 } 1428 CAddressBook* adbk = new CAddressBook(GetAdbkOwner(), GetAdbkOwner()->GetStoreRoot(), !noselect, !noinferiors, adbk_name); 1429 GetAdbkOwner()->GetStoreRoot()->AddChildHierarchy(adbk); 1383 1430 delete adbk_name; 1384 1431 … … 1416 1463 char* email = NULL; 1417 1464 char* members = NULL; 1465 char* calendar = NULL; 1418 1466 char* company = NULL; 1419 1467 char* address = NULL; … … 1437 1485 eCodeEmail, 1438 1486 eCodeMembers, 1487 eCodeCalendar, 1439 1488 eCodeCompany, 1440 1489 eCodeAddress, … … 1458 1507 else if (::strcmpnocase(p, cADDRESS_MEMBERS) == 0) 1459 1508 code = eCodeMembers; 1509 else if (::strcmpnocase(p, cADDRESS_CALENDAR) == 0) 1510 code = eCodeCalendar; 1460 1511 else if (::strcmpnocase(p, cADDRESS_COMPANY) == 0) 1461 1512 code = eCodeCompany; … … 1494 1545 else if (code == eCodeMembers) 1495 1546 members = value; 1547 else if (code == eCodeCalendar) 1548 calendar = value; 1496 1549 else if (code == eCodeCompany) 1497 1550 company = value; … … 1588 1641 1589 1642 // Create address and add to address book or search list 1590 CAdbkAddress* addr = new CAdbkAddress(name, email, name, alias, c ompany, temp_addr, phone_work, phone_home, fax, urls, notes);1643 CAdbkAddress* addr = new CAdbkAddress(name, email, name, alias, calendar, company, temp_addr, phone_work, phone_home, fax, urls, notes); 1591 1644 if (mSearchMode) 1592 1645 mSearchResults->push_back(addr); 1593 1646 else if (mActionAdbk) 1647 { 1594 1648 mActionAdbk->GetAddressList()->push_back(addr); 1649 if (mActionAdbk->GetVCardAdbk() != NULL) 1650 mActionAdbk->GetVCardAdbk()->AddCard(vcardstore::GenerateVCard(mActionAdbk->GetVCardAdbk()->GetRef(), addr)); 1651 } 1595 1652 } 1596 1653