1043 // |
1045 // |
1044 void CNcnNotifApiObserver::AddMailBoxL( const TMsvId& aMsvId, |
1046 void CNcnNotifApiObserver::AddMailBoxL( const TMsvId& aMsvId, |
1045 const TUid& aMtmType, |
1047 const TUid& aMtmType, |
1046 const TUid& aTechnologyType) |
1048 const TUid& aTechnologyType) |
1047 { |
1049 { |
1048 TNcnMailBoxStatus mailbox( aMsvId ); |
1050 if((aMtmType != KUidMsgTypeCmailMtmVal) && (aMtmType != KUidMsgTypeIMAP4) && (aMtmType != KUidMsgTypeSMTP) && (aMtmType != KUidMsgTypePOP3)) |
1049 |
1051 { |
1050 // if mail box is not already in status array |
1052 TNcnMailBoxStatus mailbox( aMsvId ); |
1051 if ( iMailBoxStatusArray.Find( mailbox, |
1053 |
1052 TNcnMailBoxStatus::Match ) == KErrNotFound ) |
1054 // if mail box is not already in status array |
1053 { |
1055 if ( iMailBoxStatusArray.Find( mailbox, |
1054 // set mailbox fields |
1056 TNcnMailBoxStatus::Match ) == KErrNotFound ) |
1055 mailbox.iMTMType = aMtmType; |
1057 { |
1056 mailbox.iMailBoxTechnologyType = aTechnologyType; |
1058 // set mailbox fields |
1057 |
1059 mailbox.iMTMType = aMtmType; |
1058 // set the mailboxes 'highest' values |
1060 mailbox.iMailBoxTechnologyType = aTechnologyType; |
1059 FindHighest_MsvId_ImapId_LatestTime(mailbox.iMailBox, |
1061 |
1060 mailbox.iHighestEMailMsvId , |
1062 // set the mailboxes 'highest' values |
1061 mailbox.iHighestIMAPId, |
1063 FindHighest_MsvId_ImapId_LatestTime(mailbox.iMailBox, |
1062 mailbox.iLatestMessageArrival); |
1064 mailbox.iHighestEMailMsvId , |
|
1065 mailbox.iHighestIMAPId, |
|
1066 mailbox.iLatestMessageArrival); |
1063 |
1067 |
1064 // set the rest of the values |
1068 // set the rest of the values |
1065 mailbox.iUnreadCheckpointMsvId = mailbox.iHighestEMailMsvId; |
1069 mailbox.iUnreadCheckpointMsvId = mailbox.iHighestEMailMsvId; |
1066 mailbox.iPublishedCheckpointMsvId = mailbox.iHighestEMailMsvId; |
1070 mailbox.iPublishedCheckpointMsvId = mailbox.iHighestEMailMsvId; |
1067 mailbox.iPublishedCheckpointIMAPId = mailbox.iHighestIMAPId; |
1071 mailbox.iPublishedCheckpointIMAPId = mailbox.iHighestIMAPId; |
1068 mailbox.iPublishedCheckpointTimeStamp = mailbox.iLatestMessageArrival; |
1072 mailbox.iPublishedCheckpointTimeStamp = mailbox.iLatestMessageArrival; |
1069 mailbox.iPublishedNewEmailCount = 0; |
1073 mailbox.iPublishedNewEmailCount = 0; |
1070 mailbox.iShowIcon = ETrue; |
1074 mailbox.iShowIcon = ETrue; |
1071 //In case the mailbox is IMAP/POP/SyncMl update the notifcation |
1075 //In case the mailbox is IMAP/POP/SyncMl update the notifcation |
1072 //parameters. 3rd party box's will give these in API |
1076 //parameters. 3rd party box's will give these in API |
1073 if( mailbox.iMTMType.iUid == KSenduiMtmImap4UidValue || |
1077 if( mailbox.iMTMType.iUid == KSenduiMtmImap4UidValue || |
1074 mailbox.iMTMType.iUid == KSenduiMtmPop3UidValue || |
1078 mailbox.iMTMType.iUid == KSenduiMtmPop3UidValue || |
1075 mailbox.iMTMType.iUid == KSenduiMtmSyncMLEmailUidValue ) |
1079 mailbox.iMTMType.iUid == KSenduiMtmSyncMLEmailUidValue ) |
1076 { |
1080 { |
1077 //This should work, but just in case it does not |
1081 //This should work, but just in case it does not |
1078 //use default parameters |
1082 //use default parameters |
1079 TRAP_IGNORE(UpdateS60MailBoxNotificationAttributesL(mailbox)); |
1083 TRAP_IGNORE(UpdateS60MailBoxNotificationAttributesL(mailbox)); |
1080 } |
1084 } |
1081 |
1085 |
1082 // and finally append mailbox status |
1086 // and finally append mailbox status |
1083 iMailBoxStatusArray.AppendL( mailbox ); |
1087 iMailBoxStatusArray.AppendL( mailbox ); |
|
1088 } |
1084 } |
1089 } |
1085 } |
1090 } |
1086 |
1091 |
1087 // --------------------------------------------------------- |
1092 // --------------------------------------------------------- |
1088 // CNcnNotifApiObserver::RemoveMailBoxL |
1093 // CNcnNotifApiObserver::RemoveMailBoxL |