Skip to content

Commit

Permalink
Merged from
Browse files Browse the repository at this point in the history
  • Loading branch information
imdesktop committed Oct 5, 2021
1 parent 87fbce5 commit d6bb606
Show file tree
Hide file tree
Showing 867 changed files with 49,934 additions and 16,968 deletions.
1,279 changes: 802 additions & 477 deletions CMakeLists.txt

Large diffs are not rendered by default.

11 changes: 4 additions & 7 deletions README.md
@@ -1,6 +1,5 @@
# Build instructions


## Windows Build Directions

From the root of project directory:
Expand All @@ -13,7 +12,7 @@ cd build
**Visual Studio 2019**:
```sh
# (also you can set Release instead Debug)
cmake .. -G "Visual Studio 16 2019" -A Win32 -DCMAKE_BUILD_TYPE=Release
cmake .. -DIM_QT_DYNAMIC=ON -G "Visual Studio 16 2019" -A Win32 -DCMAKE_BUILD_TYPE=Release

MSBuild.exe icq.sln /m /t:Rebuild /p:Configuration=Release /p:Platform=Win32 /nodeReuse:false
```
Expand All @@ -29,22 +28,20 @@ cd build
#### You can build project with Xcode or with make:
**Xcode**:
```sh
# (also you can set Release instead Debug)
cmake .. -G Xcode -DCMAKE_BUILD_TYPE=Debug
cmake .. -DIM_QT_DYNAMIC=ON -G Xcode -DCMAKE_BUILD_TYPE=Release
```
Open `build\icq.xcodeproj` and build it.

**make**:
```sh
# (also you can set Release instead Debug)
cmake .. -DCMAKE_BUILD_TYPE=Debug
cmake .. -DIM_QT_DYNAMIC=ON -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)
```

## Linux Build Directions
In order to build ICQ execute the following command line:
```sh
mkdir build && cd build
cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DLINUX_ARCH=64 && make -j$(nproc)
cmake .. -DIM_QT_DYNAMIC=ON -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DLINUX_ARCH=64 && make -j$(nproc)
```

8 changes: 2 additions & 6 deletions RELEASE_NOTES
@@ -1,6 +1,2 @@
— Added display of full file name in the chat and in the chat gallery on hover
— Added display of full username, chat or channel name on hover
— Made the "Show notifications when the application in focus" setting in Settings → Notifications
— Fixed crashes on Linux when playing some animated stickers
— Removed the display of your video when watching a screen sharing in the call window
— Other fixes and improvements
 — Updated colors for blue and dark blue themes
— Other fixes and improvements
9 changes: 9 additions & 0 deletions common.shared/common.h
Expand Up @@ -120,6 +120,15 @@ namespace build
#endif
}

constexpr bool has_webengine() noexcept
{
#if defined(HAS_WEB_ENGINE)
return true;
#else
return false;
#endif
}

}

