diff -r 5b3b2fa8c3ec -r f42d9a78f435 messagingapp/msgui/unifiedviewer/src/unifiedviewer.cpp --- a/messagingapp/msgui/unifiedviewer/src/unifiedviewer.cpp Wed Aug 18 00:46:12 2010 +0530 +++ b/messagingapp/msgui/unifiedviewer/src/unifiedviewer.cpp Tue Aug 31 18:53:38 2010 +0530 @@ -51,7 +51,7 @@ //DB-file _LIT(KDbFileName, "c:[2002A542]conversations.db"); // query to see if msg is forwardable -_LIT(KSelectMsgPropertyStmt, " SELECT message_id, msg_property FROM conversation_messages WHERE message_id=:message_id "); +_LIT(KSelectMsgPropertyStmt, " SELECT message_id, msg_property, msg_processingstate FROM conversation_messages WHERE message_id=:message_id "); //LOCALIZED CONSTANTS @@ -366,15 +366,36 @@ // read the flag TInt msgPropertyIndex = sqlSelectStmt.ColumnIndex(_L("msg_property")); + + TInt msgProcessingStateIndex = sqlSelectStmt.ColumnIndex( + _L("msg_processingstate")); + TInt retValue = 0; + TInt processingStateVal = 0; if (sqlSelectStmt.Next() == KSqlAtRow) { retValue = static_cast (sqlSelectStmt.ColumnInt(msgPropertyIndex)); - } + processingStateVal = static_cast + (sqlSelectStmt.ColumnInt(msgProcessingStateIndex)); + } + CleanupStack::PopAndDestroy(&sqlSelectStmt); sqlDb.Close(); - canForwardMsg = (retValue & EPreviewForward)? true:false; + + bool processing = (processingStateVal & EPreviewMsgProcessed)? true:false; + if(processing) + { + canForwardMsg = (retValue & EPreviewForward)? true:false; + } + else + { + // If message is still getting processed, forward field may not be updated in + // Preview DB, so get the forwardable state from MMS conformance checks... + MmsConformanceCheck* mmsConformanceCheck = new MmsConformanceCheck; + canForwardMsg = mmsConformanceCheck->validateMsgForForward(mMessageId); + delete mmsConformanceCheck; + } } else {