- Timestamp:
- 07/09/07 10:02:18 (2 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
Mulberry/branches/v4.1d1/Sources_Common/Application/Preferences/CIdentity.cp
r54 r86 23 23 24 24 #include "char_stream.h" 25 #include "CCalendarAddress.h" 25 26 #include "CCalendarStoreNode.h" 26 27 #include "CMbox.h" … … 48 49 mReplyTo.second = false; 49 50 mSender.second = false; 51 mCalendar.second = false; 50 52 mCopyTo.second = false; 51 53 mCopyToNone = false; … … 77 79 mReplyTo = copy.mReplyTo; 78 80 mSender = copy.mSender; 81 mCalendar = copy.mCalendar; 79 82 mCopyTo = copy.mCopyTo; 80 83 mCopyToNone = copy.mCopyToNone; … … 111 114 (mFrom == test.mFrom) && 112 115 (mReplyTo == test.mReplyTo) && 113 (mSender== test.mSender) && 116 (mSender == test.mSender) && 117 (mCalendar == test.mCalendar) && 114 118 (mCopyTo == test.mCopyTo) && 115 119 (mCopyToNone == test.mCopyToNone) && … … 388 392 } 389 393 394 if (::VersionTest(vers_prefs, VERS_4_1_0_A_1) >= 0) 395 { 396 MakePair(txt, mCalendar); 397 } 398 390 399 // Expansion items: 391 400 … … 487 496 item.ConvertFromOS(); 488 497 all += item; 498 499 AddPair(all, mCalendar); 500 all += cSpace; 489 501 490 502 all += mFuture.GetInfo(); … … 602 614 else 603 615 return mSender.first; 616 } 617 618 const cdstring& CIdentity::GetCalendar(bool resolve) const 619 { 620 if (resolve) 621 return GetInheritedValue(&CIdentity::GetCalendar, &CIdentity::UseCalendar); 622 else 623 return mCalendar.first; 624 } 625 626 cdstring CIdentity::GetCalendarAddress() const 627 { 628 cdstring result = GetCalendar(true); 629 if (!result.empty()) 630 return result; 631 result = GetFrom(true); 632 if (!result.empty()) 633 { 634 CAddress addr(result); 635 result = addr.GetName(); 636 if (!result.empty()) 637 result += " "; 638 result += "<"; 639 result += addr.GetMailAddress(); 640 result += ">"; 641 } 642 return result; 604 643 } 605 644 … … 872 911 873 912 return NULL; 913 } 914 915 CIdentity* CIdentityList::GetIdentity(const CCalendarAddress& caladdr) const 916 { 917 // Match the Calendar address first 918 const cdstring& comp = caladdr.GetAddress(); 919 for(const_iterator iter = begin(); iter != end(); iter++) 920 { 921 cdstring test((*iter).GetCalendar(true)); 922 CCalendarAddress testc(test); 923 if (testc.GetAddress().compare(comp, true) == 0) 924 return const_cast<CIdentity*>(&(*iter)); 925 } 926 927 // If calendar address is mailto, try to match a From address 928 if (comp.compare_start(cMailtoURLScheme)) 929 { 930 cdstring temp(comp, ::strlen(cMailtoURLScheme)); 931 CAddress addr(temp, caladdr.GetName()); 932 return GetIdentity(addr); 933 } 934 return NULL; 874 935 } 875 936