319 CleanupStack::PushL( smtpSet ); |
319 CleanupStack::PushL( smtpSet ); |
320 acc->LoadSmtpSettingsL( smtpAcc, *smtpSet ); |
320 acc->LoadSmtpSettingsL( smtpAcc, *smtpSet ); |
321 address = smtpSet->EmailAddress().AllocL(); |
321 address = smtpSet->EmailAddress().AllocL(); |
322 CleanupStack::PopAndDestroy( 2, acc ); |
322 CleanupStack::PopAndDestroy( 2, acc ); |
323 // </qmail> |
323 // </qmail> |
324 |
324 |
325 CleanupStack::PushL( address ); // << address |
325 CleanupStack::PushL( address ); // << address |
326 CFSMailAddress* fsAddress = CFSMailAddress::NewLC(); // << fsAddress |
326 CFSMailAddress* fsAddress = CFSMailAddress::NewLC(); // << fsAddress |
327 fsAddress->SetEmailAddress( *address ); |
327 fsAddress->SetEmailAddress( *address ); |
328 result->SetOwnMailAddressL( fsAddress ); |
328 result->SetOwnMailAddressL( fsAddress ); |
329 CleanupStack::Pop( fsAddress ); // >> fsAddress |
329 CleanupStack::Pop( fsAddress ); // >> fsAddress |
549 RArray<TFSMailMsgId>& /*aNewMessages*/, |
549 RArray<TFSMailMsgId>& /*aNewMessages*/, |
550 const TFSMailMsgId& /*aSourceFolderId*/, |
550 const TFSMailMsgId& /*aSourceFolderId*/, |
551 const TFSMailMsgId& /*aDestinationFolderId*/ ) |
551 const TFSMailMsgId& /*aDestinationFolderId*/ ) |
552 { |
552 { |
553 } |
553 } |
554 |
|
555 // ---------------------------------------------------------------------------- |
|
556 // ---------------------------------------------------------------------------- |
|
557 MDesCArray* CIpsPlgSosBasePlugin::GetMrusL( |
|
558 const TFSMailMsgId& aMailBoxId) |
|
559 { |
|
560 return iMruList->GetMruListL( aMailBoxId ); |
|
561 } |
|
562 |
|
563 // ---------------------------------------------------------------------------- |
|
564 // ---------------------------------------------------------------------------- |
|
565 void CIpsPlgSosBasePlugin::SetMrusL( |
|
566 const TFSMailMsgId& aMailBoxId, |
|
567 MDesCArray* aNewMruList ) |
|
568 { |
|
569 iMruList->SetMruListL( aMailBoxId, aNewMruList ); |
|
570 } |
|
571 |
554 |
572 // --------------------------------------------------------------------------- |
555 // --------------------------------------------------------------------------- |
573 // --------------------------------------------------------------------------- |
556 // --------------------------------------------------------------------------- |
574 void CIpsPlgSosBasePlugin::GoOnlineL( const TFSMailMsgId& aMailBoxId ) |
557 void CIpsPlgSosBasePlugin::GoOnlineL( const TFSMailMsgId& aMailBoxId ) |
575 { |
558 { |
646 || baseOp->IpsOpType() == EIpsOpTypeImap4PopulateOp ) ) |
629 || baseOp->IpsOpType() == EIpsOpTypeImap4PopulateOp ) ) |
647 { |
630 { |
648 DeleteAndRemoveOperation( i, KErrCancel ); |
631 DeleteAndRemoveOperation( i, KErrCancel ); |
649 } |
632 } |
650 } |
633 } |
651 |
634 |
652 #ifndef RD_101_EMAIL |
635 #ifndef RD_101_EMAIL |
653 RAlwaysOnlineClientSession aosession; |
636 RAlwaysOnlineClientSession aosession; |
654 err = aosession.Connect(); |
637 err = aosession.Connect(); |
655 if ( err == KErrNone ) |
638 if ( err == KErrNone ) |
656 { |
639 { |
657 TPckgBuf<TMsvId> buf(aMailBoxId.Id()); |
640 TPckgBuf<TMsvId> buf(aMailBoxId.Id()); |
658 TRAP( err, aosession.RelayCommandL( |
641 TRAP( err, aosession.RelayCommandL( |
659 EServerAPIEmailCancelAllAndDoNotDisconnect, buf ) ); |
642 EServerAPIEmailCancelAllAndDoNotDisconnect, buf ) ); |
660 } |
643 } |
661 aosession.Close(); |
644 aosession.Close(); |
662 #endif |
645 #endif |
663 |
646 |
664 return err; |
647 return err; |
665 } |
648 } |
666 |
649 |
667 // ---------------------------------------------------------------------------- |
650 // ---------------------------------------------------------------------------- |
840 const TInt aRequestId ) |
823 const TInt aRequestId ) |
841 { |
824 { |
842 FUNC_LOG; |
825 FUNC_LOG; |
843 // asynchronous message creation is started here to enable canceling of the operation |
826 // asynchronous message creation is started here to enable canceling of the operation |
844 TMsvPartList partList( KMsvMessagePartBody ); |
827 TMsvPartList partList( KMsvMessagePartBody ); |
845 |
828 |
846 CIpsPlgSingleOpWatcher* watcher = CIpsPlgSingleOpWatcher::NewLC(*this); |
829 CIpsPlgSingleOpWatcher* watcher = CIpsPlgSingleOpWatcher::NewLC(*this); |
847 |
830 |
848 //<qmail> removed mboxEntry from parameters + changed iSmtpService to pointer |
831 //<qmail> removed mboxEntry from parameters + changed iSmtpService to pointer |
849 |
832 |
850 CIpsPlgCreateMessageOperation* op = CIpsPlgCreateMessageOperation::NewL( |
833 CIpsPlgCreateMessageOperation* op = CIpsPlgCreateMessageOperation::NewL( |
851 *iSmtpService, |
834 *iSmtpService, |
852 *iSession, |
835 *iSession, |
853 watcher->iStatus, |
836 watcher->iStatus, |
854 partList, |
837 partList, |
855 aMailBoxId, |
838 aMailBoxId, |
856 aOperationObserver, |
839 aOperationObserver, |
857 aRequestId ); |
840 aRequestId ); |
858 //</qmail> |
841 //</qmail> |
859 watcher->SetOperation( op ); |
842 watcher->SetOperation( op ); |
860 |
843 |
861 iOperations.AppendL( watcher ); |
844 iOperations.AppendL( watcher ); |
862 CleanupStack::Pop( watcher ); |
845 CleanupStack::Pop( watcher ); |
863 } |
846 } |
864 // </qmail> |
847 // </qmail> |
865 |
848 |
866 // ---------------------------------------------------------------------------- |
849 // ---------------------------------------------------------------------------- |
867 // ---------------------------------------------------------------------------- |
850 // ---------------------------------------------------------------------------- |
868 CFSMailMessage* CIpsPlgSosBasePlugin::CreateForwardMessageL( |
851 CFSMailMessage* CIpsPlgSosBasePlugin::CreateForwardMessageL( |
869 const TFSMailMsgId& /*aMailBoxId*/, |
852 const TFSMailMsgId& /*aMailBoxId*/, |
870 const TFSMailMsgId& /*aOriginalMessageId*/, |
853 const TFSMailMsgId& /*aOriginalMessageId*/, |
876 } |
859 } |
877 |
860 |
878 // <qmail> |
861 // <qmail> |
879 // ---------------------------------------------------------------------------- |
862 // ---------------------------------------------------------------------------- |
880 // ---------------------------------------------------------------------------- |
863 // ---------------------------------------------------------------------------- |
881 void CIpsPlgSosBasePlugin::CreateForwardMessageL( |
864 void CIpsPlgSosBasePlugin::CreateForwardMessageL( |
882 const TFSMailMsgId& aMailBoxId, |
865 const TFSMailMsgId& aMailBoxId, |
883 const TFSMailMsgId& aOriginalMessageId, |
866 const TFSMailMsgId& aOriginalMessageId, |
884 MFSMailRequestObserver& aOperationObserver, |
867 MFSMailRequestObserver& aOperationObserver, |
885 const TInt aRequestId, |
868 const TInt aRequestId, |
886 const TDesC& /*aHeaderDescriptor*/ ) |
869 const TDesC& /*aHeaderDescriptor*/ ) |
887 { |
870 { |
888 FUNC_LOG; |
871 FUNC_LOG; |
889 // asynchronous message creation is started here to enable canceling of the operation |
872 // asynchronous message creation is started here to enable canceling of the operation |
890 |
873 |
891 // 1. part of function checs that body text and all |
874 // 1. part of function checs that body text and all |
892 // attachments are fetched |
875 // attachments are fetched |
893 TMsvEntry orgMsg; |
876 TMsvEntry orgMsg; |
894 TMsvId service; |
877 TMsvId service; |
895 User::LeaveIfError( iSession->GetEntry( |
878 User::LeaveIfError( iSession->GetEntry( |
896 aOriginalMessageId.Id(), service, orgMsg ) ); |
879 aOriginalMessageId.Id(), service, orgMsg ) ); |
897 |
880 |
898 if ( orgMsg.Id() == KMsvNullIndexEntryIdValue ) |
881 if ( orgMsg.Id() == KMsvNullIndexEntryIdValue ) |
899 { |
882 { |
900 User::Leave(KErrNotFound); |
883 User::Leave(KErrNotFound); |
901 } |
884 } |
902 |
885 |
903 if ( ( orgMsg.Parent() == KMsvSentEntryIdValue ) && |
886 if ( ( orgMsg.Parent() == KMsvSentEntryIdValue ) && |
904 ( orgMsg.iMtm == KSenduiMtmSmtpUid ) ) |
887 ( orgMsg.iMtm == KSenduiMtmSmtpUid ) ) |
905 { |
888 { |
906 iSmtpService->ChangeServiceIdL( orgMsg ); |
889 iSmtpService->ChangeServiceIdL( orgMsg ); |
907 } |
890 } |
908 |
891 |
909 TMsvPartList partList( KMsvMessagePartBody | KMsvMessagePartAttachments ); |
892 TMsvPartList partList( KMsvMessagePartBody | KMsvMessagePartAttachments ); |
910 |
893 |
911 CIpsPlgSingleOpWatcher* watcher = CIpsPlgSingleOpWatcher::NewLC(*this); |
894 CIpsPlgSingleOpWatcher* watcher = CIpsPlgSingleOpWatcher::NewLC(*this); |
912 |
895 |
913 //<qmail> changed iSmtpService to pointer |
896 //<qmail> changed iSmtpService to pointer |
914 CIpsPlgCreateForwardMessageOperation* op = CIpsPlgCreateForwardMessageOperation::NewL( |
897 CIpsPlgCreateForwardMessageOperation* op = CIpsPlgCreateForwardMessageOperation::NewL( |
915 *iSmtpService, |
898 *iSmtpService, |
916 *iSession, |
899 *iSession, |
917 watcher->iStatus, |
900 watcher->iStatus, |
918 partList, |
901 partList, |
919 aMailBoxId, |
902 aMailBoxId, |
920 orgMsg.Id(), |
903 orgMsg.Id(), |
921 aOperationObserver, |
904 aOperationObserver, |
922 aRequestId ); |
905 aRequestId ); |
923 //</qmail> |
906 //</qmail> |
924 watcher->SetOperation( op ); |
907 watcher->SetOperation( op ); |
925 |
908 |
926 iOperations.AppendL( watcher ); |
909 iOperations.AppendL( watcher ); |
927 CleanupStack::Pop( watcher ); |
910 CleanupStack::Pop( watcher ); |
928 } |
911 } |
929 // </qmail> |
912 // </qmail> |
930 |
913 |
931 // ---------------------------------------------------------------------------- |
914 // ---------------------------------------------------------------------------- |
932 // ---------------------------------------------------------------------------- |
915 // ---------------------------------------------------------------------------- |
933 CFSMailMessage* CIpsPlgSosBasePlugin::CreateReplyMessageL( |
916 CFSMailMessage* CIpsPlgSosBasePlugin::CreateReplyMessageL( |
934 const TFSMailMsgId& /*aMailBoxId*/, |
917 const TFSMailMsgId& /*aMailBoxId*/, |
935 const TFSMailMsgId& /*aOriginalMessageId*/, |
918 const TFSMailMsgId& /*aOriginalMessageId*/, |
936 const TBool /*aReplyToAll*/, |
919 const TBool /*aReplyToAll*/, |
937 const TDesC& /*aHeaderDescriptor*/ ) |
920 const TDesC& /*aHeaderDescriptor*/ ) |
938 { |
921 { |
941 return NULL; // prevents compiler warning |
924 return NULL; // prevents compiler warning |
942 } |
925 } |
943 |
926 |
944 // <qmail> |
927 // <qmail> |
945 // ---------------------------------------------------------------------------- |
928 // ---------------------------------------------------------------------------- |
946 // ---------------------------------------------------------------------------- |
929 // ---------------------------------------------------------------------------- |
947 void CIpsPlgSosBasePlugin::CreateReplyMessageL( |
930 void CIpsPlgSosBasePlugin::CreateReplyMessageL( |
948 const TFSMailMsgId& aMailBoxId, |
931 const TFSMailMsgId& aMailBoxId, |
949 const TFSMailMsgId& aOriginalMessageId, |
932 const TFSMailMsgId& aOriginalMessageId, |
950 const TBool aReplyToAll, |
933 const TBool aReplyToAll, |
951 MFSMailRequestObserver& aOperationObserver, |
934 MFSMailRequestObserver& aOperationObserver, |
952 const TInt aRequestId, |
935 const TInt aRequestId, |
953 const TDesC& /* aHeaderDescriptor */ ) |
936 const TDesC& /* aHeaderDescriptor */ ) |
954 { |
937 { |
955 FUNC_LOG; |
938 FUNC_LOG; |
956 // asynchronous message creation is started here to enable canceling of the operation |
939 // asynchronous message creation is started here to enable canceling of the operation |
957 |
940 |
958 // find orginal message header and check that body is fetched |
941 // find orginal message header and check that body is fetched |
959 TMsvEntry orgMsg; |
942 TMsvEntry orgMsg; |
960 TMsvId service; |
943 TMsvId service; |
961 User::LeaveIfError( |
944 User::LeaveIfError( |
962 iSession->GetEntry( aOriginalMessageId.Id(), service, orgMsg ) ); |
945 iSession->GetEntry( aOriginalMessageId.Id(), service, orgMsg ) ); |
963 |
946 |
964 if ( orgMsg.Id() == KMsvNullIndexEntryIdValue ) |
947 if ( orgMsg.Id() == KMsvNullIndexEntryIdValue ) |
965 { |
948 { |
966 User::Leave(KErrNotFound); |
949 User::Leave(KErrNotFound); |
967 } |
950 } |
968 |
951 |
969 if ( ( orgMsg.Parent() == KMsvSentEntryIdValue ) && |
952 if ( ( orgMsg.Parent() == KMsvSentEntryIdValue ) && |
970 ( orgMsg.iMtm == KSenduiMtmSmtpUid ) ) |
953 ( orgMsg.iMtm == KSenduiMtmSmtpUid ) ) |
971 { |
954 { |
972 iSmtpService->ChangeServiceIdL( orgMsg ); |
955 iSmtpService->ChangeServiceIdL( orgMsg ); |
973 } |
956 } |
974 |
957 |
975 // partList flags control e.g. what kind of recipient set is created |
958 // partList flags control e.g. what kind of recipient set is created |
976 TMsvPartList partList = KMsvMessagePartBody | KMsvMessagePartDescription |
959 TMsvPartList partList = KMsvMessagePartBody | KMsvMessagePartDescription |
977 | KMsvMessagePartOriginator; |
960 | KMsvMessagePartOriginator; |
978 if( aReplyToAll ) |
961 if( aReplyToAll ) |
979 { |
962 { |
980 partList |= KMsvMessagePartRecipient; |
963 partList |= KMsvMessagePartRecipient; |
981 } |
964 } |
982 |
965 |
983 CIpsPlgSingleOpWatcher* watcher = CIpsPlgSingleOpWatcher::NewLC(*this); |
966 CIpsPlgSingleOpWatcher* watcher = CIpsPlgSingleOpWatcher::NewLC(*this); |
984 |
967 |
985 //<qmail> changed iSmtpService to pointer |
968 //<qmail> changed iSmtpService to pointer |
986 CIpsPlgCreateReplyMessageOperation* op = CIpsPlgCreateReplyMessageOperation::NewL( |
969 CIpsPlgCreateReplyMessageOperation* op = CIpsPlgCreateReplyMessageOperation::NewL( |
987 *iSmtpService, |
970 *iSmtpService, |
988 *iSession, |
971 *iSession, |
989 watcher->iStatus, |
972 watcher->iStatus, |
990 partList, |
973 partList, |
991 aMailBoxId, |
974 aMailBoxId, |
992 orgMsg.Id(), |
975 orgMsg.Id(), |
993 aOperationObserver, |
976 aOperationObserver, |
994 aRequestId ); |
977 aRequestId ); |
995 //</qmail> |
978 //</qmail> |
996 watcher->SetOperation( op ); |
979 watcher->SetOperation( op ); |
997 |
980 |
998 iOperations.AppendL( watcher ); |
981 iOperations.AppendL( watcher ); |
999 CleanupStack::Pop( watcher ); |
982 CleanupStack::Pop( watcher ); |
1000 } |
983 } |
1001 // </qmail> |
984 // </qmail> |
1002 |
985 |
1003 // ---------------------------------------------------------------------------- |
986 // ---------------------------------------------------------------------------- |
1004 // ---------------------------------------------------------------------------- |
987 // ---------------------------------------------------------------------------- |
1005 // |
988 // |
1006 void CIpsPlgSosBasePlugin::StoreMessageL( |
989 void CIpsPlgSosBasePlugin::StoreMessageL( |
1007 const TFSMailMsgId& aMailBoxId, |
990 const TFSMailMsgId& aMailBoxId, |
1008 CFSMailMessage& aMessage ) |
991 CFSMailMessage& aMessage ) |
1009 { |
992 { |
1010 FUNC_LOG; |
993 FUNC_LOG; |
1011 TInt status( KErrNone); |
994 TInt status( KErrNone); |
1029 if ( incoming ) |
1012 if ( incoming ) |
1030 { |
1013 { |
1031 // <qmail> Cmail change to synchronous call (UpdateMessageFlagsL) ignored, |
1014 // <qmail> Cmail change to synchronous call (UpdateMessageFlagsL) ignored, |
1032 // <qmail> because it causes emulator & HW to freeze on 10.1 |
1015 // <qmail> because it causes emulator & HW to freeze on 10.1 |
1033 CIpsPlgSingleOpWatcher* opW = CIpsPlgSingleOpWatcher::NewLC( *this ); |
1016 CIpsPlgSingleOpWatcher* opW = CIpsPlgSingleOpWatcher::NewLC( *this ); |
1034 CMsvOperation* op = iMsgMapper->UpdateMessageFlagsAsyncL( |
1017 CMsvOperation* op = iMsgMapper->UpdateMessageFlagsAsyncL( |
1035 msgId.Id(), aMessage, opW->iStatus ); |
1018 msgId.Id(), aMessage, opW->iStatus ); |
1036 |
1019 |
1037 if ( op ) |
1020 if ( op ) |
1038 { |
1021 { |
1039 opW->SetOperation( op ); |
1022 opW->SetOperation( op ); |
1040 iOperations.AppendL( opW ); |
1023 iOperations.AppendL( opW ); |
1041 CleanupStack::Pop( opW ); |
1024 CleanupStack::Pop( opW ); |
1061 void CIpsPlgSosBasePlugin::StoreMessagesL( |
1044 void CIpsPlgSosBasePlugin::StoreMessagesL( |
1062 const TFSMailMsgId& /*aMailBox*/, |
1045 const TFSMailMsgId& /*aMailBox*/, |
1063 RPointerArray<CFSMailMessage> &messages, |
1046 RPointerArray<CFSMailMessage> &messages, |
1064 MFSMailRequestObserver& aOperationObserver, |
1047 MFSMailRequestObserver& aOperationObserver, |
1065 const TInt aRequestId ) |
1048 const TInt aRequestId ) |
1066 |
1049 |
1067 { |
1050 { |
1068 CIpsPlgSingleOpWatcher* watcher = CIpsPlgSingleOpWatcher::NewL(*this); |
1051 CIpsPlgSingleOpWatcher* watcher = CIpsPlgSingleOpWatcher::NewL(*this); |
1069 CleanupStack::PushL(watcher); |
1052 CleanupStack::PushL(watcher); |
1070 CIpsPlgMailStorerOperation* op = |
1053 CIpsPlgMailStorerOperation* op = |
1071 CIpsPlgMailStorerOperation::NewLC( |
1054 CIpsPlgMailStorerOperation::NewLC( |
1072 *iSession, |
1055 *iSession, |
1073 watcher->iStatus, |
1056 watcher->iStatus, |
1074 *this, |
1057 *this, |
1075 messages, |
1058 messages, |
1076 aOperationObserver, |
1059 aOperationObserver, |
1077 aRequestId ); |
1060 aRequestId ); |
1078 |
1061 |
1079 watcher->SetOperation(op); |
1062 watcher->SetOperation(op); |
1080 iOperations.AppendL(watcher); |
1063 iOperations.AppendL(watcher); |
1081 CleanupStack::Pop( 2, watcher ); |
1064 CleanupStack::Pop( 2, watcher ); |
1082 } |
1065 } |
1083 // </qmail> |
1066 // </qmail> |
1152 return NULL; // prevents compiler warning |
1135 return NULL; // prevents compiler warning |
1153 } |
1136 } |
1154 |
1137 |
1155 // <qmail> |
1138 // <qmail> |
1156 // ---------------------------------------------------------------------------- |
1139 // ---------------------------------------------------------------------------- |
1157 // ---------------------------------------------------------------------------- |
1140 // ---------------------------------------------------------------------------- |
1158 void CIpsPlgSosBasePlugin::NewChildPartFromFileL( |
1141 void CIpsPlgSosBasePlugin::NewChildPartFromFileL( |
1159 const TFSMailMsgId& aMailBoxId, |
1142 const TFSMailMsgId& aMailBoxId, |
1160 const TFSMailMsgId& /* aParentFolderId */, |
1143 const TFSMailMsgId& /* aParentFolderId */, |
1161 const TFSMailMsgId& aMessageId, |
1144 const TFSMailMsgId& aMessageId, |
1162 const TFSMailMsgId& /* aParentPartId */, |
1145 const TFSMailMsgId& /* aParentPartId */, |
1165 MFSMailRequestObserver& aOperationObserver, |
1148 MFSMailRequestObserver& aOperationObserver, |
1166 const TInt aRequestId ) |
1149 const TInt aRequestId ) |
1167 { |
1150 { |
1168 FUNC_LOG; |
1151 FUNC_LOG; |
1169 CIpsPlgSingleOpWatcher* watcher = CIpsPlgSingleOpWatcher::NewLC(*this); |
1152 CIpsPlgSingleOpWatcher* watcher = CIpsPlgSingleOpWatcher::NewLC(*this); |
1170 |
1153 |
1171 CIpsPlgNewChildPartFromFileOperation* op = CIpsPlgNewChildPartFromFileOperation::NewL( |
1154 CIpsPlgNewChildPartFromFileOperation* op = CIpsPlgNewChildPartFromFileOperation::NewL( |
1172 *iSession, |
1155 *iSession, |
1173 watcher->iStatus, |
1156 watcher->iStatus, |
1174 aMailBoxId, |
1157 aMailBoxId, |
1175 aMessageId, |
1158 aMessageId, |
1176 aContentType, |
1159 aContentType, |
1177 aFilePath, |
1160 aFilePath, |
1178 aOperationObserver, |
1161 aOperationObserver, |
1179 aRequestId, |
1162 aRequestId, |
1180 iMsgMapper); |
1163 iMsgMapper); |
1181 watcher->SetOperation( op ); |
1164 watcher->SetOperation( op ); |
1182 |
1165 |
1183 iOperations.AppendL( watcher ); |
1166 iOperations.AppendL( watcher ); |
1184 CleanupStack::Pop( watcher ); |
1167 CleanupStack::Pop( watcher ); |
1185 } |
1168 } |
1186 // </qmail> |
1169 // </qmail> |
1187 |
1170 |
1188 // ---------------------------------------------------------------------------- |
1171 // ---------------------------------------------------------------------------- |
1189 // ---------------------------------------------------------------------------- |
1172 // ---------------------------------------------------------------------------- |
1190 CFSMailMessagePart* CIpsPlgSosBasePlugin::NewChildPartFromFileL( |
1173 CFSMailMessagePart* CIpsPlgSosBasePlugin::NewChildPartFromFileL( |
1191 const TFSMailMsgId& /*aMailBoxId*/, |
1174 const TFSMailMsgId& /*aMailBoxId*/, |
1192 const TFSMailMsgId& /*aParentFolderId*/, |
1175 const TFSMailMsgId& /*aParentFolderId*/, |
1193 const TFSMailMsgId& /*aMessageId*/, |
1176 const TFSMailMsgId& /*aMessageId*/, |
1194 const TFSMailMsgId& /*aParentPartId*/, |
1177 const TFSMailMsgId& /*aParentPartId*/, |
1229 User::Leave(KErrFSMailPluginNotSupported); |
1212 User::Leave(KErrFSMailPluginNotSupported); |
1230 } |
1213 } |
1231 |
1214 |
1232 // <qmail> |
1215 // <qmail> |
1233 // ---------------------------------------------------------------------------- |
1216 // ---------------------------------------------------------------------------- |
1234 // Supports currently deletion of attachments and multipart structures |
1217 // Supports currently deletion of attachments and multipart structures |
1235 // which are represented as folders in Symbian store) |
1218 // which are represented as folders in Symbian store) |
1236 // ---------------------------------------------------------------------------- |
1219 // ---------------------------------------------------------------------------- |
1237 // |
1220 // |
1238 void CIpsPlgSosBasePlugin::RemoveChildPartL( |
1221 void CIpsPlgSosBasePlugin::RemoveChildPartL( |
1239 const TFSMailMsgId& /* aMailBoxId */, |
1222 const TFSMailMsgId& /* aMailBoxId */, |
1240 const TFSMailMsgId& /* aParentFolderId */, |
1223 const TFSMailMsgId& /* aParentFolderId */, |
1241 const TFSMailMsgId& aMessageId, |
1224 const TFSMailMsgId& aMessageId, |
1282 // ---------------------------------------------------------------------------- |
1265 // ---------------------------------------------------------------------------- |
1283 // The implementation bypass CImEmailMessage and its email's attachment |
1266 // The implementation bypass CImEmailMessage and its email's attachment |
1284 // manager. Instead, it calls Symbian framework classes directly by |
1267 // manager. Instead, it calls Symbian framework classes directly by |
1285 // accessing the attachment entry. |
1268 // accessing the attachment entry. |
1286 // Qmail change: returns file handle for read/write |
1269 // Qmail change: returns file handle for read/write |
1287 // ---------------------------------------------------------------------------- |
1270 // ---------------------------------------------------------------------------- |
1288 TInt CIpsPlgSosBasePlugin::GetMessagePartFileL( |
1271 TInt CIpsPlgSosBasePlugin::GetMessagePartFileL( |
1289 const TFSMailMsgId& /* aMailBoxId */, |
1272 const TFSMailMsgId& /* aMailBoxId */, |
1290 const TFSMailMsgId& /* aParentFolderId */, |
1273 const TFSMailMsgId& /* aParentFolderId */, |
1291 const TFSMailMsgId& /* aMessageId */, |
1274 const TFSMailMsgId& /* aMessageId */, |
1292 const TFSMailMsgId& aMessagePartId, |
1275 const TFSMailMsgId& aMessagePartId, |
1293 RFile& aFileHandle) |
1276 RFile& aFileHandle) |
1439 const TFSMailMsgId& /* aParentFolderId */, |
1422 const TFSMailMsgId& /* aParentFolderId */, |
1440 const TFSMailMsgId& /* aMessageId */, |
1423 const TFSMailMsgId& /* aMessageId */, |
1441 const TFSMailMsgId& aMessagePartId ) |
1424 const TFSMailMsgId& aMessagePartId ) |
1442 { |
1425 { |
1443 FUNC_LOG; |
1426 FUNC_LOG; |
1444 |
1427 |
1445 //<qmail> Rewritten in Qmail: CIpsPlgOperationWait is no longer used |
1428 //<qmail> Rewritten in Qmail: CIpsPlgOperationWait is no longer used |
1446 // Notice that SetContentL sets only the content of text/plain message part: |
1429 // Notice that SetContentL sets only the content of text/plain message part: |
1447 // text/html part can be modified directly using GetMessagePartFileL |
1430 // text/html part can be modified directly using GetMessagePartFileL |
1448 CMsvEntry* cEntry( NULL ); |
1431 CMsvEntry* cEntry( NULL ); |
1449 CMsvStore* store = NULL; |
1432 CMsvStore* store = NULL; |
1450 |
1433 |
1451 // following code should fill text/plain content |
1434 // following code should fill text/plain content |
1452 cEntry = iSession->GetEntryL( aMessagePartId.Id() ); |
1435 cEntry = iSession->GetEntryL( aMessagePartId.Id() ); |
1453 CleanupStack::PushL( cEntry ); |
1436 CleanupStack::PushL( cEntry ); |
1454 TBool hasStore = cEntry->HasStoreL(); |
1437 TBool hasStore = cEntry->HasStoreL(); |
1455 if ( hasStore ) { |
1438 if ( hasStore ) { |
1517 CleanupStack::PushL(watcher); |
1500 CleanupStack::PushL(watcher); |
1518 CIpsPlgMessagePartStorerOperation* op = |
1501 CIpsPlgMessagePartStorerOperation* op = |
1519 CIpsPlgMessagePartStorerOperation::NewLC(*iSession, |
1502 CIpsPlgMessagePartStorerOperation::NewLC(*iSession, |
1520 watcher->iStatus, *this, aMessageParts, |
1503 watcher->iStatus, *this, aMessageParts, |
1521 aOperationObserver, aRequestId); |
1504 aOperationObserver, aRequestId); |
1522 |
1505 |
1523 watcher->SetOperation(op); |
1506 watcher->SetOperation(op); |
1524 iOperations.AppendL(watcher); |
1507 iOperations.AppendL(watcher); |
1525 CleanupStack::Pop( 2, watcher ); |
1508 CleanupStack::Pop( 2, watcher ); |
1526 } |
1509 } |
1527 //<//qmail> |
1510 //<//qmail> |
1528 |
1511 |
1529 // ---------------------------------------------------------------------------- |
1512 // ---------------------------------------------------------------------------- |
1530 // ---------------------------------------------------------------------------- |
1513 // ---------------------------------------------------------------------------- |
1531 void CIpsPlgSosBasePlugin::UnregisterRequestObserver( TInt /* aRequestId */) |
1514 void CIpsPlgSosBasePlugin::UnregisterRequestObserver( TInt /* aRequestId */) |
1532 { |
1515 { |
1533 } |
1516 } |
1534 |
1517 |
1535 // ---------------------------------------------------------------------------- |
1518 // ---------------------------------------------------------------------------- |
1700 CleanupStack::PushL(sel); |
1683 CleanupStack::PushL(sel); |
1701 |
1684 |
1702 TInt count = aMessages.Count(); |
1685 TInt count = aMessages.Count(); |
1703 TMsvEntry tEntry; |
1686 TMsvEntry tEntry; |
1704 TMsvId service; |
1687 TMsvId service; |
1705 |
1688 |
1706 for(TInt i=0; i<count; i++) |
1689 for(TInt i=0; i<count; i++) |
1707 { |
1690 { |
1708 iSession->GetEntry( aMessages[i].Id(), service, tEntry ); |
1691 iSession->GetEntry( aMessages[i].Id(), service, tEntry ); |
1709 //make sure that only messages get deleted. |
1692 //make sure that only messages get deleted. |
1710 if( tEntry.iType == KUidMsvMessageEntry ) |
1693 if( tEntry.iType == KUidMsvMessageEntry ) |
1711 { |
1694 { |
1712 // <qmail> |
1695 // <qmail> |
1713 sel->AppendL( tEntry.Id() ); |
1696 sel->AppendL( tEntry.Id() ); |
1714 // </qmail> |
1697 // </qmail> |
1715 } |
1698 } |
1716 } |
1699 } |
1717 |
1700 |
1718 CIpsPlgSingleOpWatcher* watcher = CIpsPlgSingleOpWatcher::NewL( *this ); |
1701 CIpsPlgSingleOpWatcher* watcher = CIpsPlgSingleOpWatcher::NewL( *this ); |
1719 CleanupStack::PushL( watcher ); |
1702 CleanupStack::PushL( watcher ); |
1720 //<qmail> |
1703 //<qmail> |
1721 CMsvOperation* op = CIpsPlgDeleteOperation::NewL( *iSession, |
1704 CMsvOperation* op = CIpsPlgDeleteOperation::NewL( *iSession, |
1722 watcher->iStatus, sel ); |
1705 watcher->iStatus, sel ); |
1744 CleanupStack::PushL(sel); |
1727 CleanupStack::PushL(sel); |
1745 |
1728 |
1746 TInt count = aMessages.Count(); |
1729 TInt count = aMessages.Count(); |
1747 TMsvEntry tEntry; |
1730 TMsvEntry tEntry; |
1748 TMsvId service; |
1731 TMsvId service; |
1749 |
1732 |
1750 for(TInt i=0; i<count; i++) |
1733 for(TInt i=0; i<count; i++) |
1751 { |
1734 { |
1752 iSession->GetEntry( aMessages[i].Id(), service, tEntry ); |
1735 iSession->GetEntry( aMessages[i].Id(), service, tEntry ); |
1753 //make sure that only messages get deleted. |
1736 //make sure that only messages get deleted. |
1754 if( tEntry.iType == KUidMsvMessageEntry ) |
1737 if( tEntry.iType == KUidMsvMessageEntry ) |
1755 { |
1738 { |
1756 sel->AppendL( tEntry.Id() ); |
1739 sel->AppendL( tEntry.Id() ); |
1757 } |
1740 } |
1758 } |
1741 } |
1759 |
1742 |
1760 CIpsPlgSingleOpWatcher* watcher = CIpsPlgSingleOpWatcher::NewL( *this ); |
1743 CIpsPlgSingleOpWatcher* watcher = CIpsPlgSingleOpWatcher::NewL( *this ); |
1761 CleanupStack::PushL( watcher ); |
1744 CleanupStack::PushL( watcher ); |
1762 CMsvOperation* op = CIpsPlgDeleteOperation::NewL( *iSession, |
1745 CMsvOperation* op = CIpsPlgDeleteOperation::NewL( *iSession, |
1763 watcher->iStatus, sel, aOperationObserver, aRequestId ); |
1746 watcher->iStatus, sel, aOperationObserver, aRequestId ); |
1764 watcher->SetOperation( op ); |
1747 watcher->SetOperation( op ); |
1854 const TDesC& /*aUsername*/, const TDesC& /*aPassword*/ ) |
1837 const TDesC& /*aUsername*/, const TDesC& /*aPassword*/ ) |
1855 { |
1838 { |
1856 // <qmail> not used; should be removed |
1839 // <qmail> not used; should be removed |
1857 // FUNC_LOG; |
1840 // FUNC_LOG; |
1858 // TBool cancelled = EFalse; |
1841 // TBool cancelled = EFalse; |
1859 // |
1842 // |
1860 // if ( aPassword.Length() > 0 ) |
1843 // if ( aPassword.Length() > 0 ) |
1861 // { |
1844 // { |
1862 // //Set new password and signal (possible) ongoing connect operation |
1845 // //Set new password and signal (possible) ongoing connect operation |
1863 // //CIpsSetDataApi* api = CIpsSetDataApi::NewL( *iSession ); |
1846 // //CIpsSetDataApi* api = CIpsSetDataApi::NewL( *iSession ); |
1864 // //CleanupStack::PushL( api ); |
1847 // //CleanupStack::PushL( api ); |
1865 // |
1848 // |
1866 // //CMsvEntry* cEntry = iSession->GetEntryL( aMailBoxId.Id() ); |
1849 // //CMsvEntry* cEntry = iSession->GetEntryL( aMailBoxId.Id() ); |
1867 // //CleanupStack::PushL( cEntry ); |
1850 // //CleanupStack::PushL( cEntry ); |
1868 // |
1851 // |
1869 // //api->SetNewPasswordL( *cEntry, aPassword ); |
1852 // //api->SetNewPasswordL( *cEntry, aPassword ); |
1870 // |
1853 // |
1871 // //CleanupStack::PopAndDestroy( 2, api );//cEntry, api |
1854 // //CleanupStack::PopAndDestroy( 2, api );//cEntry, api |
1872 // |
1855 // |
1873 // //now signal through eventhandler that credientials have been set |
1856 // //now signal through eventhandler that credientials have been set |
1874 // } |
1857 // } |
1875 // else |
1858 // else |
1876 // { |
1859 // { |
1877 // cancelled = ETrue; |
1860 // cancelled = ETrue; |
1878 // } |
1861 // } |
1922 iCachedEmailMessage->IsActive() ) |
1905 iCachedEmailMessage->IsActive() ) |
1923 { |
1906 { |
1924 // Can't use the ones that are in cache, create new ones and don't replace the ones in cache |
1907 // Can't use the ones that are in cache, create new ones and don't replace the ones in cache |
1925 aMessageEntry = iSession->GetEntryL( aId ); |
1908 aMessageEntry = iSession->GetEntryL( aId ); |
1926 aImEmailMessage = 0; |
1909 aImEmailMessage = 0; |
1927 |
1910 |
1928 if ( aMessageEntry->Entry().iType == KUidMsvMessageEntry ) |
1911 if ( aMessageEntry->Entry().iType == KUidMsvMessageEntry ) |
1929 { |
1912 { |
1930 CleanupStack::PushL( aMessageEntry ); |
1913 CleanupStack::PushL( aMessageEntry ); |
1931 aImEmailMessage = CImEmailMessage::NewL( *aMessageEntry ); |
1914 aImEmailMessage = CImEmailMessage::NewL( *aMessageEntry ); |
1932 CleanupStack::Pop(); |
1915 CleanupStack::Pop(); |
1952 CMsvEntry* aMessageEntry, |
1935 CMsvEntry* aMessageEntry, |
1953 CImEmailMessage* aImEmailMessage ) |
1936 CImEmailMessage* aImEmailMessage ) |
1954 { |
1937 { |
1955 // Clean old ones from the cache |
1938 // Clean old ones from the cache |
1956 CleanCachedMessageEntries(); |
1939 CleanCachedMessageEntries(); |
1957 |
1940 |
1958 // Always save the latest ones in the cache |
1941 // Always save the latest ones in the cache |
1959 iCachedEntry = aMessageEntry; |
1942 iCachedEntry = aMessageEntry; |
1960 iCachedEmailMessage = aImEmailMessage; |
1943 iCachedEmailMessage = aImEmailMessage; |
1961 } |
1944 } |
1962 |
1945 |
1963 // ---------------------------------------------------------------------------- |
1946 // ---------------------------------------------------------------------------- |
1964 // ---------------------------------------------------------------------------- |
1947 // ---------------------------------------------------------------------------- |
1965 // |
1948 // |
1966 void CIpsPlgSosBasePlugin::CleanCachedMessageEntries() |
1949 void CIpsPlgSosBasePlugin::CleanCachedMessageEntries() |
1967 { |
1950 { |
2071 void CIpsPlgSosBasePlugin::DeleteAndRemoveOperation( |
2054 void CIpsPlgSosBasePlugin::DeleteAndRemoveOperation( |
2072 const TInt aOpArrayIndex, TInt aCompleteCode ) |
2055 const TInt aOpArrayIndex, TInt aCompleteCode ) |
2073 { |
2056 { |
2074 FUNC_LOG; |
2057 FUNC_LOG; |
2075 CIpsPlgSingleOpWatcher* opWatcher = iOperations[aOpArrayIndex]; |
2058 CIpsPlgSingleOpWatcher* opWatcher = iOperations[aOpArrayIndex]; |
2076 |
2059 |
2077 // <qmail> removed; does nothing |
2060 // <qmail> removed; does nothing |
2078 // The operations matches, handle it in protocol plugin...if needed. |
2061 // The operations matches, handle it in protocol plugin...if needed. |
2079 //TRAP_IGNORE( HandleOpCompletedL( *opWatcher, aCompleteCode ) ); |
2062 //TRAP_IGNORE( HandleOpCompletedL( *opWatcher, aCompleteCode ) ); |
2080 // </qmail> |
2063 // </qmail> |
2081 const CIpsPlgBaseOperation* op = opWatcher->BaseOperation(); |
2064 const CIpsPlgBaseOperation* op = opWatcher->BaseOperation(); |
2112 FUNC_LOG; |
2095 FUNC_LOG; |
2113 CFSMailMessagePart* textBodyPart = aMessage->PlainTextBodyPartL(); |
2096 CFSMailMessagePart* textBodyPart = aMessage->PlainTextBodyPartL(); |
2114 if ( textBodyPart ) |
2097 if ( textBodyPart ) |
2115 { |
2098 { |
2116 CleanupStack::PushL( textBodyPart ); |
2099 CleanupStack::PushL( textBodyPart ); |
2117 CFSMailMessage* origMsg = GetMessageByUidL( |
2100 CFSMailMessage* origMsg = GetMessageByUidL( |
2118 aMailBoxId, |
2101 aMailBoxId, |
2119 TFSMailMsgId(), |
2102 TFSMailMsgId(), |
2120 aOriginalMessageId, |
2103 aOriginalMessageId, |
2121 EFSMsgDataStructure ); |
2104 EFSMsgDataStructure ); |
2122 if ( origMsg ) |
2105 if ( origMsg ) |
2123 { |
2106 { |
2124 CleanupStack::PushL( origMsg ); |
2107 CleanupStack::PushL( origMsg ); |
2125 CFSMailMessagePart* origMsgTextBodyPart = |
2108 CFSMailMessagePart* origMsgTextBodyPart = |
2126 origMsg->PlainTextBodyPartL(); |
2109 origMsg->PlainTextBodyPartL(); |
2127 if ( origMsgTextBodyPart ) |
2110 if ( origMsgTextBodyPart ) |
2128 { |
2111 { |
2129 CleanupStack::PushL( origMsgTextBodyPart ); |
2112 CleanupStack::PushL( origMsgTextBodyPart ); |
2130 // Use the content provided in aHeaderDescriptor |
2113 // Use the content provided in aHeaderDescriptor |
2131 // instead of what is provided by |
2114 // instead of what is provided by |
2132 // CreateForwardSmtpMessage.. |
2115 // CreateForwardSmtpMessage.. |
2133 TPckgBuf<TReplyForwardParams> pckg; |
2116 TPckgBuf<TReplyForwardParams> pckg; |
2134 pckg.Copy( aHeaderDescriptor ); |
2117 pckg.Copy( aHeaderDescriptor ); |
2135 TPtr hPtr( pckg().iHeader->Des() ); |
2118 TPtr hPtr( pckg().iHeader->Des() ); |
2136 HBufC* body = HBufC::NewLC( |
2119 HBufC* body = HBufC::NewLC( |
2137 textBodyPart->FetchedContentSize() ); |
2120 textBodyPart->FetchedContentSize() ); |
2138 TPtr bPtr( body->Des() ); |
2121 TPtr bPtr( body->Des() ); |
2139 origMsgTextBodyPart->GetContentToBufferL( bPtr, 0 ); |
2122 origMsgTextBodyPart->GetContentToBufferL( bPtr, 0 ); |
2140 HBufC* content = HBufC::NewLC( |
2123 HBufC* content = HBufC::NewLC( |
2141 hPtr.Length() + bPtr.Length() ); |
2124 hPtr.Length() + bPtr.Length() ); |
2142 TPtr cPtr( content->Des() ); |
2125 TPtr cPtr( content->Des() ); |
2143 cPtr.Append( hPtr ); |
2126 cPtr.Append( hPtr ); |
2144 cPtr.Append( bPtr ); |
2127 cPtr.Append( bPtr ); |
2145 textBodyPart->SetContent( cPtr ); |
2128 textBodyPart->SetContent( cPtr ); |
2146 textBodyPart->SaveL(); |
2129 textBodyPart->SaveL(); |
2147 CleanupStack::PopAndDestroy( content ); |
2130 CleanupStack::PopAndDestroy( content ); |
2494 const TFSMailMsgId& aActiveFolderId) |
2477 const TFSMailMsgId& aActiveFolderId) |
2495 { |
2478 { |
2496 TMsvId service; |
2479 TMsvId service; |
2497 TMsvEntry folder; |
2480 TMsvEntry folder; |
2498 iSession->GetEntry( aActiveFolderId.Id(), service, folder ); |
2481 iSession->GetEntry( aActiveFolderId.Id(), service, folder ); |
2499 |
2482 |
2500 |
2483 |
2501 //currently, no actions unless this is inbox |
2484 //currently, no actions unless this is inbox |
2502 //also, if id is '0', it means inbox before first sync...it doesn't really exist yet |
2485 //also, if id is '0', it means inbox before first sync...it doesn't really exist yet |
2503 if( folder.iDetails.CompareF( KIpsPlgInbox ) == 0 || folder.Id() == 0 || |
2486 if( folder.iDetails.CompareF( KIpsPlgInbox ) == 0 || folder.Id() == 0 || |
2504 ( folder.iMtm == KSenduiMtmPop3Uid ) && |
2487 ( folder.iMtm == KSenduiMtmPop3Uid ) && |
2505 ( folder.iType == KUidMsvServiceEntry ) && |
2488 ( folder.iType == KUidMsvServiceEntry ) && |
2506 ( folder.iServiceId == aActiveFolderId.Id() ) ) |
2489 ( folder.iServiceId == aActiveFolderId.Id() ) ) |
2507 { |
2490 { |
2508 //folder is inbox |
2491 //folder is inbox |
2510 == KIpsSosEmailSyncStarted ) |
2493 == KIpsSosEmailSyncStarted ) |
2511 { |
2494 { |
2512 //we won't do anything if sync is already started |
2495 //we won't do anything if sync is already started |
2513 return; |
2496 return; |
2514 } |
2497 } |
2515 |
2498 |
2516 //check are we in polling mode |
2499 //check are we in polling mode |
2517 NmIpsSosExtendedSettingsManager* eMgr= |
2500 NmIpsSosExtendedSettingsManager* eMgr= |
2518 new NmIpsSosExtendedSettingsManager(aActiveMailboxId.Id()); |
2501 new NmIpsSosExtendedSettingsManager(aActiveMailboxId.Id()); |
2519 |
2502 |
2520 QVariant value; |
2503 QVariant value; |
2521 bool ok = eMgr->readSetting(IpsServices::ReceptionActiveProfile, value); |
2504 bool ok = eMgr->readSetting(IpsServices::ReceptionActiveProfile, value); |
2522 delete eMgr; |
2505 delete eMgr; |
2523 |
2506 |
2524 if ( ok ) |
2507 if ( ok ) |
2525 { |
2508 { |
2526 TInt profile = value.toInt(); |
2509 TInt profile = value.toInt(); |
2527 if ( profile != IpsServices::EmailSyncProfileManualFetch ) |
2510 if ( profile != IpsServices::EmailSyncProfileManualFetch ) |
2528 { |
2511 { |
2529 // let's sync |
2512 // let's sync |
2530 GoOnlineL(aActiveMailboxId); |
2513 GoOnlineL(aActiveMailboxId); |
2531 } |
2514 } |
2532 } |
2515 } |
2533 } |
2516 } |
2534 } |
2517 } |
2535 // </qmail> |
2518 // </qmail> |