void write(const Message &msg);
MsgId saveDraftMsg();
void editDraftMsg(MsgId id);
+ void createNewMsgThread();
void onNaviOkButtonClicked();
void onNaviCenterButtonClicked();
ConvRecipientsPanel *m_pRecipPanel;
ConvContactList *m_pContactsList;
ThreadId m_ThreadId;
+ MsgAddressListRef m_AddressList;
bool m_IsMms; // Compose message type
bool m_DispIsMms; // Last displayed message type for user.
Ecore_Idler *m_NnotifyConvertMsgTypeIdler;
void Conversation::setThreadId(ThreadId id, const std::string &searchWord)
{
m_ThreadId = id;
+ if(id.isValid())
+ m_AddressList = getMsgEngine().getStorage().getAddressList(id);
+ else
+ m_AddressList.reset();
+
setMode(m_ThreadId.isValid() ? ConversationMode : NewMessageMode);
if(m_pBody)
- {
- m_pBody->clear();
m_pBody->setMmsRecipFlag(getMsgEngine().getStorage().hasEmail(m_ThreadId));
- }
if(m_pRecipPanel)
- {
- m_pRecipPanel->clear();
m_pRecipPanel->update(m_ThreadId);
- }
+
if(m_pConvList)
- {
m_pConvList->setThreadId(m_ThreadId, searchWord);
- }
markAsRead();
checkAndSetMsgType();
MsgAddressListRef Conversation::getAddressList()
{
- return getMsgEngine().getStorage().getAddressList(m_ThreadId);
+ return m_AddressList ? m_AddressList : getMsgEngine().getStorage().getAddressList(m_ThreadId);
}
void Conversation::setMode(Mode mode)
m_pRecipPanel->update(m_ThreadId);
m_pRecipPanel->showMbe(!m_pRecipPanel->isMbeEmpty());
m_pRecipPanel->showEntry(true);
- m_pRecipPanel->setFocus(true);
+ m_pRecipPanel->setFocus(true); // TODO: Not bad to remove from here
}
void Conversation::setConversationMode()
{
createRecipPanel(*m_pLayout);
m_pRecipPanel->showEntry(false);
- m_pRecipPanel->update(*addressList);
+ m_pRecipPanel->update(addressList);
}
else
{
if(sendRes == MsgTransport::SendSuccess && m_ThreadId.isValid())
{
- if(m_Mode == NewMessageMode)
- setMode(ConversationMode);
-
- m_pConvList->setThreadId(m_ThreadId);
- m_IsMms = false;
+ setThreadId(m_ThreadId);
m_pMsgInputPanel->disabledButton(MessageInputPanel::SendButtonId, true);
m_pBody->clear();
}
}
}
+void Conversation::createNewMsgThread()
+{
+ MsgAddressListRef addressList = getAddressList();
+ setThreadId(ThreadId());
+ if(m_pRecipPanel)
+ m_pRecipPanel->update(addressList);
+}
+
void Conversation::notifyConvertMsgType()
{
if(!m_NnotifyConvertMsgTypeIdler)
{
MSG_LOG("");
item.getParent().destroy();
- setMode(NewMessageMode);
- m_ThreadId.reset();
+ createNewMsgThread();
+ if(m_pRecipPanel)
+ m_pRecipPanel->setEntryFocus(true);
}
void Conversation::onMakeVoiceItemPressed(PopupListItem &item)
if(m_Mode != NewMessageMode)
{
auto convList = getMsgEngine().getStorage().getConversationList(m_ThreadId);
- if(convList && convList->getLength() == 0)
- onHwBackButtonClicked();
+ if((convList && convList->getLength() == 0) || !convList)
+ {
+ if(m_pBody->isEmpty())
+ {
+ onHwBackButtonClicked();
+ }
+ else
+ {
+ // Current MsgThread is dead, so create new MsgThread from existing recipients.
+ createNewMsgThread();
+ m_pBody->setFocus(true);
+ }
+ }
}
}