namespace environment
Expand Down
57 changes: 43 additions & 14 deletions common.shared/config/config.cpp
Expand Up @@ -58,6 +58,7 @@ namespace config
std::pair(urls::profile, get_string(it->value, "profile")),
std::pair(urls::profile_agent, get_string(it->value, "profile_agent")),
std::pair(urls::auth_mail_ru, get_string(it->value, "auth_mail_ru")),
std::pair(urls::oauth2_mail_ru, get_string(it->value, "oauth2_mail_ru")),
std::pair(urls::r_mail_ru, get_string(it->value, "r_mail_ru")),
std::pair(urls::win_mail_ru, get_string(it->value, "win_mail_ru")),
std::pair(urls::read_msg, get_string(it->value, "read_msg")),
Expand Down Expand Up @@ -145,6 +146,7 @@ namespace config
std::pair(features::login_by_phone_allowed, get_bool(it->value, "login_by_phone_allowed")),
std::pair(features::login_by_mail_default, get_bool(it->value, "login_by_mail_default")),
std::pair(features::login_by_uin_allowed, get_bool(it->value, "login_by_uin_allowed")),
std::pair(features::login_by_oauth2_allowed, get_bool(it->value, "login_by_oauth2_allowed")),
std::pair(features::forgot_password, get_bool(it->value, "forgot_password")),
std::pair(features::explained_forgot_password, get_bool(it->value, "explained_forgot_password")),
std::pair(features::unknown_contacts, get_bool(it->value, "unknown_contacts")),
Expand All @@ -154,7 +156,7 @@ namespace config
std::pair(features::changeable_name, get_bool(it->value, "changeable_name")),
std::pair(features::avatar_change_allowed, get_bool(it->value, "avatar_change_allowed")),
std::pair(features::beta_update, get_bool(it->value, "beta_update")),
std::pair(features::ssl_verify_peer, get_bool(it->value, "ssl_verify_peer")),
std::pair(features::ssl_verify, get_bool(it->value, "ssl_verify")),
std::pair(features::profile_agent_as_domain_url, get_bool(it->value, "profile_agent_as_domain_url")),
std::pair(features::need_gdpr_window, get_bool(it->value, "need_gdpr_window")),
std::pair(features::need_introduce_window, get_bool(it->value, "need_introduce_window")),
Expand Down Expand Up @@ -198,10 +200,28 @@ namespace config
std::pair(features::custom_statuses_enabled, get_bool(it->value, "custom_statuses_enabled")),
std::pair(features::formatting_in_bubbles, get_bool(it->value, "formatting_in_bubbles")),
std::pair(features::formatting_in_input, get_bool(it->value, "formatting_in_input")),
std::pair(features::apps_bar_visible, get_bool(it->value, "apps_bar_visible")),
std::pair(features::tab_bar_visible, get_bool(it->value, "tab_bar_visible")),
std::pair(features::apps_bar_enabled, get_bool(it->value, "apps_bar_enabled")),
std::pair(features::status_in_apps_bar, get_bool(it->value, "status_in_apps_bar")),
std::pair(features::scheduled_messages_enabled, get_bool(it->value, "scheduled_messages_enabled")),
std::pair(features::threads_enabled, get_bool(it->value, "threads_enabled")),
std::pair(features::reminders_enabled, get_bool(it->value, "reminders_enabled")),
std::pair(features::support_shared_federation_stickerpacks, get_bool(it->value, "support_shared_federation_stickerpacks")),
std::pair(features::url_ftp_protocols_allowed, get_bool(it->value, "url_ftp_protocols_allowed")),
std::pair(features::organization_structure_enabled, get_bool(it->value, "organization_structure_enabled")),
std::pair(features::tasks_enabled, get_bool(it->value, "tasks_enabled")),
std::pair(features::draft_enabled, get_bool(it->value, "draft_enabled")),
std::pair(features::message_corner_menu, get_bool(it->value, "message_corner_menu")),
std::pair(features::task_creation_in_chat_enabled, get_bool(it->value, "task_creation_in_chat_enabled")),
std::pair(features::smartreply_suggests_feature_enabled, get_bool(it->value, "smartreply_suggests_feature_enabled")),
std::pair(features::smartreply_suggests_text, get_bool(it->value, "smartreply_suggests_text")),
std::pair(features::smartreply_suggests_stickers, get_bool(it->value, "smartreply_suggests_stickers")),
std::pair(features::smartreply_suggests_for_quotes, get_bool(it->value, "smartreply_suggests_for_quotes")),
std::pair(features::compact_mode_by_default, get_bool(it->value, "compact_mode_by_default")),
std::pair(features::expanded_gallery, get_bool(it->value, "expanded_gallery")),
std::pair(features::restricted_files_enabled, get_bool(it->value, "restricted_files_enabled")),
std::pair(features::antivirus_check_enabled, get_bool(it->value, "antivirus_check_enabled")),
std::pair(features::antivirus_check_progress_visible, get_bool(it->value, "antivirus_check_progress_visible")),
std::pair(features::calendar_enabled, get_bool(it->value, "calendar_enabled")),
};

