136 // CIpsPlgPop3Plugin::RefreshNowL |
137 // CIpsPlgPop3Plugin::RefreshNowL |
137 // ---------------------------------------------------------------------------- |
138 // ---------------------------------------------------------------------------- |
138 void CIpsPlgPop3Plugin::RefreshNowL( |
139 void CIpsPlgPop3Plugin::RefreshNowL( |
139 const TFSMailMsgId& aMailBoxId, |
140 const TFSMailMsgId& aMailBoxId, |
140 MFSMailRequestObserver& aOperationObserver, |
141 MFSMailRequestObserver& aOperationObserver, |
141 TInt aRequestId ) |
142 TInt aRequestId, |
|
143 const TBool /*aSilentConnection*/ ) |
142 { |
144 { |
143 FUNC_LOG; |
145 FUNC_LOG; |
144 TMsvId service = aMailBoxId.Id(); |
146 TMsvId service = aMailBoxId.Id(); |
145 CIpsPlgSingleOpWatcher* watcher = CIpsPlgSingleOpWatcher::NewL(*this); |
147 CIpsPlgSingleOpWatcher* watcher = CIpsPlgSingleOpWatcher::NewL(*this); |
146 CleanupStack::PushL( watcher ); // << watcher |
148 CleanupStack::PushL( watcher ); // << watcher |
161 accounts->GetPopAccountL( service , popAccountId ); |
163 accounts->GetPopAccountL( service , popAccountId ); |
162 accounts->LoadPopSettingsL( popAccountId, *settings ); |
164 accounts->LoadPopSettingsL( popAccountId, *settings ); |
163 TInt populationLimit( settings->PopulationLimit() ); |
165 TInt populationLimit( settings->PopulationLimit() ); |
164 CleanupStack::PopAndDestroy( 2, settings ); // >>> settings, accounts |
166 CleanupStack::PopAndDestroy( 2, settings ); // >>> settings, accounts |
165 TBool forcePopulate( EFalse ); |
167 TBool forcePopulate( EFalse ); |
|
168 // <qmail> back to use |
166 if( populationLimit != KIpsSetDataHeadersOnly ) |
169 if( populationLimit != KIpsSetDataHeadersOnly ) |
167 { |
170 { |
168 forcePopulate = ETrue; |
171 forcePopulate = ETrue; |
169 } |
172 } |
|
173 // </qmail> |
170 |
174 |
171 CIpsPlgBaseOperation* op = CIpsPlgPop3ConnectOp::NewL( |
175 CIpsPlgBaseOperation* op = CIpsPlgPop3ConnectOp::NewL( |
172 *iSession, |
176 *iSession, |
173 watcher->iStatus, |
177 watcher->iStatus, |
174 service, |
178 service, |
175 forcePopulate, |
179 forcePopulate, |
176 ActivityTimerL( aMailBoxId ), |
180 ActivityTimerL( aMailBoxId ), |
177 aMailBoxId, |
181 aMailBoxId, |
178 aOperationObserver, |
182 &aOperationObserver, |
179 aRequestId, |
183 aRequestId, |
180 iEventHandler ); |
184 iEventHandler ); |
181 |
185 |
182 watcher->SetOperation( op ); |
186 watcher->SetOperation( op ); |
183 CleanupStack::PopAndDestroy( sel ); // >>> sel |
187 CleanupStack::PopAndDestroy( sel ); // >>> sel |
184 |
188 |
185 iOperations.AppendL( watcher ); |
189 iOperations.AppendL( watcher ); |
186 CleanupStack::Pop( watcher ); // >> watcher |
190 CleanupStack::Pop( watcher ); // >> watcher |
187 |
191 |
188 // send part |
192 // send part of refresh |
189 EmptyOutboxL( aMailBoxId ); |
193 EmptyOutboxL( aMailBoxId ); |
190 } |
194 } |
191 |
195 |
192 // --------------------------------------------------------------------------- |
196 // --------------------------------------------------------------------------- |
193 // CIpsPlgPop3Plugin::ListFoldersL |
197 // CIpsPlgPop3Plugin::ListFoldersL |
194 // --------------------------------------------------------------------------- |
198 // --------------------------------------------------------------------------- |
195 // |
199 // |
196 void CIpsPlgPop3Plugin::ListFoldersL( |
200 void CIpsPlgPop3Plugin::ListFoldersL( |
197 const TFSMailMsgId& aMailBoxId, |
201 const TFSMailMsgId& aMailBoxId, |
198 const TFSMailMsgId& aFolderId, |
202 const TFSMailMsgId& /*aFolderId*/, |
199 RPointerArray<CFSMailFolder>& aFolderList) |
203 RPointerArray<CFSMailFolder>& aFolderList) |
200 { |
204 { |
201 FUNC_LOG; |
205 FUNC_LOG; |
202 // Pop3 can return only folders on the root level, so folders are not |
206 // Pop3 returns always the root level, so ignore folder id even |
203 // listed when the given folder ID is not null ID. |
207 // it is given. |
204 if ( aFolderId.IsNullId() ) |
208 ListFoldersL( aMailBoxId, aFolderList ); |
205 { |
209 } |
206 ListFoldersL( aMailBoxId, aFolderList ); |
|
207 } |
|
208 } |
|
209 |
210 |
210 // --------------------------------------------------------------------------- |
211 // --------------------------------------------------------------------------- |
211 // CIpsPlgPop3Plugin::ListFoldersL |
212 // CIpsPlgPop3Plugin::ListFoldersL |
212 // --------------------------------------------------------------------------- |
213 // --------------------------------------------------------------------------- |
213 // |
214 // |
269 FUNC_LOG; |
270 FUNC_LOG; |
270 TFSMailMsgId result; |
271 TFSMailMsgId result; |
271 |
272 |
272 if( aFolderType==EFSInbox ) |
273 if( aFolderType==EFSInbox ) |
273 { |
274 { |
274 //in case of pop3, mailbox id == service id == inbox id |
275 //<qmail> removed CMsvEntry conversion |
275 CMsvEntry* cEntry = iSession->GetEntryL( aMailBoxId.Id() ); |
276 |
276 CleanupStack::PushL( cEntry ); |
277 // In case of pop3, mailbox id == service id == inbox id, |
277 if ( cEntry->Count() != 0 ) |
278 // so no need to create CMsvEntry from mailbox id to |
278 { |
279 // dig if any children exists. |
279 result.SetId( aMailBoxId.Id() ); |
280 result.SetId( aMailBoxId.Id() ); |
280 } |
281 //</qmail> |
281 CleanupStack::PopAndDestroy( cEntry ); |
|
282 } |
282 } |
283 else if( aFolderType==EFSOutbox ) |
283 else if( aFolderType==EFSOutbox ) |
284 { |
284 { |
285 result.SetId( KMsvGlobalOutBoxIndexEntryId ); |
285 result.SetId( KMsvGlobalOutBoxIndexEntryId ); |
286 } |
286 } |
334 } |
334 } |
335 |
335 |
336 TImPop3GetMailInfo info; |
336 TImPop3GetMailInfo info; |
337 info.iMaxEmailSize = KMaxTInt32; |
337 info.iMaxEmailSize = KMaxTInt32; |
338 info.iDestinationFolder = aMailBoxId.Id(); |
338 info.iDestinationFolder = aMailBoxId.Id(); |
339 |
339 // <qmail> ownership of selection is moved to the operation |
340 CIpsPlgBaseOperation* op = CIpsPlgPop3FetchOperation::NewL( |
340 CIpsPlgBaseOperation* op = CIpsPlgPop3FetchOperation::NewL( |
341 *iSession, |
341 *iSession, |
342 watcher->iStatus, |
342 watcher->iStatus, |
343 KPOP3MTMCopyMailSelectionWhenAlreadyConnected, |
|
344 aMailBoxId.Id(), |
343 aMailBoxId.Id(), |
345 ActivityTimerL( aMailBoxId ), |
344 ActivityTimerL( aMailBoxId ), |
346 info, |
345 info, |
347 *sel, |
346 sel, |
348 aMailBoxId, |
347 aMailBoxId, |
349 aObserver, |
348 &aObserver, |
350 aRequestId, |
349 aRequestId, |
351 iEventHandler ); |
350 iEventHandler ); |
352 |
351 |
353 watcher->SetOperation( op ); |
352 watcher->SetOperation( op ); |
354 CleanupStack::PopAndDestroy( sel ); |
353 // <qmail> change PopAndDestroy to Pop |
|
354 CleanupStack::Pop( sel ); |
355 CleanupStack::Pop( watcher ); |
355 CleanupStack::Pop( watcher ); |
356 |
356 |
357 iOperations.AppendL( watcher ); |
357 iOperations.AppendL( watcher ); |
358 } |
358 } |
359 |
359 |