diff --git a/example/web/tdweb/src/index.js b/example/web/tdweb/src/index.js index 94e92159..d79f3e2f 100644 --- a/example/web/tdweb/src/index.js +++ b/example/web/tdweb/src/index.js @@ -9,9 +9,9 @@ const sleep = ms => new Promise(res => setTimeout(res, ms)); * TDLib in browser * * TDLib can be used from javascript through the [JSON](https://github.com/tdlib/td#using-json) interface. - * This is a convenient wrapper around it. + * This is a convenient wrapper around it. * Internally it uses TDLib built with emscripten as asm.js or WebAssembly. All work happens in a WebWorker. - * TdClient itself just sends queries to WebWorker, recieve updates and results from WebWorker. + * TdClient itself just sends queries to WebWorker, receive updates and results from WebWorker. * *

* Differences from TDLib API
diff --git a/td/telegram/DocumentsManager.cpp b/td/telegram/DocumentsManager.cpp index e47ab748..09e43b86 100644 --- a/td/telegram/DocumentsManager.cpp +++ b/td/telegram/DocumentsManager.cpp @@ -136,7 +136,7 @@ std::pair DocumentsManager::on_get_docum if (animated != nullptr || default_document_type == DocumentType::Animation) { document_type = DocumentType::Animation; file_type = FileType::Animation; - default_extension = "mp4"; + default_extension = Slice("mp4"); } else if (audio != nullptr || default_document_type == DocumentType::Audio || default_document_type == DocumentType::VoiceNote) { bool is_voice_note = default_document_type == DocumentType::VoiceNote; @@ -146,17 +146,17 @@ std::pair DocumentsManager::on_get_docum if (is_voice_note) { document_type = DocumentType::VoiceNote; file_type = FileType::VoiceNote; - default_extension = "oga"; + default_extension = Slice("oga"); file_name.clear(); } else { document_type = DocumentType::Audio; file_type = FileType::Audio; - default_extension = "mp3"; + default_extension = Slice("mp3"); } } else if (sticker != nullptr || default_document_type == DocumentType::Sticker) { document_type = DocumentType::Sticker; file_type = FileType::Sticker; - default_extension = "webp"; + default_extension = Slice("webp"); owner_dialog_id = DialogId(); file_name.clear(); has_webp_thumbnail = td_->stickers_manager_->has_webp_thumbnail(sticker); @@ -177,7 +177,7 @@ std::pair DocumentsManager::on_get_docum document_type = DocumentType::Video; file_type = FileType::Video; } - default_extension = "mp4"; + default_extension = Slice("mp4"); } } else if (type_attributes >= 2) { LOG(WARNING) << "Receive document with more than 1 type attribute: animated = " << to_string(animated) diff --git a/td/telegram/net/Session.cpp b/td/telegram/net/Session.cpp index c7711223..171ab615 100644 --- a/td/telegram/net/Session.cpp +++ b/td/telegram/net/Session.cpp @@ -954,14 +954,14 @@ void Session::connection_open_finish(ConnectionInfo *info, Slice mode_name; if (mode_ == Mode::Tcp) { mode = mtproto::SessionConnection::Mode::Tcp; - mode_name = "Tcp"; + mode_name = Slice("Tcp"); } else { if (info->connection_id == 0) { mode = mtproto::SessionConnection::Mode::Http; - mode_name = "Http"; + mode_name = Slice("Http"); } else { mode = mtproto::SessionConnection::Mode::HttpLongPoll; - mode_name = "HttpLongPoll"; + mode_name = Slice("HttpLongPoll"); } } auto name = PSTRING() << get_name() << "::Connect::" << mode_name << "::" << raw_connection->debug_str_; diff --git a/tdactor/td/actor/impl/Scheduler-decl.h b/tdactor/td/actor/impl/Scheduler-decl.h index 95798e11..f8c86318 100644 --- a/tdactor/td/actor/impl/Scheduler-decl.h +++ b/tdactor/td/actor/impl/Scheduler-decl.h @@ -5,6 +5,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #pragma once + #include "td/actor/impl/Actor-decl.h" #include "td/actor/impl/ActorId-decl.h" #include "td/actor/impl/EventFull-decl.h" diff --git a/tdnet/td/net/HttpReader.cpp b/tdnet/td/net/HttpReader.cpp index ee312c41..7c4ccaf1 100644 --- a/tdnet/td/net/HttpReader.cpp +++ b/tdnet/td/net/HttpReader.cpp @@ -691,10 +691,10 @@ Status HttpReader::parse_head(MutableSlice head) { parser.skip('\n'); content_length_ = 0; - content_type_ = "application/octet-stream"; + content_type_ = Slice("application/octet-stream"); content_type_lowercased_ = content_type_.str(); - transfer_encoding_ = ""; - content_encoding_ = ""; + transfer_encoding_ = Slice(); + content_encoding_ = Slice(); query_->keep_alive_ = false; query_->headers_.clear(); diff --git a/tdutils/td/utils/HttpUrl.cpp b/tdutils/td/utils/HttpUrl.cpp index 5663045d..b66db14d 100644 --- a/tdutils/td/utils/HttpUrl.cpp +++ b/tdutils/td/utils/HttpUrl.cpp @@ -114,7 +114,7 @@ Result parse_url(MutableSlice url, HttpUrl::Protocol default_protocol) query.remove_suffix(1); } if (query.empty()) { - query = "/"; + query = Slice("/"); } string query_str; if (query[0] != '/') { diff --git a/tdutils/td/utils/check.cpp b/tdutils/td/utils/check.cpp index 824e817f..17525d61 100644 --- a/tdutils/td/utils/check.cpp +++ b/tdutils/td/utils/check.cpp @@ -7,6 +7,7 @@ #include "td/utils/check.h" #include "td/utils/logging.h" +#include "td/utils/Slice.h" namespace td { namespace detail { diff --git a/tdutils/td/utils/logging.cpp b/tdutils/td/utils/logging.cpp index 798678d2..dcfe564e 100644 --- a/tdutils/td/utils/logging.cpp +++ b/tdutils/td/utils/logging.cpp @@ -217,13 +217,13 @@ class DefaultLog : public LogInterface { switch (log_level) { case VERBOSITY_NAME(FATAL): case VERBOSITY_NAME(ERROR): - color = TC_RED; + color = Slice(TC_RED); break; case VERBOSITY_NAME(WARNING): - color = TC_YELLOW; + color = Slice(TC_YELLOW); break; case VERBOSITY_NAME(INFO): - color = TC_CYAN; + color = Slice(TC_CYAN); break; } TsCerr() << color << slice << TC_EMPTY;