if (std::is_sorted(std::cbegin(res), std::cend(res), is_less_by_first))
Expand All @@ -223,6 +243,8 @@ namespace config
std::pair(values::app_name_mac, get_string(it->value, "app_name_mac")),
std::pair(values::app_name_linux, get_string(it->value, "app_name_linux")),
std::pair(values::user_agent_app_name, get_string(it->value, "user_agent_app_name")),
std::pair(values::client_b64, get_string(it->value, "client_b64")),
std::pair(values::client_id, get_string(it->value, "client_id")),
std::pair(values::client_rapi, get_string(it->value, "client_rapi")),
std::pair(values::product_name, get_string(it->value, "product_name")),
std::pair(values::product_name_short, get_string(it->value, "product_name_short")),
Expand All @@ -237,7 +259,6 @@ namespace config
std::pair(values::installer_exe_win, get_string(it->value, "installer_exe_win")),
std::pair(values::installer_hkey_class_win, get_string(it->value, "installer_hkey_class_win")),
std::pair(values::installer_main_instance_mutex_win, get_string(it->value, "installer_main_instance_mutex_win")),
std::pair(values::updater_main_instance_mutex_win, get_string(it->value, "updater_main_instance_mutex_win")),
std::pair(values::company_name, get_string(it->value, "company_name")),
std::pair(values::app_user_model_win, get_string(it->value, "app_user_model_win")),
std::pair(values::feedback_version_id, get_string(it->value, "feedback_version_id")),
Expand Down Expand Up @@ -266,6 +287,11 @@ namespace config
std::pair(values::mytracker_app_id_mac, get_string(it->value, "mytracker_app_id_mac")),
std::pair(values::mytracker_app_id_linux, get_string(it->value, "mytracker_app_id_linux")),
std::pair(values::status_banner_emoji_csv, get_string(it->value, "status_banner_emoji_csv")),
std::pair(values::draft_timeout_sec, get_int64(it->value, "draft_timeout")),
std::pair(values::draft_max_len, get_int64(it->value, "draft_max_len")),
std::pair(values::smartreply_suggests_click_hide_timeout, get_int64(it->value, "smartreply_suggests_click_hide_timeout")),
std::pair(values::smartreply_suggests_msgid_cache_size, get_int64(it->value, "smartreply_suggests_msgid_cache_size")),
std::pair(values::base_retry_interval_sec, get_int64(it->value, "base_retry_interval_sec")),
};

if (std::is_sorted(std::cbegin(res), std::cend(res), is_less_by_first))
Expand Down Expand Up @@ -422,20 +448,23 @@ namespace config
auto local_config = configuration(config_json(), false);

#ifdef SUPPORT_EXTERNAL_CONFIG
if (auto v = local_config.value(platform::is_apple() ? values::product_path_mac : values::product_path); auto path = std::get_if<std::string>(&v))
if (!environment::is_release())
{
auto debug_config_path = core::utils::get_product_data_path(core::tools::from_utf8(*path));
if (const auto v = local_config.value(platform::is_apple() ? values::product_path_mac : values::product_path); const auto path = std::get_if<std::string>(&v))
{
const auto debug_config_path = core::utils::get_product_data_path(core::tools::from_utf8(*path));

boost::system::error_code error_code;
const auto extrenal_config_file_name = boost::filesystem::canonical(debug_config_path, Out error_code) / L"config.json";
boost::system::error_code error_code;
const auto extrenal_config_file_name = boost::filesystem::canonical(debug_config_path, Out error_code) / L"config.json";

if (error_code == boost::system::errc::success)
{
if (core::tools::binary_stream bstream; bstream.load_from_file(extrenal_config_file_name.wstring()))
if (boost::system::errc::success == error_code)
{
const auto size = bstream.available();
if (auto extrernal_config = configuration(std::string_view(bstream.read(size), size_t(size)), true); extrernal_config.is_valid())
return extrernal_config;
if (core::tools::binary_stream bstream; bstream.load_from_file(extrenal_config_file_name.wstring()))
{
const auto size = bstream.available();
if (auto extrernal_config = configuration(std::string_view(bstream.read(size), size_t(size)), true); extrernal_config.is_valid())
return extrernal_config;
}
}
}
}
Expand Down
36 changes: 31 additions & 5 deletions common.shared/config/config.h
Expand Up @@ -38,6 +38,7 @@ namespace config
login_by_phone_allowed,
login_by_mail_default,
login_by_uin_allowed,
login_by_oauth2_allowed,
forgot_password,
explained_forgot_password,
unknown_contacts,
Expand All @@ -47,7 +48,7 @@ namespace config
changeable_name,
avatar_change_allowed,
beta_update,
ssl_verify_peer,
ssl_verify,
profile_agent_as_domain_url,
need_gdpr_window,
need_introduce_window,
Expand Down Expand Up @@ -91,10 +92,28 @@ namespace config
custom_statuses_enabled,
formatting_in_bubbles,
formatting_in_input,
apps_bar_visible,
tab_bar_visible,
apps_bar_enabled,
status_in_apps_bar,
scheduled_messages_enabled,
threads_enabled,
reminders_enabled,
support_shared_federation_stickerpacks,
url_ftp_protocols_allowed,
organization_structure_enabled,
tasks_enabled,
draft_enabled,
message_corner_menu,
task_creation_in_chat_enabled,
smartreply_suggests_feature_enabled,
smartreply_suggests_text,
smartreply_suggests_stickers,
smartreply_suggests_for_quotes,
compact_mode_by_default,
expanded_gallery,
restricted_files_enabled,
antivirus_check_enabled,
antivirus_check_progress_visible,
calendar_enabled,

max_size
};
Expand All @@ -107,6 +126,7 @@ namespace config
profile,
profile_agent,
auth_mail_ru,
oauth2_mail_ru,
r_mail_ru,
win_mail_ru,
read_msg,
Expand Down Expand Up @@ -154,6 +174,8 @@ namespace config
app_name_mac,
app_name_linux,
user_agent_app_name,
client_b64,
client_id,
client_rapi,
product_name,
product_name_short,
Expand All @@ -168,7 +190,6 @@ namespace config
installer_exe_win,
installer_hkey_class_win,
installer_main_instance_mutex_win,
updater_main_instance_mutex_win,
company_name,
app_user_model_win,
feedback_version_id,
Expand Down Expand Up @@ -197,6 +218,11 @@ namespace config
mytracker_app_id_mac,
mytracker_app_id_linux,
status_banner_emoji_csv,
draft_timeout_sec,
draft_max_len,
smartreply_suggests_click_hide_timeout,
smartreply_suggests_msgid_cache_size,
base_retry_interval_sec,

