messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/src/unieditorsmsplugin_p.cpp
equal
deleted
inserted
replaced
327 //Populate recipients |
327 //Populate recipients |
328 populateRecipientsL(aMessage); |
328 populateRecipientsL(aMessage); |
329 |
329 |
330 //Populate message body |
330 //Populate message body |
331 populateMessageBodyL(aMessage,msvEntry); |
331 populateMessageBodyL(aMessage,msvEntry); |
|
332 |
|
333 // read flag for reply-via-same-smsc usecase |
|
334 bool replyPath = SmsMtmL()->SmsHeader().Submit().ReplyPath(); |
|
335 aMessage->setReplyPath(replyPath); |
|
336 if(replyPath) |
|
337 { |
|
338 // save smsc in the message |
|
339 QString scaddress = XQConversions::s60DescToQString( |
|
340 SmsMtmL()->SmsHeader().Message().ServiceCenterAddress()); |
|
341 aMessage->setOriginatingSC(scaddress); |
|
342 } |
332 } |
343 } |
333 else if(aOperation == UniEditorPluginInterface::Forward) |
344 else if(aOperation == UniEditorPluginInterface::Forward) |
334 { |
345 { |
335 //Populate message body |
346 //Populate message body |
336 populateMessageBodyL(aMessage,msvEntry); |
347 populateMessageBodyL(aMessage,msvEntry); |
366 int err = KErrNone; |
377 int err = KErrNone; |
367 TRAP(err, |
378 TRAP(err, |
368 // set sms data |
379 // set sms data |
369 SetSmsDataL( message ); |
380 SetSmsDataL( message ); |
370 // set sms settings |
381 // set sms settings |
371 SetSmsSettingsL(); |
382 SetSmsSettingsL( message ); |
372 // save all changes for the entry |
383 // save all changes for the entry |
373 SmsMtmL()->SaveMessageL(); |
384 SmsMtmL()->SaveMessageL(); |
374 ); |
385 ); |
375 |
386 |
376 // delete the created drafts entry because error |
387 // delete the created drafts entry because error |
690 |
701 |
691 // ----------------------------------------------------------------------------- |
702 // ----------------------------------------------------------------------------- |
692 // SetSmsSettingsL |
703 // SetSmsSettingsL |
693 // @see header |
704 // @see header |
694 // ----------------------------------------------------------------------------- |
705 // ----------------------------------------------------------------------------- |
695 void UniEditorSmsPluginPrivate::SetSmsSettingsL() |
706 void UniEditorSmsPluginPrivate::SetSmsSettingsL(ConvergedMessage* message) |
696 { |
707 { |
697 CSmsSettings* sendOptions = CSmsSettings::NewL(); |
708 CSmsSettings* sendOptions = CSmsSettings::NewL(); |
698 CleanupStack::PushL( sendOptions ); |
709 CleanupStack::PushL( sendOptions ); |
699 |
710 |
700 // "ConvertToL" might be called right after constructor. |
711 // "ConvertToL" might be called right after constructor. |
726 CleanupStack::PopAndDestroy( account ); |
737 CleanupStack::PopAndDestroy( account ); |
727 |
738 |
728 sendOptions->SetDeliveryReport( defaultSettings->DeliveryReport() ); |
739 sendOptions->SetDeliveryReport( defaultSettings->DeliveryReport() ); |
729 sendOptions->SetSmsBearer( defaultSettings->SmsBearer() ); |
740 sendOptions->SetSmsBearer( defaultSettings->SmsBearer() ); |
730 sendOptions->SetValidityPeriod( defaultSettings->ValidityPeriod() ); |
741 sendOptions->SetValidityPeriod( defaultSettings->ValidityPeriod() ); |
731 sendOptions->SetReplyPath( defaultSettings->ReplyPath() ); |
742 sendOptions->SetReplyPath( message->replyPath() ); |
732 |
743 |
733 if (defaultSettings->CharacterSet() |
744 if (defaultSettings->CharacterSet() |
734 == TSmsDataCodingScheme::ESmsAlphabetUCS2) |
745 == TSmsDataCodingScheme::ESmsAlphabetUCS2) |
735 { |
746 { |
736 iCharSupportType = TUniSendingSettings::EUniCharSupportFull; |
747 iCharSupportType = TUniSendingSettings::EUniCharSupportFull; |
742 |
753 |
743 iSmsHeader->SetSmsSettingsL( *sendOptions ); |
754 iSmsHeader->SetSmsSettingsL( *sendOptions ); |
744 |
755 |
745 // Move all the stuff from iSmsHeader::SmsSettings to SmsMtm::SmsHeader::SmsSettings |
756 // Move all the stuff from iSmsHeader::SmsSettings to SmsMtm::SmsHeader::SmsSettings |
746 SmsMtmL()->SmsHeader( ).SetSmsSettingsL( *sendOptions ); |
757 SmsMtmL()->SmsHeader( ).SetSmsSettingsL( *sendOptions ); |
747 //If sc is existant then only set the default service center |
758 |
748 if(ValidateSCNumberL()) |
759 // if reply-path is present, then lets use it |
749 { |
760 if(message->replyPath()) |
|
761 { |
|
762 QString scaddress = message->originatingSC(); |
|
763 SmsMtmL()->SmsHeader( ).Message( ). |
|
764 SetServiceCenterAddressL( *XQConversions::qStringToS60Desc(scaddress) ); |
|
765 } |
|
766 else if(ValidateSCNumberL()) |
|
767 { // Or if default SC is existant then only set the default SC |
750 SmsMtmL()->SmsHeader( ).Message( ). |
768 SmsMtmL()->SmsHeader( ).Message( ). |
751 SetServiceCenterAddressL( defaultSettings->GetServiceCenter(defaultSettings->DefaultServiceCenter()).Address() ); |
769 SetServiceCenterAddressL( defaultSettings->GetServiceCenter(defaultSettings->DefaultServiceCenter()).Address() ); |
752 } |
770 } |
753 CleanupStack::PopAndDestroy(defaultSettings); |
771 CleanupStack::PopAndDestroy(defaultSettings); |
754 CleanupStack::PopAndDestroy( sendOptions ); |
772 CleanupStack::PopAndDestroy( sendOptions ); |
1915 if(!addr.isEmpty()) |
1933 if(!addr.isEmpty()) |
1916 { |
1934 { |
1917 ConvergedMessageAddress messageAddress(addr); |
1935 ConvergedMessageAddress messageAddress(addr); |
1918 aMessage->addToRecipient(messageAddress); |
1936 aMessage->addToRecipient(messageAddress); |
1919 } |
1937 } |
|
1938 // read flag for reply-via-same-smsc usecase |
|
1939 bool replyPath = SmsMtmL()->SmsHeader().Deliver().ReplyPath(); |
|
1940 aMessage->setReplyPath(replyPath); |
|
1941 if(replyPath) |
|
1942 { |
|
1943 // save smsc in the message |
|
1944 QString scaddress = XQConversions::s60DescToQString( |
|
1945 SmsMtmL()->SmsHeader().Deliver().ServiceCenterAddress()); |
|
1946 aMessage->setOriginatingSC(scaddress); |
|
1947 } |
1920 } |
1948 } |
1921 // else, for outgoing message, populate receiver address in To-field |
1949 // else, for outgoing message, populate receiver address in To-field |
1922 else if(smsPduType == CSmsPDU::ESmsSubmit) |
1950 else if(smsPduType == CSmsPDU::ESmsSubmit) |
1923 { |
1951 { |
1924 populateRecipientsL(aMessage); |
1952 populateRecipientsL(aMessage); |
1933 // resolve contact if alias is empty |
1961 // resolve contact if alias is empty |
1934 if(addr->alias().isEmpty()) |
1962 if(addr->alias().isEmpty()) |
1935 { |
1963 { |
1936 QString alias; |
1964 QString alias; |
1937 int count; |
1965 int count; |
1938 int localId = |
1966 if(-1 != MsgContactHandler::resolveContactDisplayName( |
1939 MsgContactHandler::resolveContactDisplayName( |
1967 addr->address(), alias, count)) |
1940 addr->address(), alias, count); |
1968 { |
1941 addr->setAlias(alias); |
1969 addr->setAlias(alias); |
|
1970 } |
1942 } |
1971 } |
1943 } |
1972 } |
1944 } |
1973 } |
1945 |
1974 |
1946 //--------------------------------------------------------------- |
1975 //--------------------------------------------------------------- |