From 156e9bf9027f6d8c6237219dde7c958c31d9e7cb Mon Sep 17 00:00:00 2001 From: Gent S Date: Sun, 13 Dec 2020 20:18:36 -0500 Subject: [PATCH] Fix newline characters being stripped from emails --- src/BuddyManager.cpp | 2 +- src/ChatManager.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/BuddyManager.cpp b/src/BuddyManager.cpp index c1dbdc9..ca581c4 100644 --- a/src/BuddyManager.cpp +++ b/src/BuddyManager.cpp @@ -767,7 +767,7 @@ void BuddyManager::emailSend(CNSocket* sock, CNPacketData* data) { U16toU8(plr->PCStyle.szFirstName), // SenderFirstName U16toU8(plr->PCStyle.szLastName), // SenderLastName ChatManager::sanitizeText(U16toU8(pkt->szSubject)), // SubjectLine - ChatManager::sanitizeText(U16toU8(pkt->szContent)), // MsgBody + ChatManager::sanitizeText(U16toU8(pkt->szContent), true), // MsgBody pkt->iCash, // Taros (uint64_t)getTimestamp(), // SendTime 0 // DeleteTime (unimplemented) diff --git a/src/ChatManager.cpp b/src/ChatManager.cpp index 2f011fa..c2b6941 100644 --- a/src/ChatManager.cpp +++ b/src/ChatManager.cpp @@ -936,7 +936,7 @@ std::string ChatManager::sanitizeText(std::string text, bool allowNewlines) { if (!allowNewlines && c == '\n') continue; - if (c >= ' ' && c <= '~') + if (c >= ' ' && c <= '~' || c == '\n') buf[i++] = c; } buf[i] = 0;