max_size
};
Expand Down Expand Up @@ -275,7 +301,7 @@ namespace config
translations_array translations;
} c_;

bool is_debug_ = false;
const bool is_debug_ = false;
bool is_valid_ = false;

std::unique_ptr<common::tools::spin_lock> spin_lock_;
Expand Down
12 changes: 12 additions & 0 deletions common.shared/constants.h
@@ -1,6 +1,8 @@
#pragma once

#define auth_file_name "value.au"
#define oauth2_login_path "/login"
#define oauth2_token_path "/token"
#define settings_export_file_name "exported_ui.json"
#define core_settings_export_file_name "exported_core.json"
#define fetch_url_file_name "fetch"
Expand Down Expand Up @@ -61,8 +63,10 @@
#define settings_appearance_last_directory "appearance_last_wp_directory"
#define settings_fast_drop_search_results "fast_drop_search_results"
#define settings_exec_files_without_warning "exec_files_without_warning"
#define settings_open_external_link_without_warning "open_external_link_without_warning"
#define settings_show_calls_tab "settings_show_calls_tab"
#define settings_show_reactions "settings_show_reactions"
#define settings_warn_about_disabled_microphone "settings_warn_about_disabled_microphone"

#define settings_allow_statuses "settings_allow_statuses"

Expand All @@ -73,6 +77,7 @@ constexpr bool settings_show_smartreply_default() noexcept { return true; }
constexpr bool settings_spell_check_default() noexcept { return true; }
constexpr bool settings_fast_drop_search_default() noexcept { return false; }
constexpr bool settings_exec_files_without_warning_default() noexcept { return false; }
constexpr bool settings_open_external_link_without_warning_default() noexcept { return false; }
constexpr bool settings_keep_logged_in_default() noexcept { return true; }
constexpr bool settings_show_reactions_default() noexcept { return true; }
constexpr bool settings_allow_statuses_default() noexcept { return true; }
Expand Down Expand Up @@ -187,4 +192,11 @@ namespace feature
constexpr int default_voip_big_conference_boundary() noexcept { return 5; }

constexpr int default_dns_resolve_timeout_sec() noexcept { return 300; }

constexpr int default_draft_timeout_sec() noexcept { return 5; }
constexpr int default_draft_max_len() noexcept { return 10000; }

constexpr int default_smartreply_suggests_click_hide_timeout() noexcept { return 150; }
constexpr int default_smartreply_suggests_msgid_cache_size() noexcept { return 1; }
constexpr int default_base_retry_interval_sec() noexcept { return 1; }
}
File renamed without changes.

0 comments on commit d6bb606

Please sign in to comment.