499 Queue(aStatus); |
499 Queue(aStatus); |
500 User::RequestComplete(iRequest, KErrNone); |
500 User::RequestComplete(iRequest, KErrNone); |
501 } |
501 } |
502 CleanupStack::PopAndDestroy(2); |
502 CleanupStack::PopAndDestroy(2); |
503 } |
503 } |
504 |
|
505 |
|
506 /** |
|
507 ChangeEntriesL update the message read/Unread status in Local and remote, |
|
508 using the IMAP COPY command. |
|
509 |
|
510 @param aSelection The selection of message TMsvIds that are changed. |
|
511 @param aMark The selection marked as read or unread.If 1 is Unread 0 for read. |
|
512 @param aStatus The request status to be completed when the operation has finished. |
|
513 */ |
|
514 |
|
515 TInt CImap4ServerMtm::ChangeEntriesL( const CMsvEntrySelection& aSelection, TInt aMark, TRequestStatus& aStatus ) |
|
516 { |
|
517 __LOG_TEXT(KDefaultLog, "CImap4ServerMtm::ChangeEntriesL()"); |
|
518 |
|
519 TMsvEntry* aNewEntry1 = new (ELeave) TMsvEntry; |
|
520 CleanupStack::PushL(aNewEntry1); |
|
521 |
|
522 TBool flagChanged; |
|
523 |
|
524 if(aMark == 0) |
|
525 flagChanged = EFalse; //Selection to update as Read. |
|
526 else |
|
527 flagChanged = ETrue; ////Selection to update as UnRead. |
|
528 |
|
529 TInt count = aSelection.Count(); |
|
530 while(count--) |
|
531 { |
|
532 iServerEntry->GetEntryFromId(aSelection[count],aNewEntry1); |
|
533 TMsvEmailEntry entry(*aNewEntry1); |
|
534 if(flagChanged) |
|
535 { |
|
536 entry.SetSeenIMAP4Flag(EFalse); |
|
537 } |
|
538 else |
|
539 { |
|
540 entry.SetSeenIMAP4Flag(ETrue); |
|
541 } |
|
542 //Local Updation. |
|
543 User::LeaveIfError(iServerEntry->SetEntry(entry.Id())); |
|
544 User::LeaveIfError(iServerEntry->ChangeEntry(entry)); |
|
545 } |
|
546 //if not offline |
|
547 if (iImapProtocolController->Connected()) |
|
548 { |
|
549 //to update read/unread flags at remote server |
|
550 iImapProtocolController->UpdateEntriesFlagL(iStatus,aSelection,flagChanged); |
|
551 iState= EMtmStateUpdateFlag; |
|
552 Queue(aStatus); |
|
553 SetActive(); |
|
554 } |
|
555 else |
|
556 { |
|
557 Queue(aStatus); |
|
558 User::RequestComplete(iRequest, KErrNone); |
|
559 } |
|
560 CleanupStack::PopAndDestroy(1); //aNewEntry1 |
|
561 return KErrNone; |
|
562 } |
|
563 |
504 |
564 |
505 |
565 /** |
506 /** |
566 Performs the IMAP specific MTM commands. |
507 Performs the IMAP specific MTM commands. |
567 |
508 |