--- a/messagingapp/msgappfw/server/src/ccsconversationdeletehandler.cpp Wed Jun 23 18:09:17 2010 +0300
+++ b/messagingapp/msgappfw/server/src/ccsconversationdeletehandler.cpp Tue Jul 06 14:12:40 2010 +0300
@@ -39,7 +39,9 @@
// Constructor
// ----------------------------------------------------------------------------
CCsConversationDeleteHandler::CCsConversationDeleteHandler():
- CActive(CActive::EPriorityLow)
+ CActive(CActive::EPriorityLow),
+ iState(EIdle),
+ iConversationEntryList(NULL)
{
CActiveScheduler::Add( this );
}
@@ -50,9 +52,6 @@
void CCsConversationDeleteHandler::ConstructL(CCsConversationCache* aCache)
{
iCache = aCache;
- iState = EIdle;
-
- iConversationEntryList = new (ELeave)RPointerArray<CCsConversationEntry> ();
iSession = CMsvSession::OpenSyncL(*this);
}
@@ -61,6 +60,15 @@
// ----------------------------------------------------------------------------
CCsConversationDeleteHandler::~CCsConversationDeleteHandler()
{
+ // Make sure Aync request cancel.
+ Cancel();
+
+ if(iSession)
+ {
+ delete iSession;
+ iSession = NULL;
+ }
+
if (iConversationEntryList)
{
iConversationEntryList->ResetAndDestroy();
@@ -68,13 +76,7 @@
delete iConversationEntryList;
iConversationEntryList = NULL;
}
-
- if (iSession)
- {
- delete iSession;
- iSession = NULL;
- }
- }
+}
// ----------------------------------------------------------------------------
// Delete set of messages
@@ -96,12 +98,16 @@
CCsClientConversation* clientConversation = CCsClientConversation::NewL();
clientConversation->SetConversationEntryId(iConversationId);
CleanupStack::PushL(clientConversation);
-
+
+ // Create entry list
+ iConversationEntryList = new (ELeave)RPointerArray<CCsConversationEntry> ();
+
// Get conversationlist for given client conversation
iCache->GetConversationsL (clientConversation, iConversationEntryList);
iCache->MarkConversationAsDeleted(iConversationId, ETrue);
iDeletedCount = 0;
+ iSendStateMsgs = 0;
// Cleanup
CleanupStack::PopAndDestroy(clientConversation);
@@ -124,6 +130,10 @@
{
iSession->RemoveEntry(id);
}
+ else
+ {
+ iSendStateMsgs++;
+ }
}
// ----------------------------------------------------------------------------
@@ -163,10 +173,7 @@
break;
case EDeleteComplete:
- // Mark delete complete.
- iCache->MarkConversationAsDeleted(iConversationId, EFalse);
- // Done with the processing , cleanup the AO since this is the last
- //call to the delete handler.
+ iCache->MarkConversationAsDeleted(iConversationId, EFalse, iSendStateMsgs );
delete this;
break;
}