Fix newline characters being stripped from emails

This commit is contained in:
Gent S 2020-12-13 20:18:36 -05:00
parent c8ff130b78
commit 156e9bf902
2 changed files with 2 additions and 2 deletions

View File

@ -767,7 +767,7 @@ void BuddyManager::emailSend(CNSocket* sock, CNPacketData* data) {
U16toU8(plr->PCStyle.szFirstName), // SenderFirstName U16toU8(plr->PCStyle.szFirstName), // SenderFirstName
U16toU8(plr->PCStyle.szLastName), // SenderLastName U16toU8(plr->PCStyle.szLastName), // SenderLastName
ChatManager::sanitizeText(U16toU8(pkt->szSubject)), // SubjectLine ChatManager::sanitizeText(U16toU8(pkt->szSubject)), // SubjectLine
ChatManager::sanitizeText(U16toU8(pkt->szContent)), // MsgBody ChatManager::sanitizeText(U16toU8(pkt->szContent), true), // MsgBody
pkt->iCash, // Taros pkt->iCash, // Taros
(uint64_t)getTimestamp(), // SendTime (uint64_t)getTimestamp(), // SendTime
0 // DeleteTime (unimplemented) 0 // DeleteTime (unimplemented)

View File

@ -936,7 +936,7 @@ std::string ChatManager::sanitizeText(std::string text, bool allowNewlines) {
if (!allowNewlines && c == '\n') if (!allowNewlines && c == '\n')
continue; continue;
if (c >= ' ' && c <= '~') if (c >= ' ' && c <= '~' || c == '\n')
buf[i++] = c; buf[i++] = c;
} }
buf[i] = 0; buf[i] = 0;