mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-07 06:02:41 -04:00
fixed utf8 issues in sending cert by email (patch from asamK #3393826)
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4615 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
ad4b0153b2
commit
4111740cb6
1 changed files with 10 additions and 10 deletions
|
@ -354,7 +354,7 @@ void TextPage::updateOwnCert()
|
||||||
//============================================================================
|
//============================================================================
|
||||||
//
|
//
|
||||||
|
|
||||||
static void sendMail (std::string sAddress, std::string sSubject, std::string sBody)
|
static void sendMail (QString sAddress, QString sSubject, QString sBody)
|
||||||
{
|
{
|
||||||
#ifdef Q_WS_WIN
|
#ifdef Q_WS_WIN
|
||||||
/* search and replace the end of lines with: "%0D%0A" */
|
/* search and replace the end of lines with: "%0D%0A" */
|
||||||
|
@ -364,20 +364,20 @@ static void sendMail (std::string sAddress, std::string sSubject, std::string sB
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::string mailstr = "mailto:" + sAddress;
|
QUrl url = QUrl("mailto:" + sAddress);
|
||||||
mailstr += "?subject=" + sSubject;
|
url.addEncodedQueryItem("subject", QUrl::toPercentEncoding(sSubject));
|
||||||
mailstr += "&body=" + sBody;
|
url.addEncodedQueryItem("body", QUrl::toPercentEncoding(sBody));
|
||||||
|
|
||||||
std::cerr << "MAIL STRING:" << mailstr.c_str() << std::endl;
|
std::cerr << "MAIL STRING:" << (std::string)url.toEncoded().constData() << std::endl;
|
||||||
|
|
||||||
/* pass the url directly to QDesktopServices::openUrl */
|
/* pass the url directly to QDesktopServices::openUrl */
|
||||||
QDesktopServices::openUrl (QUrl (QString::fromUtf8(mailstr.c_str())));
|
QDesktopServices::openUrl (url);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
TextPage::runEmailClient()
|
TextPage::runEmailClient()
|
||||||
{
|
{
|
||||||
sendMail ("", tr("RetroShare Invite").toStdString(), userCertEdit->toPlainText().toStdString());
|
sendMail ("", tr("RetroShare Invite"), userCertEdit->toPlainText());
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextPage::cleanFriendCert()
|
void TextPage::cleanFriendCert()
|
||||||
|
@ -1300,10 +1300,10 @@ bool EmailPage::validatePage()
|
||||||
|
|
||||||
if (mailaddresses.isEmpty() == false)
|
if (mailaddresses.isEmpty() == false)
|
||||||
{
|
{
|
||||||
std::string body = inviteTextEdit->toPlainText().toStdString();
|
QString body = inviteTextEdit->toPlainText();
|
||||||
body += "\n\n" + rsPeers->GetRetroshareInvite(false);
|
body += "\n\n" + QString::fromUtf8(rsPeers->GetRetroshareInvite(false).c_str());
|
||||||
|
|
||||||
sendMail (mailaddresses.toStdString(), subjectEdit->text().toStdString(), body);
|
sendMail (mailaddresses, subjectEdit->text(), body);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue