49 const QString DELETE_ICON("qtg_mono_delete"); |
49 const QString DELETE_ICON("qtg_mono_delete"); |
50 |
50 |
51 //DB-file |
51 //DB-file |
52 _LIT(KDbFileName, "c:[2002A542]conversations.db"); |
52 _LIT(KDbFileName, "c:[2002A542]conversations.db"); |
53 // query to see if msg is forwardable |
53 // query to see if msg is forwardable |
54 _LIT(KSelectMsgPropertyStmt, " SELECT message_id, msg_property FROM conversation_messages WHERE message_id=:message_id "); |
54 _LIT(KSelectMsgPropertyStmt, " SELECT message_id, msg_property, msg_processingstate FROM conversation_messages WHERE message_id=:message_id "); |
55 |
55 |
56 |
56 |
57 //LOCALIZED CONSTANTS |
57 //LOCALIZED CONSTANTS |
58 #define LOC_DELETE_MESSAGE hbTrId("txt_messaging_dialog_delete_message") |
58 #define LOC_DELETE_MESSAGE hbTrId("txt_messaging_dialog_delete_message") |
59 #define LOC_DELETE_SHARED_MESSAGE hbTrId("txt_messaging_dialog_same_message_exists_in_multip") |
59 #define LOC_DELETE_SHARED_MESSAGE hbTrId("txt_messaging_dialog_same_message_exists_in_multip") |
364 TInt msgIdIndex = sqlSelectStmt.ParameterIndex(_L(":message_id")); |
364 TInt msgIdIndex = sqlSelectStmt.ParameterIndex(_L(":message_id")); |
365 sqlSelectStmt.BindInt(msgIdIndex, mMessageId); |
365 sqlSelectStmt.BindInt(msgIdIndex, mMessageId); |
366 // read the flag |
366 // read the flag |
367 TInt msgPropertyIndex = |
367 TInt msgPropertyIndex = |
368 sqlSelectStmt.ColumnIndex(_L("msg_property")); |
368 sqlSelectStmt.ColumnIndex(_L("msg_property")); |
|
369 |
|
370 TInt msgProcessingStateIndex = sqlSelectStmt.ColumnIndex( |
|
371 _L("msg_processingstate")); |
|
372 |
369 TInt retValue = 0; |
373 TInt retValue = 0; |
|
374 TInt processingStateVal = 0; |
370 if (sqlSelectStmt.Next() == KSqlAtRow) |
375 if (sqlSelectStmt.Next() == KSqlAtRow) |
371 { |
376 { |
372 retValue = static_cast<TInt> |
377 retValue = static_cast<TInt> |
373 (sqlSelectStmt.ColumnInt(msgPropertyIndex)); |
378 (sqlSelectStmt.ColumnInt(msgPropertyIndex)); |
374 } |
379 processingStateVal = static_cast<TInt> |
|
380 (sqlSelectStmt.ColumnInt(msgProcessingStateIndex)); |
|
381 } |
|
382 |
375 CleanupStack::PopAndDestroy(&sqlSelectStmt); |
383 CleanupStack::PopAndDestroy(&sqlSelectStmt); |
376 sqlDb.Close(); |
384 sqlDb.Close(); |
377 canForwardMsg = (retValue & EPreviewForward)? true:false; |
385 |
|
386 bool processing = (processingStateVal & EPreviewMsgProcessed)? true:false; |
|
387 if(processing) |
|
388 { |
|
389 canForwardMsg = (retValue & EPreviewForward)? true:false; |
|
390 } |
|
391 else |
|
392 { |
|
393 // If message is still getting processed, forward field may not be updated in |
|
394 // Preview DB, so get the forwardable state from MMS conformance checks... |
|
395 MmsConformanceCheck* mmsConformanceCheck = new MmsConformanceCheck; |
|
396 canForwardMsg = mmsConformanceCheck->validateMsgForForward(mMessageId); |
|
397 delete mmsConformanceCheck; |
|
398 } |
378 } |
399 } |
379 else |
400 else |
380 { |
401 { |
381 // fall-back plan |
402 // fall-back plan |
382 MmsConformanceCheck* mmsConformanceCheck = new MmsConformanceCheck; |
403 MmsConformanceCheck* mmsConformanceCheck = new MmsConformanceCheck; |