diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index 9c98c998f..c7fc6880e 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -6765,7 +6765,8 @@ void ContactsManager::on_update_user_online(UserId user_id, tl_object_ptrwas_online) { // only update was_online_remote_ from updateUserStatus + if (user_id == get_my_id() && + was_online_remote_ != u->was_online) { // only update was_online_remote_ from updateUserStatus was_online_remote_ = u->was_online; VLOG(notifications) << "Set was_online_remote to " << was_online_remote_; G()->td_db()->get_binlog_pmc()->set("my_was_online_remote", to_string(was_online_remote_)); diff --git a/tdutils/td/utils/filesystem.cpp b/tdutils/td/utils/filesystem.cpp index 220d015b3..5564295ff 100644 --- a/tdutils/td/utils/filesystem.cpp +++ b/tdutils/td/utils/filesystem.cpp @@ -84,6 +84,9 @@ static std::string clean_filename_part(Slice name, int max_length) { uint32 code; it = next_utf8_unsafe(it, &code, "clean_filename_part"); if (!is_ok(code)) { + if (prepare_search_character(code) == 0) { + continue; + } code = ' '; } if (new_name.empty() && (code == ' ' || code == '.')) { diff --git a/tdutils/td/utils/port/detail/KQueue.h b/tdutils/td/utils/port/detail/KQueue.h index 887bbf943..16d95158c 100644 --- a/tdutils/td/utils/port/detail/KQueue.h +++ b/tdutils/td/utils/port/detail/KQueue.h @@ -18,7 +18,7 @@ #include -#include // must be included before sys/event.h, which depends on sys/types.h on FreeBSD +#include // must be included before sys/event.h, which depends on sys/types.h on FreeBSD #include diff --git a/tdutils/test/filesystem.cpp b/tdutils/test/filesystem.cpp index a0a92c14e..ffc762825 100644 --- a/tdutils/test/filesystem.cpp +++ b/tdutils/test/filesystem.cpp @@ -38,4 +38,5 @@ TEST(Misc, clean_filename) { ASSERT_STREQ(clean_filename("test.exe01234567890123456789...."), "test.exe01234567890123456789"); // extension may be more then 20 characters ASSERT_STREQ(clean_filename("....test....asdf"), "test.asdf"); + ASSERT_STREQ(clean_filename("കറുപ്പ്.txt"), "കറപപ.txt"); }