Skip to content

Commit

Permalink
Fixed bugs with email
Browse files Browse the repository at this point in the history
  • Loading branch information
kirill555101 committed Dec 20, 2021
1 parent 29e972e commit fe346a8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
4 changes: 1 addition & 3 deletions project/server_lib/workers/src/client_connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <mailio/message.hpp>
#include <mailio/smtp.hpp>
#include <fmt/core.h>
#include <regex>

#define CLIENT_SEC_TIMEOUT 180
#define LENGTH_LINE_FOR_RESERVE 256
Expand Down Expand Up @@ -155,15 +154,14 @@ bool ClientConnection::send_message_on_email(size_t step) {
std::string line;
while(std::getline(file, line))
{
html += line;
html.append(line + "\r\n");
}
file.close();

if (this->request.get_headers()["command"] == "upload") {
if (this->request.get_headers().find("content-length") != this->request.get_headers().end() &&
!this->request.get_headers()["jwt"].empty()) {
html = fmt::format(html, this->request.get_headers()["filename"]);
html = std::regex_replace(html, std::regex(" "), "\r\n");
} else {
html = fmt::format(
html,
Expand Down
5 changes: 2 additions & 3 deletions static/auth_code.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
<h1>VVT-i</h1>
</div>

Hello!
Thanks for using VVT-i online storage!
If you have any questions, you can write back on <a href="mailto:[email protected]">[email protected]</a>
<h3>Thanks for using our online storage!</h3>
If you have any questions, you can write back on <a href="mailto:[email protected]">[email protected]</a>.

<p>
Now you can get <span style="font-style: italic;">{}</span>.
Expand Down
9 changes: 5 additions & 4 deletions static/not_auth_code.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@
<h1>VVT-i</h1>
</div>

Hello!
Thanks for using VVT-i online storage!
If you have any questions you can write back on <a href="mailto:[email protected]">[email protected]</a>
<h3>Thanks for using our online storage!</h3>
If you have any questions you can write back on <a href="mailto:[email protected]">[email protected]</a>.

<p>
Here is your code to get <span style="font-style: italic;">{}</span>.
</p>

<div style="width: 250px; padding: 15px; background: yellowgreen; border-radius: 10px;">
<div
style="width: 250px; padding: 15px; background: yellowgreen; border-radius: 10px;"
>
{}
</div>
</body>
Expand Down
5 changes: 2 additions & 3 deletions static/registration.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
<h1>VVT-i</h1>
</div>

Hello!
Thanks for registration!
If you have any questions, you can write back on <a href="mailto:[email protected]">[email protected]</a>
<h3>Thanks for registration!</h3>
If you have any questions, you can write back on <a href="mailto:[email protected]">[email protected]</a>.

<p>
Now you can use your login and password to access VVT-i online storage.
Expand Down

0 comments on commit fe346a8

Please sign in to comment.