Compare commits
27 Commits
v2.7.8
...
linux_webv
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
672aacd528 | ||
|
|
1a5e807fa9 | ||
|
|
f98f4f0d14 | ||
|
|
78def16ced | ||
|
|
cd7b3419de | ||
|
|
dc4048f1c1 | ||
|
|
bef5320163 | ||
|
|
9a722ea8d4 | ||
|
|
1aefada45d | ||
|
|
f5a8bf0e74 | ||
|
|
738439c334 | ||
|
|
8949c9969b | ||
|
|
cdf6fb1512 | ||
|
|
fb0ea59ff3 | ||
|
|
36f5be60f4 | ||
|
|
46508f7e5e | ||
|
|
28137dfb60 | ||
|
|
e7784620d3 | ||
|
|
462986e9c3 | ||
|
|
c11de2380e | ||
|
|
a432e826a6 | ||
|
|
ea9e85e70f | ||
|
|
d3829c52ec | ||
|
|
9f04570335 | ||
|
|
3c486522a7 | ||
|
|
07cd8c4e83 | ||
|
|
7447c6ea75 |
3
.gitattributes
vendored
@@ -4,6 +4,3 @@
|
||||
# Ensure diffs have LF endings
|
||||
*.diff text eol=lf
|
||||
*.bat text eol=crlf
|
||||
|
||||
# Ensure lottie animations are treated as binary files
|
||||
*.lottie binary
|
||||
|
||||
2
.github/stale.yml
vendored
@@ -3,7 +3,7 @@ daysUntilStale: 180
|
||||
# Number of days of inactivity before a stale issue is closed
|
||||
daysUntilClose: 30
|
||||
# Issues with these labels will never be considered stale
|
||||
exemptLabels: [ "enhancement" ]
|
||||
exemptLabels: []
|
||||
# Label to use when marking an issue as stale
|
||||
staleLabel: stale
|
||||
# Comment to post when marking an issue as stale. Set to `false` to disable
|
||||
|
||||
14
.github/workflows/mac.yml
vendored
@@ -205,16 +205,6 @@ jobs:
|
||||
cd $LibrariesPath
|
||||
sudo cp -R opus-cache/. /
|
||||
|
||||
- name: Rnnoise.
|
||||
run: |
|
||||
cd $LibrariesPath
|
||||
|
||||
git clone $GIT/desktop-app/rnnoise.git
|
||||
mkdir -p rnnoise/out/Debug
|
||||
cd rnnoise/out/Debug
|
||||
cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug ../..
|
||||
ninja
|
||||
|
||||
- name: Libiconv cache.
|
||||
id: cache-libiconv
|
||||
uses: actions/cache@v2
|
||||
@@ -250,7 +240,7 @@ jobs:
|
||||
|
||||
git clone $GIT/FFmpeg/FFmpeg.git ffmpeg
|
||||
cd ffmpeg
|
||||
git checkout release/4.4
|
||||
git checkout release/4.2
|
||||
CFLAGS=`freetype-config --cflags`
|
||||
LDFLAGS=`freetype-config --libs`
|
||||
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/usr/X11/lib/pkgconfig
|
||||
@@ -327,6 +317,7 @@ jobs:
|
||||
--enable-decoder=pcm_u32be \
|
||||
--enable-decoder=pcm_u32le \
|
||||
--enable-decoder=pcm_u8 \
|
||||
--enable-decoder=pcm_zork \
|
||||
--enable-decoder=vorbis \
|
||||
--enable-decoder=wavpack \
|
||||
--enable-decoder=wmalossless \
|
||||
@@ -499,7 +490,6 @@ jobs:
|
||||
cmake -G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=Debug \
|
||||
-DTG_OWT_SPECIAL_TARGET=mac \
|
||||
-DTG_OWT_BUILD_AUDIO_BACKENDS=OFF \
|
||||
-DTG_OWT_LIBJPEG_INCLUDE_PATH=$PREFIX/include \
|
||||
-DTG_OWT_OPENSSL_INCLUDE_PATH=`pwd`/../../../openssl_$OPENSSL_VER/include \
|
||||
-DTG_OWT_OPUS_INCLUDE_PATH=$PREFIX/include/opus \
|
||||
|
||||
24
.github/workflows/win.yml
vendored
@@ -114,11 +114,6 @@ jobs:
|
||||
- name: Choco installs.
|
||||
run: choco install --no-progress -y nasm yasm jom ninja
|
||||
|
||||
- name: NuGet sources.
|
||||
run: |
|
||||
nuget sources Disable -Name "Microsoft Visual Studio Offline Packages"
|
||||
nuget sources Add -Source https://api.nuget.org/v3/index.json & exit 0
|
||||
|
||||
- name: Patches.
|
||||
shell: bash
|
||||
run: |
|
||||
@@ -284,17 +279,6 @@ jobs:
|
||||
msbuild -m opus.sln /property:Configuration=Debug /property:Platform="Win32"
|
||||
msbuild -m opus.sln /property:Configuration=Release /property:Platform="Win32"
|
||||
|
||||
- name: Rnnoise.
|
||||
shell: cmd
|
||||
run: |
|
||||
%VC%
|
||||
|
||||
git clone %GIT%/desktop-app/rnnoise.git
|
||||
mkdir rnnoise\out
|
||||
cd rnnoise\out
|
||||
cmake -A Win32 ..
|
||||
cmake --build . --config Debug
|
||||
|
||||
- name: FFmpeg cache.
|
||||
id: cache-ffmpeg
|
||||
uses: actions/cache@v2
|
||||
@@ -309,7 +293,7 @@ jobs:
|
||||
|
||||
git clone %GIT%/FFmpeg/FFmpeg.git ffmpeg
|
||||
cd ffmpeg
|
||||
git checkout release/4.4
|
||||
git checkout release/4.2
|
||||
set CHERE_INVOKING=enabled_from_arguments
|
||||
set MSYS2_PATH_TYPE=inherit
|
||||
call c:\tools\msys64\usr\bin\bash --login ../patches/build_ffmpeg_win.sh
|
||||
@@ -348,7 +332,7 @@ jobs:
|
||||
-confirm-license ^
|
||||
-static ^
|
||||
-static-runtime -I "%SSL%\include" ^
|
||||
-opengl dynamic ^
|
||||
-no-opengl ^
|
||||
-openssl-linked ^
|
||||
OPENSSL_LIBS_DEBUG="%SSL%\out32.dbg\libssl.lib %SSL%\out32.dbg\%LIBS%" ^
|
||||
OPENSSL_LIBS_RELEASE="%SSL%\out32\libssl.lib %SSL%\out32\%LIBS%" ^
|
||||
@@ -388,7 +372,6 @@ jobs:
|
||||
cmake -G Ninja ^
|
||||
-DCMAKE_BUILD_TYPE=Debug ^
|
||||
-DTG_OWT_SPECIAL_TARGET=win ^
|
||||
-DTG_OWT_BUILD_AUDIO_BACKENDS=OFF ^
|
||||
-DTG_OWT_LIBJPEG_INCLUDE_PATH=%cd%/../../../mozjpeg ^
|
||||
-DTG_OWT_OPENSSL_INCLUDE_PATH=%cd%/../../../openssl_%OPENSSL_VER%/include ^
|
||||
-DTG_OWT_OPUS_INCLUDE_PATH=%cd%/../../../opus/include ^
|
||||
@@ -417,9 +400,6 @@ jobs:
|
||||
fi
|
||||
echo "TDESKTOP_BUILD_DEFINE=$DEFINE" >> $GITHUB_ENV
|
||||
|
||||
- name: Free up some disk space.
|
||||
run: del /S *.pdb
|
||||
|
||||
- name: Telegram Desktop build.
|
||||
if: env.ONLY_CACHE == 'false'
|
||||
run: |
|
||||
|
||||
2
.gitignore
vendored
@@ -48,5 +48,3 @@ stage
|
||||
/Linux/
|
||||
/Telegram/Makefile
|
||||
*.*~
|
||||
.idea/
|
||||
cmake-build-debug/
|
||||
|
||||
6
.gitmodules
vendored
@@ -91,9 +91,3 @@
|
||||
[submodule "Telegram/lib_webview"]
|
||||
path = Telegram/lib_webview
|
||||
url = https://github.com/desktop-app/lib_webview.git
|
||||
[submodule "Telegram/ThirdParty/mallocng"]
|
||||
path = Telegram/ThirdParty/mallocng
|
||||
url = https://github.com/desktop-app/mallocng.git
|
||||
[submodule "Telegram/lib_waylandshells"]
|
||||
path = Telegram/lib_waylandshells
|
||||
url = https://github.com/desktop-app/lib_waylandshells.git
|
||||
|
||||
10
README.md
@@ -15,8 +15,7 @@ The source code is published under GPLv3 with OpenSSL exception, the license is
|
||||
|
||||
The latest version is available for
|
||||
|
||||
* [Windows 7 and above (64 bit)](https://telegram.org/dl/desktop/win64) ([portable](https://telegram.org/dl/desktop/win64_portable))
|
||||
* [Windows 7 and above (32 bit)](https://telegram.org/dl/desktop/win) ([portable](https://telegram.org/dl/desktop/win_portable))
|
||||
* [Windows 7 and above](https://telegram.org/dl/desktop/win) ([portable](https://telegram.org/dl/desktop/win_portable))
|
||||
* [macOS 10.12 and above](https://telegram.org/dl/desktop/mac)
|
||||
* [Linux static build for 64 bit](https://telegram.org/dl/desktop/linux)
|
||||
* [Snap](https://snapcraft.io/telegram-desktop)
|
||||
@@ -53,7 +52,7 @@ Version **1.8.15** was the last that supports older systems
|
||||
* Guideline Support Library ([MIT License](https://github.com/Microsoft/GSL/blob/master/LICENSE))
|
||||
* Range-v3 ([Boost License](https://github.com/ericniebler/range-v3/blob/master/LICENSE.txt))
|
||||
* Open Sans font ([Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0.html))
|
||||
* Vazir font ([SIL Open Font License 1.1](https://github.com/rastikerdar/vazir-font/blob/master/OFL.txt))
|
||||
* Vazir font ([License](https://github.com/rastikerdar/vazir-font/blob/master/LICENSE))
|
||||
* Emoji alpha codes ([MIT License](https://github.com/emojione/emojione/blob/master/extras/alpha-codes/LICENSE.md))
|
||||
* Catch test framework ([Boost License](https://github.com/philsquared/Catch/blob/master/LICENSE.txt))
|
||||
* xxHash ([BSD License](https://github.com/Cyan4973/xxHash/blob/dev/LICENSE))
|
||||
@@ -63,7 +62,7 @@ Version **1.8.15** was the last that supports older systems
|
||||
|
||||
## Build instructions
|
||||
|
||||
* Visual Studio 2019 [(32 bits)][msvc32] [(64 bits)][msvc64]
|
||||
* [Visual Studio 2019][msvc]
|
||||
* [Xcode 12][xcode]
|
||||
* [CMake on GNU/Linux][cmake]
|
||||
|
||||
@@ -73,8 +72,7 @@ Version **1.8.15** was the last that supports older systems
|
||||
[telegram_api]: https://core.telegram.org
|
||||
[telegram_proto]: https://core.telegram.org/mtproto
|
||||
[license]: LICENSE
|
||||
[msvc32]: docs/building-msvc.md
|
||||
[msvc64]: docs/building-msvc-x64.md
|
||||
[msvc]: docs/building-msvc.md
|
||||
[xcode]: docs/building-xcode.md
|
||||
[xcode_old]: docs/building-xcode-old.md
|
||||
[cmake]: docs/building-cmake.md
|
||||
|
||||
@@ -18,9 +18,6 @@ endif()
|
||||
add_subdirectory(lib_storage)
|
||||
add_subdirectory(lib_lottie)
|
||||
add_subdirectory(lib_qr)
|
||||
if (LINUX AND NOT DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION)
|
||||
add_subdirectory(lib_waylandshells)
|
||||
endif()
|
||||
add_subdirectory(lib_webrtc)
|
||||
add_subdirectory(lib_webview)
|
||||
add_subdirectory(codegen)
|
||||
@@ -40,11 +37,6 @@ include(cmake/td_scheme.cmake)
|
||||
include(cmake/td_ui.cmake)
|
||||
include(cmake/generate_appdata_changelog.cmake)
|
||||
|
||||
if (WIN32)
|
||||
include(cmake/generate_midl.cmake)
|
||||
generate_midl(Telegram ${src_loc}/platform/win/windows_quiethours.idl)
|
||||
endif()
|
||||
|
||||
set_target_properties(Telegram PROPERTIES AUTOMOC ON AUTORCC ON)
|
||||
|
||||
target_link_libraries(Telegram
|
||||
@@ -92,7 +84,6 @@ elseif (LINUX)
|
||||
PRIVATE
|
||||
desktop-app::external_glibmm
|
||||
desktop-app::external_glib
|
||||
desktop-app::external_mallocng
|
||||
)
|
||||
|
||||
if (NOT DESKTOP_APP_DISABLE_DBUS_INTEGRATION)
|
||||
@@ -113,7 +104,6 @@ elseif (LINUX)
|
||||
if (NOT DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION)
|
||||
target_link_libraries(Telegram
|
||||
PRIVATE
|
||||
desktop-app::lib_waylandshells
|
||||
desktop-app::external_kwayland
|
||||
)
|
||||
endif()
|
||||
@@ -276,39 +266,23 @@ PRIVATE
|
||||
boxes/url_auth_box.h
|
||||
boxes/username_box.cpp
|
||||
boxes/username_box.h
|
||||
calls/group/calls_choose_join_as.cpp
|
||||
calls/group/calls_choose_join_as.h
|
||||
calls/group/calls_group_call.cpp
|
||||
calls/group/calls_group_call.h
|
||||
calls/group/calls_group_common.h
|
||||
calls/group/calls_group_invite_controller.cpp
|
||||
calls/group/calls_group_invite_controller.h
|
||||
calls/group/calls_group_members.cpp
|
||||
calls/group/calls_group_members.h
|
||||
calls/group/calls_group_members_row.cpp
|
||||
calls/group/calls_group_members_row.h
|
||||
calls/group/calls_group_menu.cpp
|
||||
calls/group/calls_group_menu.h
|
||||
calls/group/calls_group_panel.cpp
|
||||
calls/group/calls_group_panel.h
|
||||
calls/group/calls_group_settings.cpp
|
||||
calls/group/calls_group_settings.h
|
||||
calls/group/calls_group_toasts.cpp
|
||||
calls/group/calls_group_toasts.h
|
||||
calls/group/calls_group_viewport.cpp
|
||||
calls/group/calls_group_viewport.h
|
||||
calls/group/calls_group_viewport_opengl.cpp
|
||||
calls/group/calls_group_viewport_opengl.h
|
||||
calls/group/calls_group_viewport_raster.cpp
|
||||
calls/group/calls_group_viewport_raster.h
|
||||
calls/group/calls_group_viewport_tile.cpp
|
||||
calls/group/calls_group_viewport_tile.h
|
||||
calls/group/calls_volume_item.cpp
|
||||
calls/group/calls_volume_item.h
|
||||
calls/calls_box_controller.cpp
|
||||
calls/calls_box_controller.h
|
||||
calls/calls_call.cpp
|
||||
calls/calls_call.h
|
||||
calls/calls_choose_join_as.cpp
|
||||
calls/calls_choose_join_as.h
|
||||
calls/calls_group_call.cpp
|
||||
calls/calls_group_call.h
|
||||
calls/calls_group_common.h
|
||||
calls/calls_group_members.cpp
|
||||
calls/calls_group_members.h
|
||||
calls/calls_group_menu.cpp
|
||||
calls/calls_group_menu.h
|
||||
calls/calls_group_panel.cpp
|
||||
calls/calls_group_panel.h
|
||||
calls/calls_group_settings.cpp
|
||||
calls/calls_group_settings.h
|
||||
calls/calls_emoji_fingerprint.cpp
|
||||
calls/calls_emoji_fingerprint.h
|
||||
calls/calls_instance.cpp
|
||||
@@ -323,8 +297,8 @@ PRIVATE
|
||||
calls/calls_userpic.h
|
||||
calls/calls_video_bubble.cpp
|
||||
calls/calls_video_bubble.h
|
||||
calls/calls_video_incoming.cpp
|
||||
calls/calls_video_incoming.h
|
||||
calls/calls_volume_item.cpp
|
||||
calls/calls_volume_item.h
|
||||
chat_helpers/bot_keyboard.cpp
|
||||
chat_helpers/bot_keyboard.h
|
||||
chat_helpers/emoji_keywords.cpp
|
||||
@@ -446,8 +420,6 @@ PRIVATE
|
||||
data/data_notify_settings.h
|
||||
data/data_peer.cpp
|
||||
data/data_peer.h
|
||||
data/data_peer_id.cpp
|
||||
data/data_peer_id.h
|
||||
data/data_peer_values.cpp
|
||||
data/data_peer_values.h
|
||||
data/data_photo.cpp
|
||||
@@ -729,8 +701,6 @@ PRIVATE
|
||||
main/main_session.h
|
||||
main/main_session_settings.cpp
|
||||
main/main_session_settings.h
|
||||
media/system_media_controls_manager.h
|
||||
media/system_media_controls_manager.cpp
|
||||
media/audio/media_audio.cpp
|
||||
media/audio/media_audio.h
|
||||
media/audio/media_audio_capture.cpp
|
||||
@@ -785,20 +755,10 @@ PRIVATE
|
||||
media/streaming/media_streaming_video_track.h
|
||||
media/view/media_view_group_thumbs.cpp
|
||||
media/view/media_view_group_thumbs.h
|
||||
media/view/media_view_overlay_opengl.cpp
|
||||
media/view/media_view_overlay_opengl.h
|
||||
media/view/media_view_overlay_raster.cpp
|
||||
media/view/media_view_overlay_raster.h
|
||||
media/view/media_view_overlay_renderer.h
|
||||
media/view/media_view_overlay_widget.cpp
|
||||
media/view/media_view_overlay_widget.h
|
||||
media/view/media_view_pip.cpp
|
||||
media/view/media_view_pip.h
|
||||
media/view/media_view_pip_opengl.cpp
|
||||
media/view/media_view_pip_opengl.h
|
||||
media/view/media_view_pip_raster.cpp
|
||||
media/view/media_view_pip_raster.h
|
||||
media/view/media_view_pip_renderer.h
|
||||
media/view/media_view_playback_controls.cpp
|
||||
media/view/media_view_playback_controls.h
|
||||
media/view/media_view_playback_progress.cpp
|
||||
@@ -863,15 +823,15 @@ PRIVATE
|
||||
platform/linux/linux_gsd_media_keys.h
|
||||
platform/linux/linux_gtk_file_dialog.cpp
|
||||
platform/linux/linux_gtk_file_dialog.h
|
||||
platform/linux/linux_gtk_integration_dummy.cpp
|
||||
platform/linux/linux_gtk_integration_p.h
|
||||
platform/linux/linux_gtk_integration.cpp
|
||||
platform/linux/linux_gtk_integration.h
|
||||
platform/linux/linux_gtk_open_with_dialog.cpp
|
||||
platform/linux/linux_gtk_open_with_dialog.h
|
||||
platform/linux/linux_mpris_support.cpp
|
||||
platform/linux/linux_mpris_support.h
|
||||
platform/linux/linux_notification_service_watcher.cpp
|
||||
platform/linux/linux_notification_service_watcher.h
|
||||
platform/linux/linux_wayland_integration_dummy.cpp
|
||||
platform/linux/linux_wayland_integration.cpp
|
||||
platform/linux/linux_wayland_integration.h
|
||||
platform/linux/linux_xdp_file_dialog.cpp
|
||||
@@ -884,7 +844,6 @@ PRIVATE
|
||||
platform/linux/launcher_linux.h
|
||||
platform/linux/main_window_linux.cpp
|
||||
platform/linux/main_window_linux.h
|
||||
platform/linux/notifications_manager_linux_dummy.cpp
|
||||
platform/linux/notifications_manager_linux.cpp
|
||||
platform/linux/notifications_manager_linux.h
|
||||
platform/linux/specific_linux.cpp
|
||||
@@ -894,7 +853,6 @@ PRIVATE
|
||||
platform/mac/file_utilities_mac.h
|
||||
platform/mac/launcher_mac.mm
|
||||
platform/mac/launcher_mac.h
|
||||
platform/mac/mac_iconv_helper.c
|
||||
platform/mac/main_window_mac.mm
|
||||
platform/mac/main_window_mac.h
|
||||
platform/mac/notifications_manager_mac.mm
|
||||
@@ -1071,8 +1029,6 @@ PRIVATE
|
||||
ui/search_field_controller.h
|
||||
ui/special_buttons.cpp
|
||||
ui/special_buttons.h
|
||||
ui/text/format_song_document_name.cpp
|
||||
ui/text/format_song_document_name.h
|
||||
ui/unread_badge.cpp
|
||||
ui/unread_badge.h
|
||||
window/main_window.cpp
|
||||
@@ -1172,20 +1128,16 @@ if (DESKTOP_APP_DISABLE_DBUS_INTEGRATION)
|
||||
platform/linux/linux_xdp_open_with_dialog.h
|
||||
platform/linux/notifications_manager_linux.cpp
|
||||
)
|
||||
else()
|
||||
remove_target_sources(Telegram ${src_loc}
|
||||
|
||||
nice_target_sources(Telegram ${src_loc}
|
||||
PRIVATE
|
||||
platform/linux/notifications_manager_linux_dummy.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
if (DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION)
|
||||
remove_target_sources(Telegram ${src_loc}
|
||||
platform/linux/linux_wayland_integration.cpp
|
||||
)
|
||||
else()
|
||||
remove_target_sources(Telegram ${src_loc}
|
||||
platform/linux/linux_wayland_integration_dummy.cpp
|
||||
)
|
||||
remove_target_sources(Telegram ${src_loc} platform/linux/linux_wayland_integration.cpp)
|
||||
nice_target_sources(Telegram ${src_loc} PRIVATE platform/linux/linux_wayland_integration_dummy.cpp)
|
||||
endif()
|
||||
|
||||
if (DESKTOP_APP_DISABLE_GTK_INTEGRATION)
|
||||
@@ -1199,16 +1151,15 @@ if (DESKTOP_APP_DISABLE_GTK_INTEGRATION)
|
||||
platform/linux/linux_gtk_open_with_dialog.cpp
|
||||
platform/linux/linux_gtk_open_with_dialog.h
|
||||
)
|
||||
else()
|
||||
remove_target_sources(Telegram ${src_loc}
|
||||
|
||||
nice_target_sources(Telegram ${src_loc}
|
||||
PRIVATE
|
||||
platform/linux/linux_gtk_integration_dummy.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
if (DESKTOP_APP_USE_PACKAGED)
|
||||
remove_target_sources(Telegram ${src_loc}
|
||||
platform/mac/mac_iconv_helper.c
|
||||
)
|
||||
if (NOT DESKTOP_APP_USE_PACKAGED)
|
||||
nice_target_sources(Telegram ${src_loc} PRIVATE platform/mac/mac_iconv_helper.c)
|
||||
endif()
|
||||
|
||||
nice_target_sources(Telegram ${res_loc}
|
||||
@@ -1244,6 +1195,8 @@ if (WIN32)
|
||||
# $<IF:${release},"Appending compatibility manifest.","Finalizing build.">
|
||||
# )
|
||||
elseif (APPLE)
|
||||
target_link_libraries(Telegram PRIVATE desktop-app::external_sp_media_key_tap)
|
||||
|
||||
if (NOT DESKTOP_APP_USE_PACKAGED)
|
||||
target_link_libraries(Telegram PRIVATE desktop-app::external_iconv)
|
||||
endif()
|
||||
|
||||
1
Telegram/Resources/icons/calls/active_hand.json
Normal file
BIN
Telegram/Resources/icons/calls/call_settings.png
Normal file
|
After Width: | Height: | Size: 345 B |
BIN
Telegram/Resources/icons/calls/call_settings@2x.png
Normal file
|
After Width: | Height: | Size: 591 B |
BIN
Telegram/Resources/icons/calls/call_settings@3x.png
Normal file
|
After Width: | Height: | Size: 932 B |
|
Before Width: | Height: | Size: 277 B |
|
Before Width: | Height: | Size: 444 B |
|
Before Width: | Height: | Size: 653 B |
|
Before Width: | Height: | Size: 553 B |
|
Before Width: | Height: | Size: 991 B |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 756 B |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 566 B |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
1
Telegram/Resources/icons/calls/hand_muted_active.json
Normal file
1
Telegram/Resources/icons/calls/raised_hand.json
Normal file
|
Before Width: | Height: | Size: 294 B |
|
Before Width: | Height: | Size: 532 B |
|
Before Width: | Height: | Size: 790 B |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 436 B |
|
Before Width: | Height: | Size: 761 B |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 288 B |
|
Before Width: | Height: | Size: 403 B |
|
Before Width: | Height: | Size: 639 B |
|
Before Width: | Height: | Size: 560 B |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 355 B |
|
Before Width: | Height: | Size: 480 B |
|
Before Width: | Height: | Size: 729 B |
|
Before Width: | Height: | Size: 596 B |
|
Before Width: | Height: | Size: 965 B |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 413 B |
|
Before Width: | Height: | Size: 672 B |
|
Before Width: | Height: | Size: 876 B |
|
Before Width: | Height: | Size: 213 B |
|
Before Width: | Height: | Size: 249 B |
|
Before Width: | Height: | Size: 300 B |
|
Before Width: | Height: | Size: 338 B After Width: | Height: | Size: 228 B |
|
Before Width: | Height: | Size: 569 B After Width: | Height: | Size: 341 B |
|
Before Width: | Height: | Size: 768 B After Width: | Height: | Size: 427 B |
|
Before Width: | Height: | Size: 305 B After Width: | Height: | Size: 146 B |
|
Before Width: | Height: | Size: 428 B After Width: | Height: | Size: 234 B |
|
Before Width: | Height: | Size: 550 B After Width: | Height: | Size: 273 B |
|
Before Width: | Height: | Size: 664 B After Width: | Height: | Size: 854 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.3 KiB |
@@ -216,7 +216,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_code_desc" = "We have sent you a message with activation\ncode to your phone. Please enter it below.";
|
||||
"lng_code_from_telegram" = "Please enter the code you've just received\nin your previous **Telegram** app.";
|
||||
"lng_code_no_telegram" = "Send code via SMS";
|
||||
"lng_code_register_phone" = "If you already signed up for Telegram, please enter the code which was sent to your mobile app.\n\nIf you haven’t signed up yet, please register from your phone or tablet first.";
|
||||
"lng_code_call" = "Telegram will call you in {minutes}:{seconds}";
|
||||
"lng_code_calling" = "Requesting a call from Telegram...";
|
||||
"lng_code_called" = "Telegram dialed your number";
|
||||
@@ -451,19 +450,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_settings_system_integration" = "System integration";
|
||||
"lng_settings_performance" = "Performance";
|
||||
"lng_settings_enable_animations" = "Enable animations";
|
||||
"lng_settings_enable_opengl" = "Enable OpenGL rendering for media";
|
||||
"lng_settings_sensitive_title" = "Sensitive content";
|
||||
"lng_settings_sensitive_disable_filtering" = "Disable filtering";
|
||||
"lng_settings_sensitive_about" = "Display sensitive media in public channels on all your Telegram devices.";
|
||||
"lng_settings_security_bots" = "Bots and websites";
|
||||
"lng_settings_clear_payment_info" = "Clear Payment and Shipping Info";
|
||||
|
||||
"lng_clear_payment_info_title" = "Clear payment info";
|
||||
"lng_clear_payment_info_sure" = "Are you sure you want to clear your payment and shipping info?";
|
||||
"lng_clear_payment_info_shipping" = "Shipping info";
|
||||
"lng_clear_payment_info_payment" = "Payment info";
|
||||
"lng_clear_payment_info_clear" = "Clear";
|
||||
"lng_clear_payment_info_confirm" = "Delete your shipping info and instruct all payment providers to remove your saved credit cards? Note that Telegram never stores your credit card data.";
|
||||
|
||||
"lng_settings_auto_night_mode" = "Auto-Night mode";
|
||||
"lng_settings_auto_night_enabled" = "Match the system settings";
|
||||
@@ -1108,12 +1097,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_action_invite_user_chat" = "the voice chat";
|
||||
"lng_action_invite_users_and_one" = "{accumulated}, {user}";
|
||||
"lng_action_invite_users_and_last" = "{accumulated} and {user}";
|
||||
"lng_action_group_call_started_group" = "{from} started a voice chat";
|
||||
"lng_action_group_call_started_channel" = "Voice chat started";
|
||||
"lng_action_group_call_scheduled_group" = "{from} scheduled a voice chat for {date}";
|
||||
"lng_action_group_call_scheduled_channel" = "Voice chat scheduled for {date}";
|
||||
"lng_action_group_call_started" = "{from} started {chat}";
|
||||
"lng_action_group_call_started_chat" = "a voice chat";
|
||||
"lng_action_group_call_finished" = "Voice chat finished ({duration})";
|
||||
"lng_action_group_call_finished_group" = "{from} ended the voice chat ({duration})";
|
||||
"lng_action_add_user" = "{from} added {user}";
|
||||
"lng_action_add_users_many" = "{from} added {users}";
|
||||
"lng_action_add_users_and_one" = "{accumulated}, {user}";
|
||||
@@ -1402,8 +1388,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_stickers_search_sets" = "Search sticker sets";
|
||||
"lng_stickers_nothing_found" = "No stickers found";
|
||||
"lng_stickers_remove_pack_confirm" = "Remove";
|
||||
"lng_stickers_archive_pack" = "Archive Stickers";
|
||||
"lng_stickers_has_been_archived" = "Sticker pack has been archived.";
|
||||
|
||||
"lng_in_dlg_photo" = "Photo";
|
||||
"lng_in_dlg_album" = "Album";
|
||||
@@ -1870,24 +1854,16 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_theme_editor_menu_show" = "Show palette file";
|
||||
|
||||
"lng_payments_not_supported" = "Sorry, Telegram Desktop doesn't support payments yet. Please use one of our mobile apps to do this.";
|
||||
"lng_payments_webview_no_card" = "Unfortunately, you can't add a new card with current system configuration.";
|
||||
"lng_payments_webview_no_use" = "Unfortunately, you can't use payments with current system configuration.";
|
||||
"lng_payments_webview_install_edge" = "Please install {link}.";
|
||||
"lng_payments_webview_install_webkit" = "Please install WebKitGTK 4 (webkit2gtk-4.0) using your package manager.";
|
||||
"lng_payments_webview_switch_mutter" = "Qt's window embedding doesn't work well with Mutter window manager. Please switch to another window manager or desktop environment.";
|
||||
"lng_payments_webview_switch_wayland" = "There is no way to embed WebView window on Wayland. Please switch to X11.";
|
||||
"lng_payments_sure_close" = "Are you sure you want to close this payment form? The changes you made will be lost.";
|
||||
"lng_payments_receipt_label" = "Receipt";
|
||||
"lng_payments_receipt_label_test" = "Test receipt";
|
||||
"lng_payments_invoice_label" = "Invoice";
|
||||
"lng_payments_invoice_label_test" = "Test invoice";
|
||||
"lng_payments_receipt_button" = "Receipt";
|
||||
"lng_payments_success" = "You paid {amount} for {title}.";
|
||||
|
||||
"lng_payments_checkout_title" = "Checkout";
|
||||
"lng_payments_receipt_title" = "Receipt";
|
||||
"lng_payments_total_label" = "Total";
|
||||
"lng_payments_date_label" = "Paid";
|
||||
"lng_payments_date_label" = "Date";
|
||||
"lng_payments_pay_amount" = "Pay {amount}";
|
||||
"lng_payments_payment_method" = "Payment Method";
|
||||
"lng_payments_new_card" = "New Card...";
|
||||
@@ -1903,35 +1879,16 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_payments_info_name" = "Name";
|
||||
"lng_payments_info_email" = "Email";
|
||||
"lng_payments_info_phone" = "Phone";
|
||||
"lng_payments_to_provider_phone_email" = "Phone and Email will be passed to {provider} as billing info.";
|
||||
"lng_payments_to_provider_email" = "Email will be passed to {provider} as billing info.";
|
||||
"lng_payments_to_provider_phone" = "Phone will be passed to {provider} as billing info.";
|
||||
"lng_payments_processed_by" = "Processed by {provider}";
|
||||
"lng_payments_warning_title" = "Warning";
|
||||
"lng_payments_warning_body" = "Neither Telegram, nor {bot1} will have access to your credit card information. Credit card details will be handled only by the payment system, {provider}.\n\nPayments will go directly to the developer of {bot2}. Telegram cannot provide any guarantees, so proceed at your own risk. In case of problems, please contact the developer of {bot3} or your bank.";
|
||||
"lng_payments_shipping_address_title" = "Shipping Information";
|
||||
"lng_payments_save_shipping_about" = "You can save your shipping information for future use.";
|
||||
"lng_payments_card_title" = "New Card";
|
||||
"lng_payments_card_number" = "Card Number";
|
||||
"lng_payments_card_cvc" = "CVC";
|
||||
"lng_payments_card_expire_date" = "MM / YY";
|
||||
"lng_payments_card_holder" = "Cardholder name";
|
||||
"lng_payments_billing_address" = "Billing Information";
|
||||
"lng_payments_billing_country" = "Country";
|
||||
"lng_payments_billing_zip_code" = "Zip Code";
|
||||
"lng_payments_save_information" = "Save Information for future use";
|
||||
"lng_payments_need_password" = "You can save your payment information for future use. Please turn on Two-Step Verification to enable this.";
|
||||
"lng_payments_password_title" = "Payment Confirmation";
|
||||
"lng_payments_password_description" = "Your card {card} is on file. To pay with this card, please enter your 2-Step-Verification password.";
|
||||
"lng_payments_password_submit" = "Pay";
|
||||
"lng_payments_tips_label" = "Tip (Optional)";
|
||||
"lng_payments_tips_box_title" = "Add Tip";
|
||||
"lng_payments_tips_max" = "Max possible tip amount: {amount}";
|
||||
|
||||
"lng_payments_shipping_not_available" = "Shipping to the selected country is not available.";
|
||||
"lng_payments_card_declined" = "Your card was declined.";
|
||||
"lng_payments_payment_failed" = "Payment failed. Your card has not been billed.";
|
||||
"lng_payments_precheckout_failed" = "The bot couldn't process your payment. Your card has not been billed.";
|
||||
"lng_payments_already_paid" = "You have already paid for this item.";
|
||||
"lng_payments_save_payment_about" = "You can save your payment information for future use.";
|
||||
"lng_payments_save_information" = "Save Information";
|
||||
|
||||
"lng_call_status_incoming" = "is calling you...";
|
||||
"lng_call_status_connecting" = "connecting...";
|
||||
@@ -1998,15 +1955,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_group_call_inactive" = "listening";
|
||||
"lng_group_call_raised_hand_status" = "wants to speak";
|
||||
"lng_group_call_settings" = "Settings";
|
||||
"lng_group_call_share_button" = "Share";
|
||||
"lng_group_call_video" = "Video";
|
||||
"lng_group_call_screen_share_start" = "Share Screen";
|
||||
"lng_group_call_screen_share_stop" = "Stop Sharing";
|
||||
"lng_group_call_screen_title" = "Screen {index}";
|
||||
"lng_group_call_unmute_small" = "Unmute";
|
||||
"lng_group_call_more" = "More";
|
||||
"lng_group_call_unmute" = "Unmute";
|
||||
"lng_group_call_unmute_sub" = "Hold space bar to temporarily unmute.";
|
||||
"lng_group_call_unmute_sub" = "or hold spacebar to talk";
|
||||
"lng_group_call_you_are_live" = "You are Live";
|
||||
"lng_group_call_force_muted" = "Muted by admin";
|
||||
"lng_group_call_force_muted_sub" = "You are in Listen Only mode";
|
||||
@@ -2017,24 +1967,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_group_call_leave" = "Leave";
|
||||
"lng_group_call_leave_title" = "Leave voice chat";
|
||||
"lng_group_call_leave_sure" = "Are you sure you want to leave this voice chat?";
|
||||
"lng_group_call_close" = "Close";
|
||||
"lng_group_call_close_sure" = "Voice chat is scheduled. You can abort it or just close this panel.";
|
||||
"lng_group_call_also_cancel" = "Abort voice chat";
|
||||
"lng_group_call_leave_to_other_sure" = "Do you want to leave your active voice chat and join a voice chat in this group?";
|
||||
"lng_group_call_create_sure" = "Do you really want to start a voice chat in this group?";
|
||||
"lng_group_call_create_sure_channel" = "Are you sure you want to start a voice chat in this channel as your personal account?";
|
||||
"lng_group_call_join_sure_personal" = "Are you sure you want to join this voice chat as your personal account?";
|
||||
"lng_group_call_muted_no_camera" = "You can't turn on video while you're muted by admin.";
|
||||
"lng_group_call_muted_no_screen" = "You can't share your screen while you're muted by admin.";
|
||||
"lng_group_call_chat_no_camera" = "You can't turn on video in this chat.";
|
||||
"lng_group_call_chat_no_screen" = "You can't share your screen in this chat.";
|
||||
"lng_group_call_failed_screen" = "An error occured. Screencast has stopped.";
|
||||
"lng_group_call_tooltip_screen" = "Share screen";
|
||||
"lng_group_call_tooltip_camera" = "Your camera is off. Click here to enable camera.";
|
||||
"lng_group_call_tooltip_microphone" = "You are on mute. Click here to speak.";
|
||||
"lng_group_call_tooltip_camera_off" = "Disable camera";
|
||||
"lng_group_call_tooltip_force_muted" = "Muted by admin. Click if you want to speak.";
|
||||
"lng_group_call_tooltip_raised_hand" = "You asked to speak. We let the speakers know.";
|
||||
"lng_group_call_also_end" = "End voice chat";
|
||||
"lng_group_call_settings_title" = "Settings";
|
||||
"lng_group_call_invite" = "Invite Member";
|
||||
@@ -2061,7 +1997,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_group_call_copy_speaker_link" = "Copy Speaker Link";
|
||||
"lng_group_call_copy_listener_link" = "Copy Listener Link";
|
||||
"lng_group_call_end" = "End Voice Chat";
|
||||
"lng_group_call_cancel" = "Abort Voice Chat";
|
||||
"lng_group_call_join" = "Join";
|
||||
"lng_group_call_join_confirm" = "Do you want to join the voice chat {chat}?";
|
||||
"lng_group_call_invite_done_user" = "You invited {user} to the voice chat.";
|
||||
@@ -2077,10 +2012,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_group_call_context_remove_hand" = "Cancel request to speak";
|
||||
"lng_group_call_context_mute_for_me" = "Mute for me";
|
||||
"lng_group_call_context_unmute_for_me" = "Unmute for me";
|
||||
"lng_group_call_context_pin_camera" = "Pin video";
|
||||
"lng_group_call_context_unpin_camera" = "Unpin video";
|
||||
"lng_group_call_context_pin_screen" = "Pin screencast";
|
||||
"lng_group_call_context_unpin_screen" = "Unpin screencast";
|
||||
"lng_group_call_context_remove" = "Remove";
|
||||
"lng_group_call_remove_channel" = "Remove {channel} from the voice chat?";
|
||||
"lng_group_call_duration_days#one" = "{count} day";
|
||||
@@ -2094,35 +2025,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_group_call_mac_access" = "Telegram Desktop does not have access to system wide keyboard input required for Push to Talk.";
|
||||
"lng_group_call_mac_input" = "Please allow **Input Monitoring** for Telegram in Privacy Settings.";
|
||||
"lng_group_call_mac_accessibility" = "Please allow **Accessibility** for Telegram in Privacy Settings.\n\nApp restart may be required.";
|
||||
"lng_group_call_mac_screencast_access" = "Telegram Desktop does not have access to screen recording required for Screen Sharing.";
|
||||
"lng_group_call_mac_recording" = "Please allow **Screen Recording** for Telegram in Privacy Settings.";
|
||||
"lng_group_call_mac_settings" = "Open Settings";
|
||||
|
||||
"lng_group_call_start_as_header" = "Start Voice Chat as...";
|
||||
"lng_group_call_join_as_header" = "Join Voice Chat as...";
|
||||
"lng_group_call_display_as_header" = "Display me as...";
|
||||
"lng_group_call_join_as_about" = "Choose whether you want to be displayed as your personal account or as your channel.";
|
||||
"lng_group_call_or_schedule" = "You can also {link}.";
|
||||
"lng_group_call_schedule" = "schedule a voice chat";
|
||||
"lng_group_call_schedule_title" = "Schedule Voice Chat";
|
||||
"lng_group_call_schedule_notified_group" = "The members of the group will be notified that the voice chat will start in {duration}.";
|
||||
"lng_group_call_schedule_notified_channel" = "The subscribers of the channel will be notified that the voice chat will start in {duration}.";
|
||||
"lng_group_call_scheduled_status" = "Scheduled";
|
||||
"lng_group_call_scheduled_title" = "Scheduled Voice Chat";
|
||||
"lng_group_call_starts_short" = "Starts {when}";
|
||||
"lng_group_call_starts" = "Voice Chat starts {when}";
|
||||
"lng_group_call_starts_today" = "today at {time}";
|
||||
"lng_group_call_starts_tomorrow" = "tomorrow at {time}";
|
||||
"lng_group_call_starts_date" = "{date} at {time}";
|
||||
"lng_group_call_starts_in" = "Starts in";
|
||||
"lng_group_call_late_by" = "Late by";
|
||||
"lng_group_call_starts_short_today" = "Today, {time}";
|
||||
"lng_group_call_starts_short_tomorrow" = "Tomorrow, {time}";
|
||||
"lng_group_call_starts_short_date" = "{date}, {time}";
|
||||
"lng_group_call_start_now" = "Start Now";
|
||||
"lng_group_call_start_now_sure" = "Are you sure you want to start the voice chat now?";
|
||||
"lng_group_call_set_reminder" = "Set Reminder";
|
||||
"lng_group_call_cancel_reminder" = "Cancel Reminder";
|
||||
"lng_group_call_join_as_personal" = "personal account";
|
||||
"lng_group_call_edit_title" = "Edit voice chat title";
|
||||
"lng_group_call_switch_done" = "Members of this voice chat will now see you as **{user}**";
|
||||
@@ -2132,15 +2040,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_group_call_recording_started" = "Voice chat recording started.";
|
||||
"lng_group_call_recording_stopped" = "Voice chat recording stopped.";
|
||||
"lng_group_call_recording_saved" = "Audio saved to Saved Messages.";
|
||||
"lng_group_call_pinned_camera_me" = "Your video is pinned.";
|
||||
"lng_group_call_pinned_screen_me" = "Your screencast is pinned.";
|
||||
"lng_group_call_pinned_camera" = "{user}'s video is pinned.";
|
||||
"lng_group_call_pinned_screen" = "{user}'s screencast is pinned.";
|
||||
"lng_group_call_unpinned_camera_me" = "Your video is unpinned.";
|
||||
"lng_group_call_unpinned_screen_me" = "Your screencast is unpinned.";
|
||||
"lng_group_call_unpinned_camera" = "{user}'s video is unpinned.";
|
||||
"lng_group_call_unpinned_screen" = "{user}'s screencast is unpinned.";
|
||||
"lng_group_call_sure_screencast" = "{user} is screensharing. This action will make your screencast pinned for all participants.";
|
||||
"lng_group_call_recording_start_sure" = "Do you want to start recording this chat and save the result into an audio file?\n\nOther members will see the chat is being recorded.";
|
||||
"lng_group_call_recording_stop_sure" = "Do you want to stop recording this chat?";
|
||||
"lng_group_call_recording_start_field" = "Recording Title";
|
||||
@@ -2807,12 +2706,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_mac_menu_show" = "Show Telegram";
|
||||
"lng_mac_menu_emoji_and_symbols" = "Emoji & Symbols";
|
||||
|
||||
"lng_mac_menu_player_pause" = "Pause";
|
||||
"lng_mac_menu_player_resume" = "Resume";
|
||||
"lng_mac_menu_player_next" = "Next";
|
||||
"lng_mac_menu_player_previous" = "Previous";
|
||||
"lng_mac_menu_player_stop" = "Stop";
|
||||
|
||||
"lng_mac_touchbar_favorite_stickers" = "Favorite stickers";
|
||||
|
||||
// Keys finished
|
||||
|
||||
@@ -59,8 +59,9 @@
|
||||
<file alias="day-blue.tdesktop-theme">../../day-blue.tdesktop-theme</file>
|
||||
<file alias="night.tdesktop-theme">../../night.tdesktop-theme</file>
|
||||
<file alias="night-green.tdesktop-theme">../../night-green.tdesktop-theme</file>
|
||||
<file alias="icons/calls/hands.lottie">../../icons/calls/hands.lottie</file>
|
||||
<file alias="icons/calls/voice.lottie">../../icons/calls/voice.lottie</file>
|
||||
<file alias="icons/calls/active_hand.json">../../icons/calls/active_hand.json</file>
|
||||
<file alias="icons/calls/hand_muted_active.json">../../icons/calls/hand_muted_active.json</file>
|
||||
<file alias="icons/calls/raised_hand.json">../../icons/calls/raised_hand.json</file>
|
||||
</qresource>
|
||||
<qresource prefix="/qt-project.org">
|
||||
<file>../qmime/freedesktop.org.xml</file>
|
||||
|
||||
@@ -68,7 +68,7 @@ inputMediaVenue#c13d1c11 geo_point:InputGeoPoint title:string address:string pro
|
||||
inputMediaPhotoExternal#e5bbfe1a flags:# url:string ttl_seconds:flags.0?int = InputMedia;
|
||||
inputMediaDocumentExternal#fb52dc99 flags:# url:string ttl_seconds:flags.0?int = InputMedia;
|
||||
inputMediaGame#d33f43f3 id:InputGame = InputMedia;
|
||||
inputMediaInvoice#d9799874 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON start_param:flags.1?string = InputMedia;
|
||||
inputMediaInvoice#f4e096c3 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON start_param:string = InputMedia;
|
||||
inputMediaGeoLive#971fa843 flags:# stopped:flags.0?true geo_point:InputGeoPoint heading:flags.2?int period:flags.1?int proximity_notification_radius:flags.3?int = InputMedia;
|
||||
inputMediaPoll#f94e5f1 flags:# poll:Poll correct_answers:flags.0?Vector<bytes> solution:flags.1?string solution_entities:flags.1?Vector<MessageEntity> = InputMedia;
|
||||
inputMediaDice#e66fbf7b emoticon:string = InputMedia;
|
||||
@@ -90,8 +90,8 @@ inputSecureFileLocation#cbc7ee28 id:long access_hash:long = InputFileLocation;
|
||||
inputTakeoutFileLocation#29be5899 = InputFileLocation;
|
||||
inputPhotoFileLocation#40181ffe id:long access_hash:long file_reference:bytes thumb_size:string = InputFileLocation;
|
||||
inputPhotoLegacyFileLocation#d83466f3 id:long access_hash:long file_reference:bytes volume_id:long local_id:int secret:long = InputFileLocation;
|
||||
inputPeerPhotoFileLocation#37257e99 flags:# big:flags.0?true peer:InputPeer photo_id:long = InputFileLocation;
|
||||
inputStickerSetThumb#9d84f3db stickerset:InputStickerSet thumb_version:int = InputFileLocation;
|
||||
inputPeerPhotoFileLocation#27d69997 flags:# big:flags.0?true peer:InputPeer volume_id:long local_id:int = InputFileLocation;
|
||||
inputStickerSetThumb#dbaeae9 stickerset:InputStickerSet volume_id:long local_id:int = InputFileLocation;
|
||||
inputGroupCallStream#bba51639 call:InputGroupCall time_ms:long scale:int = InputFileLocation;
|
||||
|
||||
peerUser#9db1bc6d user_id:int = Peer;
|
||||
@@ -113,7 +113,7 @@ userEmpty#200250ba id:int = User;
|
||||
user#938458c1 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true fake:flags.26?true id:int access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector<RestrictionReason> bot_inline_placeholder:flags.19?string lang_code:flags.22?string = User;
|
||||
|
||||
userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;
|
||||
userProfilePhoto#82d1f706 flags:# has_video:flags.0?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = UserProfilePhoto;
|
||||
userProfilePhoto#69d3ab26 flags:# has_video:flags.0?true photo_id:long photo_small:FileLocation photo_big:FileLocation dc_id:int = UserProfilePhoto;
|
||||
|
||||
userStatusEmpty#9d05049 = UserStatus;
|
||||
userStatusOnline#edb93949 expires:int = UserStatus;
|
||||
@@ -139,7 +139,7 @@ chatParticipantsForbidden#fc900c2b flags:# chat_id:int self_participant:flags.0?
|
||||
chatParticipants#3f460fed chat_id:int participants:Vector<ChatParticipant> version:int = ChatParticipants;
|
||||
|
||||
chatPhotoEmpty#37c1011c = ChatPhoto;
|
||||
chatPhoto#1c6e1c11 flags:# has_video:flags.0?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = ChatPhoto;
|
||||
chatPhoto#d20b9f3c flags:# has_video:flags.0?true photo_small:FileLocation photo_big:FileLocation dc_id:int = ChatPhoto;
|
||||
|
||||
messageEmpty#90a6ca84 flags:# id:int peer_id:flags.0?Peer = Message;
|
||||
message#bce383d2 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true id:int from_id:flags.8?Peer peer_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long restriction_reason:flags.22?Vector<RestrictionReason> ttl_period:flags.25?int = Message;
|
||||
@@ -186,7 +186,6 @@ messageActionGeoProximityReached#98e0d697 from_id:Peer to_id:Peer distance:int =
|
||||
messageActionGroupCall#7a0d7f42 flags:# call:InputGroupCall duration:flags.0?int = MessageAction;
|
||||
messageActionInviteToGroupCall#76b9f11a call:InputGroupCall users:Vector<int> = MessageAction;
|
||||
messageActionSetMessagesTTL#aa1afbfd period:int = MessageAction;
|
||||
messageActionGroupCallScheduled#b3a07661 call:InputGroupCall schedule_date:int = MessageAction;
|
||||
|
||||
dialog#2c171f72 flags:# pinned:flags.2?true unread_mark:flags.3?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?int = Dialog;
|
||||
dialogFolder#71bd134c flags:# pinned:flags.2?true folder:Folder peer:Peer top_message:int unread_muted_peers_count:int unread_unmuted_peers_count:int unread_muted_messages_count:int unread_unmuted_messages_count:int = Dialog;
|
||||
@@ -195,10 +194,10 @@ photoEmpty#2331b22d id:long = Photo;
|
||||
photo#fb197a65 flags:# has_stickers:flags.0?true id:long access_hash:long file_reference:bytes date:int sizes:Vector<PhotoSize> video_sizes:flags.1?Vector<VideoSize> dc_id:int = Photo;
|
||||
|
||||
photoSizeEmpty#e17e23c type:string = PhotoSize;
|
||||
photoSize#75c78e60 type:string w:int h:int size:int = PhotoSize;
|
||||
photoCachedSize#21e1ad6 type:string w:int h:int bytes:bytes = PhotoSize;
|
||||
photoSize#77bfb61b type:string location:FileLocation w:int h:int size:int = PhotoSize;
|
||||
photoCachedSize#e9a734fa type:string location:FileLocation w:int h:int bytes:bytes = PhotoSize;
|
||||
photoStrippedSize#e0b0bc2e type:string bytes:bytes = PhotoSize;
|
||||
photoSizeProgressive#fa3efb95 type:string w:int h:int sizes:Vector<int> = PhotoSize;
|
||||
photoSizeProgressive#5aa86a51 type:string location:FileLocation w:int h:int sizes:Vector<int> = PhotoSize;
|
||||
photoPathSize#d8214d41 type:string bytes:bytes = PhotoSize;
|
||||
|
||||
geoPointEmpty#1117dd5f = GeoPoint;
|
||||
@@ -223,7 +222,7 @@ peerNotifySettings#af509d20 flags:# show_previews:flags.0?Bool silent:flags.1?Bo
|
||||
peerSettings#733f2961 flags:# report_spam:flags.0?true add_contact:flags.1?true block_contact:flags.2?true share_contact:flags.3?true need_contacts_exception:flags.4?true report_geo:flags.5?true autoarchived:flags.7?true invite_members:flags.8?true geo_distance:flags.6?int = PeerSettings;
|
||||
|
||||
wallPaper#a437c3ed id:long flags:# creator:flags.0?true default:flags.1?true pattern:flags.3?true dark:flags.4?true access_hash:long slug:string document:Document settings:flags.2?WallPaperSettings = WallPaper;
|
||||
wallPaperNoFile#e0804116 id:long flags:# default:flags.1?true dark:flags.4?true settings:flags.2?WallPaperSettings = WallPaper;
|
||||
wallPaperNoFile#8af40b25 flags:# default:flags.1?true dark:flags.4?true settings:flags.2?WallPaperSettings = WallPaper;
|
||||
|
||||
inputReportReasonSpam#58dbcab8 = ReportReason;
|
||||
inputReportReasonViolence#1e22c78d = ReportReason;
|
||||
@@ -356,7 +355,7 @@ updateDeleteScheduledMessages#90866cee peer:Peer messages:Vector<int> = Update;
|
||||
updateTheme#8216fba3 theme:Theme = Update;
|
||||
updateGeoLiveViewed#871fb939 peer:Peer msg_id:int = Update;
|
||||
updateLoginToken#564fe691 = Update;
|
||||
updateMessagePollVote#37f69f0b poll_id:long user_id:int options:Vector<bytes> qts:int = Update;
|
||||
updateMessagePollVote#42f88f2c poll_id:long user_id:int options:Vector<bytes> = Update;
|
||||
updateDialogFilter#26ffde7d flags:# id:int filter:flags.0?DialogFilter = Update;
|
||||
updateDialogFilterOrder#a5d72105 order:Vector<int> = Update;
|
||||
updateDialogFilters#3504914f = Update;
|
||||
@@ -375,7 +374,6 @@ updatePeerHistoryTTL#bb9bb9a5 flags:# peer:Peer ttl_period:flags.0?int = Update;
|
||||
updateChatParticipant#f3b3781f flags:# chat_id:int date:int actor_id:int user_id:int prev_participant:flags.0?ChatParticipant new_participant:flags.1?ChatParticipant invite:flags.2?ExportedChatInvite qts:int = Update;
|
||||
updateChannelParticipant#7fecb1ec flags:# channel_id:int date:int actor_id:int user_id:int prev_participant:flags.0?ChannelParticipant new_participant:flags.1?ChannelParticipant invite:flags.2?ExportedChatInvite qts:int = Update;
|
||||
updateBotStopped#7f9488a user_id:int date:int stopped:Bool qts:int = Update;
|
||||
updateGroupCallConnection#b783982 flags:# presentation:flags.0?true params:DataJSON = Update;
|
||||
|
||||
updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;
|
||||
|
||||
@@ -406,7 +404,7 @@ config#330b4067 flags:# phonecalls_enabled:flags.1?true default_p2p_contacts:fla
|
||||
|
||||
nearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc;
|
||||
|
||||
help.appUpdate#ccbbce30 flags:# can_not_skip:flags.0?true id:int version:string text:string entities:Vector<MessageEntity> document:flags.1?Document url:flags.2?string sticker:flags.3?Document = help.AppUpdate;
|
||||
help.appUpdate#1da7158f flags:# can_not_skip:flags.0?true id:int version:string text:string entities:Vector<MessageEntity> document:flags.1?Document url:flags.2?string = help.AppUpdate;
|
||||
help.noAppUpdate#c45a6536 = help.AppUpdate;
|
||||
|
||||
help.inviteText#18cb9f78 message:string = help.InviteText;
|
||||
@@ -556,7 +554,7 @@ inputStickerSetShortName#861cc8a0 short_name:string = InputStickerSet;
|
||||
inputStickerSetAnimatedEmoji#28703c8 = InputStickerSet;
|
||||
inputStickerSetDice#e67f520e emoticon:string = InputStickerSet;
|
||||
|
||||
stickerSet#d7df217a flags:# archived:flags.1?true official:flags.2?true masks:flags.3?true animated:flags.5?true installed_date:flags.0?int id:long access_hash:long title:string short_name:string thumbs:flags.4?Vector<PhotoSize> thumb_dc_id:flags.4?int thumb_version:flags.4?int count:int hash:int = StickerSet;
|
||||
stickerSet#40e237a8 flags:# archived:flags.1?true official:flags.2?true masks:flags.3?true animated:flags.5?true installed_date:flags.0?int id:long access_hash:long title:string short_name:string thumbs:flags.4?Vector<PhotoSize> thumb_dc_id:flags.4?int count:int hash:int = StickerSet;
|
||||
|
||||
messages.stickerSet#b60a24a6 set:StickerSet packs:Vector<StickerPack> documents:Vector<Document> = messages.StickerSet;
|
||||
|
||||
@@ -650,7 +648,6 @@ inputBotInlineMessageMediaGeo#96929a85 flags:# geo_point:InputGeoPoint heading:f
|
||||
inputBotInlineMessageMediaVenue#417bbf11 flags:# geo_point:InputGeoPoint title:string address:string provider:string venue_id:string venue_type:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
|
||||
inputBotInlineMessageMediaContact#a6edbffd flags:# phone_number:string first_name:string last_name:string vcard:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
|
||||
inputBotInlineMessageGame#4b425864 flags:# reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
|
||||
inputBotInlineMessageMediaInvoice#d7e78225 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
|
||||
|
||||
inputBotInlineResult#88bf9319 flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb:flags.4?InputWebDocument content:flags.5?InputWebDocument send_message:InputBotInlineMessage = InputBotInlineResult;
|
||||
inputBotInlineResultPhoto#a8d864a7 id:string type:string photo:InputPhoto send_message:InputBotInlineMessage = InputBotInlineResult;
|
||||
@@ -662,7 +659,6 @@ botInlineMessageText#8c7f65e2 flags:# no_webpage:flags.0?true message:string ent
|
||||
botInlineMessageMediaGeo#51846fd flags:# geo:GeoPoint heading:flags.0?int period:flags.1?int proximity_notification_radius:flags.3?int reply_markup:flags.2?ReplyMarkup = BotInlineMessage;
|
||||
botInlineMessageMediaVenue#8a86659c flags:# geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage;
|
||||
botInlineMessageMediaContact#18d1cdc2 flags:# phone_number:string first_name:string last_name:string vcard:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage;
|
||||
botInlineMessageMediaInvoice#354a9b09 flags:# shipping_address_requested:flags.1?true test:flags.3?true title:string description:string photo:flags.0?WebDocument currency:string total_amount:long reply_markup:flags.2?ReplyMarkup = BotInlineMessage;
|
||||
|
||||
botInlineResult#11965f3a flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb:flags.4?WebDocument content:flags.5?WebDocument send_message:BotInlineMessage = BotInlineResult;
|
||||
botInlineMediaResult#17db940b flags:# id:string type:string photo:flags.0?Photo document:flags.1?Document title:flags.2?string description:flags.3?string send_message:BotInlineMessage = BotInlineResult;
|
||||
@@ -796,7 +792,7 @@ dataJSON#7d748d04 data:string = DataJSON;
|
||||
|
||||
labeledPrice#cb296bf8 label:string amount:long = LabeledPrice;
|
||||
|
||||
invoice#cd886e0 flags:# test:flags.0?true name_requested:flags.1?true phone_requested:flags.2?true email_requested:flags.3?true shipping_address_requested:flags.4?true flexible:flags.5?true phone_to_provider:flags.6?true email_to_provider:flags.7?true currency:string prices:Vector<LabeledPrice> max_tip_amount:flags.8?long suggested_tip_amounts:flags.8?Vector<long> = Invoice;
|
||||
invoice#c30aa358 flags:# test:flags.0?true name_requested:flags.1?true phone_requested:flags.2?true email_requested:flags.3?true shipping_address_requested:flags.4?true flexible:flags.5?true phone_to_provider:flags.6?true email_to_provider:flags.7?true currency:string prices:Vector<LabeledPrice> = Invoice;
|
||||
|
||||
paymentCharge#ea02c27e id:string provider_charge_id:string = PaymentCharge;
|
||||
|
||||
@@ -816,14 +812,14 @@ inputWebFileGeoPointLocation#9f2221c9 geo_point:InputGeoPoint access_hash:long w
|
||||
|
||||
upload.webFile#21e753bc size:int mime_type:string file_type:storage.FileType mtime:int bytes:bytes = upload.WebFile;
|
||||
|
||||
payments.paymentForm#8d0b2415 flags:# can_save_credentials:flags.2?true password_missing:flags.3?true form_id:long bot_id:int invoice:Invoice provider_id:int url:string native_provider:flags.4?string native_params:flags.4?DataJSON saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?PaymentSavedCredentials users:Vector<User> = payments.PaymentForm;
|
||||
payments.paymentForm#3f56aea3 flags:# can_save_credentials:flags.2?true password_missing:flags.3?true bot_id:int invoice:Invoice provider_id:int url:string native_provider:flags.4?string native_params:flags.4?DataJSON saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?PaymentSavedCredentials users:Vector<User> = payments.PaymentForm;
|
||||
|
||||
payments.validatedRequestedInfo#d1451883 flags:# id:flags.0?string shipping_options:flags.1?Vector<ShippingOption> = payments.ValidatedRequestedInfo;
|
||||
|
||||
payments.paymentResult#4e5f810d updates:Updates = payments.PaymentResult;
|
||||
payments.paymentVerificationNeeded#d8411139 url:string = payments.PaymentResult;
|
||||
|
||||
payments.paymentReceipt#10b555d0 flags:# date:int bot_id:int provider_id:int title:string description:string photo:flags.2?WebDocument invoice:Invoice info:flags.0?PaymentRequestedInfo shipping:flags.1?ShippingOption tip_amount:flags.3?long currency:string total_amount:long credentials_title:string users:Vector<User> = payments.PaymentReceipt;
|
||||
payments.paymentReceipt#500911e1 flags:# date:int bot_id:int invoice:Invoice provider_id:int info:flags.0?PaymentRequestedInfo shipping:flags.1?ShippingOption currency:string total_amount:long credentials_title:string users:Vector<User> = payments.PaymentReceipt;
|
||||
|
||||
payments.savedInfo#fb8fe43c flags:# has_saved_credentials:flags.1?true saved_info:flags.0?PaymentRequestedInfo = payments.SavedInfo;
|
||||
|
||||
@@ -1070,14 +1066,14 @@ chatBannedRights#9f120418 flags:# view_messages:flags.0?true send_messages:flags
|
||||
|
||||
inputWallPaper#e630b979 id:long access_hash:long = InputWallPaper;
|
||||
inputWallPaperSlug#72091c80 slug:string = InputWallPaper;
|
||||
inputWallPaperNoFile#967a462e id:long = InputWallPaper;
|
||||
inputWallPaperNoFile#8427bbac = InputWallPaper;
|
||||
|
||||
account.wallPapersNotModified#1c199183 = account.WallPapers;
|
||||
account.wallPapers#702b65a9 hash:int wallpapers:Vector<WallPaper> = account.WallPapers;
|
||||
|
||||
codeSettings#debebe83 flags:# allow_flashcall:flags.0?true current_number:flags.1?true allow_app_hash:flags.4?true = CodeSettings;
|
||||
|
||||
wallPaperSettings#1dc1bca4 flags:# blur:flags.1?true motion:flags.2?true background_color:flags.0?int second_background_color:flags.4?int third_background_color:flags.5?int fourth_background_color:flags.6?int intensity:flags.3?int rotation:flags.4?int = WallPaperSettings;
|
||||
wallPaperSettings#5086cf8 flags:# blur:flags.1?true motion:flags.2?true background_color:flags.0?int second_background_color:flags.4?int intensity:flags.3?int rotation:flags.4?int = WallPaperSettings;
|
||||
|
||||
autoDownloadSettings#e04232f3 flags:# disabled:flags.0?true video_preload_large:flags.1?true audio_preload_next:flags.2?true phonecalls_less_data:flags.3?true photo_size_max:int video_size_max:int file_size_max:int video_upload_maxbitrate:int = AutoDownloadSettings;
|
||||
|
||||
@@ -1092,6 +1088,8 @@ emojiURL#a575739d url:string = EmojiURL;
|
||||
|
||||
emojiLanguage#b3fb5361 lang_code:string = EmojiLanguage;
|
||||
|
||||
fileLocationToBeDeprecated#bc7fc6cd volume_id:long local_id:int = FileLocation;
|
||||
|
||||
folder#ff544e65 flags:# autofill_new_broadcasts:flags.0?true autofill_public_groups:flags.1?true autofill_new_correspondents:flags.2?true id:int title:string photo:flags.3?ChatPhoto = Folder;
|
||||
|
||||
inputFolderPeer#fbd2c296 peer:InputPeer folder_id:int = InputFolderPeer;
|
||||
@@ -1171,7 +1169,7 @@ stats.broadcastStats#bdf78394 period:StatsDateRangeDays followers:StatsAbsValueA
|
||||
help.promoDataEmpty#98f6ac75 expires:int = help.PromoData;
|
||||
help.promoData#8c39793f flags:# proxy:flags.0?true expires:int peer:Peer chats:Vector<Chat> users:Vector<User> psa_type:flags.1?string psa_message:flags.2?string = help.PromoData;
|
||||
|
||||
videoSize#de33b094 flags:# type:string w:int h:int size:int video_start_ts:flags.0?double = VideoSize;
|
||||
videoSize#e831c556 flags:# type:string location:FileLocation w:int h:int size:int video_start_ts:flags.0?double = VideoSize;
|
||||
|
||||
statsGroupTopPoster#18f3d0f7 user_id:int messages:int avg_chars:int = StatsGroupTopPoster;
|
||||
|
||||
@@ -1205,11 +1203,11 @@ peerBlocked#e8fd8014 peer_id:Peer date:int = PeerBlocked;
|
||||
stats.messageStats#8999f295 views_graph:StatsGraph = stats.MessageStats;
|
||||
|
||||
groupCallDiscarded#7780bcb4 id:long access_hash:long duration:int = GroupCall;
|
||||
groupCall#653dbaad flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true join_date_asc:flags.6?true schedule_start_subscribed:flags.8?true can_start_video:flags.9?true id:long access_hash:long participants_count:int title:flags.3?string stream_dc_id:flags.4?int record_start_date:flags.5?int schedule_date:flags.7?int version:int = GroupCall;
|
||||
groupCall#c0c2052e flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true join_date_asc:flags.6?true id:long access_hash:long participants_count:int params:flags.0?DataJSON title:flags.3?string stream_dc_id:flags.4?int record_start_date:flags.5?int version:int = GroupCall;
|
||||
|
||||
inputGroupCall#d8aa840f id:long access_hash:long = InputGroupCall;
|
||||
|
||||
groupCallParticipant#eba636fe flags:# muted:flags.0?true left:flags.1?true can_self_unmute:flags.2?true just_joined:flags.4?true versioned:flags.5?true min:flags.8?true muted_by_you:flags.9?true volume_by_admin:flags.10?true self:flags.12?true video_joined:flags.15?true peer:Peer date:int active_date:flags.3?int source:int volume:flags.7?int about:flags.11?string raise_hand_rating:flags.13?long video:flags.6?GroupCallParticipantVideo presentation:flags.14?GroupCallParticipantVideo = GroupCallParticipant;
|
||||
groupCallParticipant#19adba89 flags:# muted:flags.0?true left:flags.1?true can_self_unmute:flags.2?true just_joined:flags.4?true versioned:flags.5?true min:flags.8?true muted_by_you:flags.9?true volume_by_admin:flags.10?true self:flags.12?true peer:Peer date:int active_date:flags.3?int source:int volume:flags.7?int about:flags.11?string raise_hand_rating:flags.13?long = GroupCallParticipant;
|
||||
|
||||
phone.groupCall#9e727aad call:GroupCall participants:Vector<GroupCallParticipant> participants_next_offset:string chats:Vector<Chat> users:Vector<User> = phone.GroupCall;
|
||||
|
||||
@@ -1246,10 +1244,6 @@ phone.joinAsPeers#afe5623f peers:Vector<Peer> chats:Vector<Chat> users:Vector<Us
|
||||
|
||||
phone.exportedGroupCallInvite#204bd158 link:string = phone.ExportedGroupCallInvite;
|
||||
|
||||
groupCallParticipantVideoSourceGroup#dcb118b7 semantics:string sources:Vector<int> = GroupCallParticipantVideoSourceGroup;
|
||||
|
||||
groupCallParticipantVideo#78e41663 flags:# paused:flags.0?true endpoint:string source_groups:Vector<GroupCallParticipantVideoSourceGroup> = GroupCallParticipantVideo;
|
||||
|
||||
---functions---
|
||||
|
||||
invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;
|
||||
@@ -1598,10 +1592,10 @@ bots.sendCustomRequest#aa2769ed custom_method:string params:DataJSON = DataJSON;
|
||||
bots.answerWebhookJSONQuery#e6213f4d query_id:long data:DataJSON = Bool;
|
||||
bots.setBotCommands#805d46f6 commands:Vector<BotCommand> = Bool;
|
||||
|
||||
payments.getPaymentForm#8a333c8d flags:# peer:InputPeer msg_id:int theme_params:flags.0?DataJSON = payments.PaymentForm;
|
||||
payments.getPaymentReceipt#2478d1cc peer:InputPeer msg_id:int = payments.PaymentReceipt;
|
||||
payments.validateRequestedInfo#db103170 flags:# save:flags.0?true peer:InputPeer msg_id:int info:PaymentRequestedInfo = payments.ValidatedRequestedInfo;
|
||||
payments.sendPaymentForm#30c3bc9d flags:# form_id:long peer:InputPeer msg_id:int requested_info_id:flags.0?string shipping_option_id:flags.1?string credentials:InputPaymentCredentials tip_amount:flags.2?long = payments.PaymentResult;
|
||||
payments.getPaymentForm#99f09745 msg_id:int = payments.PaymentForm;
|
||||
payments.getPaymentReceipt#a092a980 msg_id:int = payments.PaymentReceipt;
|
||||
payments.validateRequestedInfo#770a8e74 flags:# save:flags.0?true msg_id:int info:PaymentRequestedInfo = payments.ValidatedRequestedInfo;
|
||||
payments.sendPaymentForm#2b8879b3 flags:# msg_id:int requested_info_id:flags.0?string shipping_option_id:flags.1?string credentials:InputPaymentCredentials = payments.PaymentResult;
|
||||
payments.getSavedInfo#227d824b = payments.SavedInfo;
|
||||
payments.clearSavedInfo#d83d70c1 flags:# credentials:flags.0?true info:flags.1?true = Bool;
|
||||
payments.getBankCardData#2e79d779 number:string = payments.BankCardData;
|
||||
@@ -1621,25 +1615,20 @@ phone.discardCall#b2cbc1c0 flags:# video:flags.0?true peer:InputPhoneCall durati
|
||||
phone.setCallRating#59ead627 flags:# user_initiative:flags.0?true peer:InputPhoneCall rating:int comment:string = Updates;
|
||||
phone.saveCallDebug#277add7e peer:InputPhoneCall debug:DataJSON = Bool;
|
||||
phone.sendSignalingData#ff7a9383 peer:InputPhoneCall data:bytes = Bool;
|
||||
phone.createGroupCall#48cdc6d8 flags:# peer:InputPeer random_id:int title:flags.0?string schedule_date:flags.1?int = Updates;
|
||||
phone.joinGroupCall#b132ff7b flags:# muted:flags.0?true video_stopped:flags.2?true call:InputGroupCall join_as:InputPeer invite_hash:flags.1?string params:DataJSON = Updates;
|
||||
phone.createGroupCall#bd3dabe0 peer:InputPeer random_id:int = Updates;
|
||||
phone.joinGroupCall#b132ff7b flags:# muted:flags.0?true call:InputGroupCall join_as:InputPeer invite_hash:flags.1?string params:DataJSON = Updates;
|
||||
phone.leaveGroupCall#500377f9 call:InputGroupCall source:int = Updates;
|
||||
phone.inviteToGroupCall#7b393160 call:InputGroupCall users:Vector<InputUser> = Updates;
|
||||
phone.discardGroupCall#7a777135 call:InputGroupCall = Updates;
|
||||
phone.toggleGroupCallSettings#74bbb43d flags:# reset_invite_hash:flags.1?true call:InputGroupCall join_muted:flags.0?Bool = Updates;
|
||||
phone.getGroupCall#c7cb017 call:InputGroupCall = phone.GroupCall;
|
||||
phone.getGroupParticipants#c558d8ab call:InputGroupCall ids:Vector<InputPeer> sources:Vector<int> offset:string limit:int = phone.GroupParticipants;
|
||||
phone.checkGroupCall#b59cf977 call:InputGroupCall sources:Vector<int> = Vector<int>;
|
||||
phone.checkGroupCall#b74a7bea call:InputGroupCall source:int = Bool;
|
||||
phone.toggleGroupCallRecord#c02a66d7 flags:# start:flags.0?true call:InputGroupCall title:flags.1?string = Updates;
|
||||
phone.editGroupCallParticipant#a5273abf flags:# call:InputGroupCall participant:InputPeer muted:flags.0?Bool volume:flags.1?int raise_hand:flags.2?Bool video_stopped:flags.3?Bool video_paused:flags.4?Bool presentation_paused:flags.5?Bool = Updates;
|
||||
phone.editGroupCallParticipant#d975eb80 flags:# muted:flags.0?true call:InputGroupCall participant:InputPeer volume:flags.1?int raise_hand:flags.2?Bool = Updates;
|
||||
phone.editGroupCallTitle#1ca6ac0a call:InputGroupCall title:string = Updates;
|
||||
phone.getGroupCallJoinAs#ef7c213a peer:InputPeer = phone.JoinAsPeers;
|
||||
phone.exportGroupCallInvite#e6aa647f flags:# can_self_unmute:flags.0?true call:InputGroupCall = phone.ExportedGroupCallInvite;
|
||||
phone.toggleGroupCallStartSubscription#219c34e6 call:InputGroupCall subscribed:Bool = Updates;
|
||||
phone.startScheduledGroupCall#5680e342 call:InputGroupCall = Updates;
|
||||
phone.saveDefaultGroupCallJoinAs#575e1f8c peer:InputPeer join_as:InputPeer = Bool;
|
||||
phone.joinGroupCallPresentation#cbea6bc4 call:InputGroupCall params:DataJSON = Updates;
|
||||
phone.leaveGroupCallPresentation#1c50d144 call:InputGroupCall = Updates;
|
||||
|
||||
langpack.getLangPack#f2f2330a lang_pack:string lang_code:string = LangPackDifference;
|
||||
langpack.getStrings#efea3803 lang_pack:string lang_code:string keys:Vector<string> = Vector<LangPackString>;
|
||||
@@ -1656,4 +1645,4 @@ stats.getMegagroupStats#dcdf8607 flags:# dark:flags.0?true channel:InputChannel
|
||||
stats.getMessagePublicForwards#5630281b channel:InputChannel msg_id:int offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages;
|
||||
stats.getMessageStats#b6e0a3f5 flags:# dark:flags.0?true channel:InputChannel msg_id:int = stats.MessageStats;
|
||||
|
||||
// LAYER 129
|
||||
// LAYER 126
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<Identity Name="TelegramMessengerLLP.TelegramDesktop"
|
||||
ProcessorArchitecture="ARCHITECTURE"
|
||||
Publisher="CN=536BC709-8EE1-4478-AF22-F0F0F26FF64A"
|
||||
Version="2.7.8.0" />
|
||||
Version="2.7.1.0" />
|
||||
<Properties>
|
||||
<DisplayName>Telegram Desktop</DisplayName>
|
||||
<PublisherDisplayName>Telegram Messenger LLP</PublisherDisplayName>
|
||||
|
||||
@@ -44,8 +44,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico"
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 2,7,8,0
|
||||
PRODUCTVERSION 2,7,8,0
|
||||
FILEVERSION 2,7,1,0
|
||||
PRODUCTVERSION 2,7,1,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
@@ -62,10 +62,10 @@ BEGIN
|
||||
BEGIN
|
||||
VALUE "CompanyName", "Telegram FZ-LLC"
|
||||
VALUE "FileDescription", "Telegram Desktop"
|
||||
VALUE "FileVersion", "2.7.8.0"
|
||||
VALUE "FileVersion", "2.7.1.0"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2014-2021"
|
||||
VALUE "ProductName", "Telegram Desktop"
|
||||
VALUE "ProductVersion", "2.7.8.0"
|
||||
VALUE "ProductVersion", "2.7.1.0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
||||
@@ -35,8 +35,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 2,7,8,0
|
||||
PRODUCTVERSION 2,7,8,0
|
||||
FILEVERSION 2,7,1,0
|
||||
PRODUCTVERSION 2,7,1,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
@@ -53,10 +53,10 @@ BEGIN
|
||||
BEGIN
|
||||
VALUE "CompanyName", "Telegram FZ-LLC"
|
||||
VALUE "FileDescription", "Telegram Desktop Updater"
|
||||
VALUE "FileVersion", "2.7.8.0"
|
||||
VALUE "FileVersion", "2.7.1.0"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2014-2021"
|
||||
VALUE "ProductName", "Telegram Desktop"
|
||||
VALUE "ProductVersion", "2.7.8.0"
|
||||
VALUE "ProductVersion", "2.7.1.0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
||||
@@ -47,18 +47,6 @@ typedef signed int int32;
|
||||
|
||||
namespace{
|
||||
|
||||
struct BIODeleter {
|
||||
void operator()(BIO *value) {
|
||||
BIO_free(value);
|
||||
}
|
||||
};
|
||||
|
||||
inline auto makeBIO(const void *buf, int len) {
|
||||
return std::unique_ptr<BIO, BIODeleter>{
|
||||
BIO_new_mem_buf(buf, len),
|
||||
};
|
||||
}
|
||||
|
||||
inline uint32 sha1Shift(uint32 v, uint32 shift) {
|
||||
return ((v << shift) | (v >> (32 - shift)));
|
||||
}
|
||||
@@ -442,15 +430,7 @@ int main(int argc, char *argv[])
|
||||
uint32 siglen = 0;
|
||||
|
||||
cout << "Signing..\n";
|
||||
RSA *prKey = [] {
|
||||
const auto bio = makeBIO(
|
||||
const_cast<char*>(
|
||||
(BetaChannel || AlphaVersion)
|
||||
? PrivateBetaKey
|
||||
: PrivateKey),
|
||||
-1);
|
||||
return PEM_read_bio_RSAPrivateKey(bio.get(), 0, 0, 0);
|
||||
}();
|
||||
RSA *prKey = PEM_read_bio_RSAPrivateKey(BIO_new_mem_buf(const_cast<char*>((BetaChannel || AlphaVersion) ? PrivateBetaKey : PrivateKey), -1), 0, 0, 0);
|
||||
if (!prKey) {
|
||||
cout << "Could not read RSA private key!\n";
|
||||
return -1;
|
||||
@@ -473,15 +453,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
cout << "Checking signature..\n";
|
||||
RSA *pbKey = [] {
|
||||
const auto bio = makeBIO(
|
||||
const_cast<char*>(
|
||||
(BetaChannel || AlphaVersion)
|
||||
? PublicBetaKey
|
||||
: PublicKey),
|
||||
-1);
|
||||
return PEM_read_bio_RSAPublicKey(bio.get(), 0, 0, 0);
|
||||
}();
|
||||
RSA *pbKey = PEM_read_bio_RSAPublicKey(BIO_new_mem_buf(const_cast<char*>((BetaChannel || AlphaVersion) ? PublicBetaKey : PublicKey), -1), 0, 0, 0);
|
||||
if (!pbKey) {
|
||||
cout << "Could not read RSA public key!\n";
|
||||
return -1;
|
||||
@@ -538,12 +510,7 @@ QString countAlphaVersionSignature(quint64 version) { // duplicated in autoupdat
|
||||
|
||||
uint32 siglen = 0;
|
||||
|
||||
RSA *prKey = [&] {
|
||||
const auto bio = makeBIO(
|
||||
const_cast<char*>(cAlphaPrivateKey.constData()),
|
||||
-1);
|
||||
return PEM_read_bio_RSAPrivateKey(bio.get(), 0, 0, 0);
|
||||
}();
|
||||
RSA *prKey = PEM_read_bio_RSAPrivateKey(BIO_new_mem_buf(const_cast<char*>(cAlphaPrivateKey.constData()), -1), 0, 0, 0);
|
||||
if (!prKey) {
|
||||
cout << "Error: Could not read alpha private key!\n";
|
||||
return QString();
|
||||
|
||||
@@ -8,7 +8,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include <cstdio>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/sendfile.h>
|
||||
#include <cstdlib>
|
||||
#include <unistd.h>
|
||||
#include <dirent.h>
|
||||
@@ -88,7 +87,7 @@ void writeLog(const char *format, ...) {
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
bool copyFile(const char *from, const char *to, bool writeprotected) {
|
||||
bool copyFile(const char *from, const char *to) {
|
||||
FILE *ffrom = fopen(from, "rb"), *fto = fopen(to, "wb");
|
||||
if (!ffrom) {
|
||||
if (fto) fclose(fto);
|
||||
@@ -98,6 +97,11 @@ bool copyFile(const char *from, const char *to, bool writeprotected) {
|
||||
fclose(ffrom);
|
||||
return false;
|
||||
}
|
||||
static const int BufSize = 65536;
|
||||
char buf[BufSize];
|
||||
while (size_t size = fread(buf, 1, BufSize, ffrom)) {
|
||||
fwrite(buf, 1, size, fto);
|
||||
}
|
||||
|
||||
struct stat fst; // from http://stackoverflow.com/questions/5486774/keeping-fileowner-and-permissions-after-copying-file-in-c
|
||||
//let's say this wont fail since you already worked OK on that fp
|
||||
@@ -106,35 +110,8 @@ bool copyFile(const char *from, const char *to, bool writeprotected) {
|
||||
fclose(fto);
|
||||
return false;
|
||||
}
|
||||
|
||||
ssize_t copied = sendfile(
|
||||
fileno(fto),
|
||||
fileno(ffrom),
|
||||
nullptr,
|
||||
fst.st_size);
|
||||
|
||||
if (copied == -1) {
|
||||
writeLog(
|
||||
"Copy by sendfile '%s' to '%s' failed, error: %d, fallback now.",
|
||||
from,
|
||||
to,
|
||||
int(errno));
|
||||
static const int BufSize = 65536;
|
||||
char buf[BufSize];
|
||||
while (size_t size = fread(buf, 1, BufSize, ffrom)) {
|
||||
fwrite(buf, 1, size, fto);
|
||||
}
|
||||
} else {
|
||||
writeLog(
|
||||
"Copy by sendfile '%s' to '%s' done, size: %d, result: %d.",
|
||||
from,
|
||||
to,
|
||||
int(fst.st_size),
|
||||
int(copied));
|
||||
}
|
||||
|
||||
//update to the same uid/gid
|
||||
if (!writeprotected && fchown(fileno(fto), fst.st_uid, fst.st_gid) != 0) {
|
||||
if (fchown(fileno(fto), fst.st_uid, fst.st_gid) != 0) {
|
||||
fclose(ffrom);
|
||||
fclose(fto);
|
||||
return false;
|
||||
@@ -233,7 +210,7 @@ void delFolder() {
|
||||
rmdir(delFolder.c_str());
|
||||
}
|
||||
|
||||
bool update(bool writeprotected) {
|
||||
bool update() {
|
||||
writeLog("Update started..");
|
||||
|
||||
string updDir = workDir + "tupdates/temp", readyFilePath = workDir + "tupdates/temp/ready", tdataDir = workDir + "tupdates/temp/tdata";
|
||||
@@ -346,7 +323,7 @@ bool update(bool writeprotected) {
|
||||
writeLog("Copying file '%s' to '%s'..", fname.c_str(), tofname.c_str());
|
||||
int copyTries = 0, triesLimit = 30;
|
||||
do {
|
||||
if (!copyFile(fname.c_str(), tofname.c_str(), writeprotected)) {
|
||||
if (!copyFile(fname.c_str(), tofname.c_str())) {
|
||||
++copyTries;
|
||||
usleep(100000);
|
||||
} else {
|
||||
@@ -381,7 +358,6 @@ int main(int argc, char *argv[]) {
|
||||
bool needupdate = true;
|
||||
bool autostart = false;
|
||||
bool debug = false;
|
||||
bool writeprotected = false;
|
||||
bool tosettings = false;
|
||||
bool startintray = false;
|
||||
bool testmode = false;
|
||||
@@ -407,8 +383,6 @@ int main(int argc, char *argv[]) {
|
||||
tosettings = true;
|
||||
} else if (equal(argv[i], "-workdir_custom")) {
|
||||
customWorkingDir = true;
|
||||
} else if (equal(argv[i], "-writeprotected")) {
|
||||
writeprotected = true;
|
||||
} else if (equal(argv[i], "-key") && ++i < argc) {
|
||||
key = argv[i];
|
||||
} else if (equal(argv[i], "-workpath") && ++i < argc) {
|
||||
@@ -430,7 +404,6 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
if (needupdate) writeLog("Need to update!");
|
||||
if (autostart) writeLog("From autostart!");
|
||||
if (writeprotected) writeLog("Write Protected folder!");
|
||||
|
||||
updaterName = CurrentExecutablePath(argc, argv);
|
||||
writeLog("Updater binary full path is: %s", updaterName.c_str());
|
||||
@@ -481,7 +454,7 @@ int main(int argc, char *argv[]) {
|
||||
} else {
|
||||
writeLog("Passed workpath is '%s'", workDir.c_str());
|
||||
}
|
||||
update(writeprotected);
|
||||
update();
|
||||
}
|
||||
} else {
|
||||
writeLog("Error: bad exe name!");
|
||||
@@ -521,17 +494,14 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
args.push_back(nullptr);
|
||||
|
||||
// let the parent launch instead
|
||||
if (!writeprotected) {
|
||||
pid_t pid = fork();
|
||||
switch (pid) {
|
||||
case -1:
|
||||
writeLog("fork() failed!");
|
||||
return 1;
|
||||
case 0:
|
||||
execv(args[0], args.data());
|
||||
return 1;
|
||||
}
|
||||
pid_t pid = fork();
|
||||
switch (pid) {
|
||||
case -1:
|
||||
writeLog("fork() failed!");
|
||||
return 1;
|
||||
case 0:
|
||||
execv(path, args.data());
|
||||
return 1;
|
||||
}
|
||||
|
||||
writeLog("Executed Telegram, closing log and quitting..");
|
||||
|
||||
@@ -54,7 +54,7 @@ JoinedByLinkSlice ParseJoinedByLinkSlice(
|
||||
for (const auto &importer : data.vimporters().v) {
|
||||
importer.match([&](const MTPDchatInviteImporter &data) {
|
||||
result.users.push_back({
|
||||
.user = owner.user(data.vuser_id()),
|
||||
.user = owner.user(data.vuser_id().v),
|
||||
.date = data.vdate().v,
|
||||
});
|
||||
});
|
||||
@@ -623,7 +623,7 @@ auto InviteLinks::parse(
|
||||
return invite.match([&](const MTPDchatInviteExported &data) {
|
||||
return Link{
|
||||
.link = qs(data.vlink()),
|
||||
.admin = peer->session().data().user(data.vadmin_id()),
|
||||
.admin = peer->session().data().user(data.vadmin_id().v),
|
||||
.date = data.vdate().v,
|
||||
.startDate = data.vstart_date().value_or_empty(),
|
||||
.expireDate = data.vexpire_date().value_or_empty(),
|
||||
|
||||
@@ -37,7 +37,7 @@ Key ExtractKey(const QString &query) {
|
||||
const auto params = parse();
|
||||
const auto channel = params.value("channel");
|
||||
const auto post = params.value("post").toInt();
|
||||
return (channel.toULongLong() && post) ? Key{ channel, post } : Key();
|
||||
return (channel.toInt() && post) ? Key{ channel, post } : Key();
|
||||
} else if (check.startsWith(qstr("tg://resolve"), Qt::CaseInsensitive)) {
|
||||
const auto params = parse();
|
||||
const auto domain = params.value("domain");
|
||||
@@ -112,7 +112,7 @@ std::optional<HistoryItem*> SingleMessageSearch::performLookupByChannel(
|
||||
&& received.messageIds.front() == postId) {
|
||||
_cache.emplace(
|
||||
_requestKey,
|
||||
FullMsgId(peerToChannel(channel->id), postId));
|
||||
FullMsgId(channel->bareId(), postId));
|
||||
ready();
|
||||
} else {
|
||||
fail();
|
||||
@@ -142,7 +142,7 @@ std::optional<HistoryItem*> SingleMessageSearch::performLookupById(
|
||||
_requestId = _session->api().request(MTPchannels_GetChannels(
|
||||
MTP_vector<MTPInputChannel>(
|
||||
1,
|
||||
MTP_inputChannel(MTP_int(channelId.bare), MTP_long(0))) // #TODO ids
|
||||
MTP_inputChannel(MTP_int(channelId), MTP_long(0)))
|
||||
)).done([=](const MTPmessages_Chats &result) {
|
||||
result.match([&](const auto &data) {
|
||||
const auto peer = _session->data().processChats(data.vchats());
|
||||
@@ -212,7 +212,7 @@ std::optional<HistoryItem*> SingleMessageSearch::performLookup(
|
||||
if (!_requestKey.domainOrId[0].isDigit()) {
|
||||
return performLookupByUsername(_requestKey.domainOrId, ready);
|
||||
}
|
||||
const auto channelId = ChannelId(_requestKey.domainOrId.toULongLong());
|
||||
const auto channelId = _requestKey.domainOrId.toInt();
|
||||
return performLookupById(channelId, ready);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,17 +35,15 @@ EntitiesInText EntitiesFromMTP(
|
||||
case mtpc_messageEntityMention: { auto &d = entity.c_messageEntityMention(); result.push_back({ EntityType::Mention, d.voffset().v, d.vlength().v }); } break;
|
||||
case mtpc_messageEntityMentionName: {
|
||||
const auto &d = entity.c_messageEntityMentionName();
|
||||
const auto userId = UserId(d.vuser_id());
|
||||
const auto data = [&] {
|
||||
if (session) {
|
||||
if (const auto user = session->data().userLoaded(userId)) {
|
||||
if (const auto user = session->data().userLoaded(d.vuser_id().v)) {
|
||||
return MentionNameDataFromFields({
|
||||
userId.bare,
|
||||
user->accessHash()
|
||||
});
|
||||
d.vuser_id().v,
|
||||
user->accessHash() });
|
||||
}
|
||||
}
|
||||
return MentionNameDataFromFields(userId.bare);
|
||||
return MentionNameDataFromFields(d.vuser_id().v);
|
||||
}();
|
||||
result.push_back({ EntityType::MentionName, d.voffset().v, d.vlength().v, data });
|
||||
} break;
|
||||
@@ -53,11 +51,10 @@ EntitiesInText EntitiesFromMTP(
|
||||
const auto &d = entity.c_inputMessageEntityMentionName();
|
||||
const auto data = [&] {
|
||||
if (session && d.vuser_id().type() == mtpc_inputUserSelf) {
|
||||
return MentionNameDataFromFields(session->userId().bare);
|
||||
return MentionNameDataFromFields(session->userId());
|
||||
} else if (d.vuser_id().type() == mtpc_inputUser) {
|
||||
auto &user = d.vuser_id().c_inputUser();
|
||||
const auto userId = UserId(user.vuser_id());
|
||||
return MentionNameDataFromFields({ userId.bare, user.vaccess_hash().v });
|
||||
return MentionNameDataFromFields({ user.vuser_id().v, user.vaccess_hash().v });
|
||||
}
|
||||
return QString();
|
||||
}();
|
||||
@@ -113,7 +110,7 @@ MTPVector<MTPMessageEntity> EntitiesToMTP(
|
||||
case EntityType::MentionName: {
|
||||
auto inputUser = [&](const QString &data) -> MTPInputUser {
|
||||
auto fields = MentionNameDataToFields(data);
|
||||
if (session && fields.userId == session->userId().bare) {
|
||||
if (session && fields.userId == session->userId()) {
|
||||
return MTP_inputUserSelf();
|
||||
} else if (fields.userId) {
|
||||
return MTP_inputUser(MTP_int(fields.userId), MTP_long(fields.accessHash));
|
||||
|
||||
@@ -131,13 +131,13 @@ bool MentionUsersLoaded(
|
||||
for (const auto &entity : entities.v) {
|
||||
auto type = entity.type();
|
||||
if (type == mtpc_messageEntityMentionName) {
|
||||
if (!session->data().userLoaded(entity.c_messageEntityMentionName().vuser_id())) {
|
||||
if (!session->data().userLoaded(entity.c_messageEntityMentionName().vuser_id().v)) {
|
||||
return false;
|
||||
}
|
||||
} else if (type == mtpc_inputMessageEntityMentionName) {
|
||||
auto &inputUser = entity.c_inputMessageEntityMentionName().vuser_id();
|
||||
if (inputUser.type() == mtpc_inputUser) {
|
||||
if (!session->data().userLoaded(inputUser.c_inputUser().vuser_id())) {
|
||||
if (!session->data().userLoaded(inputUser.c_inputUser().vuser_id().v)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -157,7 +157,7 @@ DataIsLoadedResult AllDataLoadedForMessage(
|
||||
}
|
||||
}
|
||||
if (const auto viaBotId = message.vvia_bot_id()) {
|
||||
if (!session->data().userLoaded(*viaBotId)) {
|
||||
if (!session->data().userLoaded(viaBotId->v)) {
|
||||
return DataIsLoadedResult::NotLoaded;
|
||||
}
|
||||
}
|
||||
@@ -181,19 +181,19 @@ DataIsLoadedResult AllDataLoadedForMessage(
|
||||
}
|
||||
return message.vaction().match(
|
||||
[&](const MTPDmessageActionChatAddUser &action) {
|
||||
for (const auto &userId : action.vusers().v) {
|
||||
if (!session->data().userLoaded(userId)) {
|
||||
for (const MTPint &userId : action.vusers().v) {
|
||||
if (!session->data().userLoaded(userId.v)) {
|
||||
return DataIsLoadedResult::NotLoaded;
|
||||
}
|
||||
}
|
||||
return DataIsLoadedResult::Ok;
|
||||
}, [&](const MTPDmessageActionChatJoinedByLink &action) {
|
||||
if (!session->data().userLoaded(action.vinviter_id())) {
|
||||
if (!session->data().userLoaded(action.vinviter_id().v)) {
|
||||
return DataIsLoadedResult::NotLoaded;
|
||||
}
|
||||
return DataIsLoadedResult::Ok;
|
||||
}, [&](const MTPDmessageActionChatDeleteUser &action) {
|
||||
if (!session->data().userLoaded(action.vuser_id())) {
|
||||
if (!session->data().userLoaded(action.vuser_id().v)) {
|
||||
return DataIsLoadedResult::NotLoaded;
|
||||
}
|
||||
return DataIsLoadedResult::Ok;
|
||||
@@ -867,11 +867,7 @@ void Updates::updateOnline() {
|
||||
}
|
||||
|
||||
bool Updates::isIdle() const {
|
||||
return _isIdle.current();
|
||||
}
|
||||
|
||||
rpl::producer<bool> Updates::isIdleValue() const {
|
||||
return _isIdle.value();
|
||||
return _isIdle;
|
||||
}
|
||||
|
||||
void Updates::updateOnline(bool gotOtherOffline) {
|
||||
@@ -885,7 +881,7 @@ void Updates::updateOnline(bool gotOtherOffline) {
|
||||
const auto idle = crl::now() - Core::App().lastNonIdleTime();
|
||||
if (idle >= config.offlineIdleTimeout) {
|
||||
isOnline = false;
|
||||
if (!isIdle()) {
|
||||
if (!_isIdle) {
|
||||
_isIdle = true;
|
||||
_idleFinishTimer.callOnce(900);
|
||||
}
|
||||
@@ -936,9 +932,10 @@ void Updates::updateOnline(bool gotOtherOffline) {
|
||||
void Updates::checkIdleFinish() {
|
||||
if (crl::now() - Core::App().lastNonIdleTime()
|
||||
< _session->serverConfig().offlineIdleTimeout) {
|
||||
updateOnline();
|
||||
_idleFinishTimer.cancel();
|
||||
_isIdle = false;
|
||||
updateOnline();
|
||||
App::wnd()->checkHistoryActivation();
|
||||
} else {
|
||||
_idleFinishTimer.callOnce(900);
|
||||
}
|
||||
@@ -1023,7 +1020,7 @@ void Updates::applyUpdatesNoPtsCheck(const MTPUpdates &updates) {
|
||||
| MTPDmessage::Flag::f_from_id;
|
||||
const auto peerUserId = d.is_out()
|
||||
? d.vuser_id()
|
||||
: MTP_int(_session->userId().bare); // #TODO ids
|
||||
: MTP_int(_session->userId());
|
||||
_session->data().addNewMessage(
|
||||
MTP_message(
|
||||
MTP_flags(flags),
|
||||
@@ -1312,8 +1309,8 @@ void Updates::applyUpdates(
|
||||
const auto viaBotId = d.vvia_bot_id();
|
||||
const auto entities = d.ventities();
|
||||
const auto fwd = d.vfwd_from();
|
||||
if (!session().data().userLoaded(d.vuser_id())
|
||||
|| (viaBotId && !session().data().userLoaded(*viaBotId))
|
||||
if (!session().data().userLoaded(d.vuser_id().v)
|
||||
|| (viaBotId && !session().data().userLoaded(viaBotId->v))
|
||||
|| (entities && !MentionUsersLoaded(&session(), *entities))
|
||||
|| (fwd && !ForwardedInfoDataLoaded(&session(), *fwd))) {
|
||||
MTP_LOG(0, ("getDifference "
|
||||
@@ -1329,14 +1326,14 @@ void Updates::applyUpdates(
|
||||
|
||||
case mtpc_updateShortChatMessage: {
|
||||
auto &d = updates.c_updateShortChatMessage();
|
||||
const auto noFrom = !session().data().userLoaded(d.vfrom_id());
|
||||
const auto chat = session().data().chatLoaded(d.vchat_id());
|
||||
const auto noFrom = !session().data().userLoaded(d.vfrom_id().v);
|
||||
const auto chat = session().data().chatLoaded(d.vchat_id().v);
|
||||
const auto viaBotId = d.vvia_bot_id();
|
||||
const auto entities = d.ventities();
|
||||
const auto fwd = d.vfwd_from();
|
||||
if (!chat
|
||||
|| noFrom
|
||||
|| (viaBotId && !session().data().userLoaded(*viaBotId))
|
||||
|| (viaBotId && !session().data().userLoaded(viaBotId->v))
|
||||
|| (entities && !MentionUsersLoaded(&session(), *entities))
|
||||
|| (fwd && !ForwardedInfoDataLoaded(&session(), *fwd))) {
|
||||
MTP_LOG(0, ("getDifference "
|
||||
@@ -1494,7 +1491,7 @@ void Updates::feedUpdate(const MTPUpdate &update) {
|
||||
|
||||
case mtpc_updateChannelReadMessagesContents: {
|
||||
auto &d = update.c_updateChannelReadMessagesContents();
|
||||
auto channel = session().data().channelLoaded(d.vchannel_id());
|
||||
auto channel = session().data().channelLoaded(d.vchannel_id().v);
|
||||
if (!channel) {
|
||||
if (!_byMinChannelTimer.isActive()) {
|
||||
// getDifference after timeout.
|
||||
@@ -1540,7 +1537,7 @@ void Updates::feedUpdate(const MTPUpdate &update) {
|
||||
|
||||
case mtpc_updatePinnedChannelMessages: {
|
||||
auto &d = update.c_updatePinnedChannelMessages();
|
||||
auto channel = session().data().channelLoaded(d.vchannel_id());
|
||||
auto channel = session().data().channelLoaded(d.vchannel_id().v);
|
||||
|
||||
if (channel && !_handlingChannelDifference) {
|
||||
if (channel->ptsRequesting()) { // skip global updates while getting channel difference
|
||||
@@ -1626,7 +1623,7 @@ void Updates::feedUpdate(const MTPUpdate &update) {
|
||||
|
||||
case mtpc_updateDeleteChannelMessages: {
|
||||
auto &d = update.c_updateDeleteChannelMessages();
|
||||
auto channel = session().data().channelLoaded(d.vchannel_id());
|
||||
auto channel = session().data().channelLoaded(d.vchannel_id().v);
|
||||
|
||||
if (channel && !_handlingChannelDifference) {
|
||||
if (channel->ptsRequesting()) { // skip global updates while getting channel difference
|
||||
@@ -1665,7 +1662,7 @@ void Updates::feedUpdate(const MTPUpdate &update) {
|
||||
session().data().processWebpage(d.vwebpage());
|
||||
session().data().sendWebPageGamePollNotifications();
|
||||
|
||||
auto channel = session().data().channelLoaded(d.vchannel_id());
|
||||
auto channel = session().data().channelLoaded(d.vchannel_id().v);
|
||||
if (channel && !_handlingChannelDifference) {
|
||||
if (channel->ptsRequesting()) { // skip global updates while getting channel difference
|
||||
return;
|
||||
@@ -1686,25 +1683,27 @@ void Updates::feedUpdate(const MTPUpdate &update) {
|
||||
handleSendActionUpdate(
|
||||
peerFromUser(d.vuser_id()),
|
||||
0,
|
||||
peerFromUser(d.vuser_id()),
|
||||
d.vuser_id().v,
|
||||
d.vaction());
|
||||
} break;
|
||||
|
||||
case mtpc_updateChatUserTyping: {
|
||||
auto &d = update.c_updateChatUserTyping();
|
||||
const auto fromId = peerFromMTP(d.vfrom_id());
|
||||
handleSendActionUpdate(
|
||||
peerFromChat(d.vchat_id()),
|
||||
0,
|
||||
peerFromMTP(d.vfrom_id()),
|
||||
fromId,
|
||||
d.vaction());
|
||||
} break;
|
||||
|
||||
case mtpc_updateChannelUserTyping: {
|
||||
const auto &d = update.c_updateChannelUserTyping();
|
||||
const auto fromId = peerFromMTP(d.vfrom_id());
|
||||
handleSendActionUpdate(
|
||||
peerFromChannel(d.vchannel_id()),
|
||||
d.vtop_msg_id().value_or_empty(),
|
||||
peerFromMTP(d.vfrom_id()),
|
||||
fromId,
|
||||
d.vaction());
|
||||
} break;
|
||||
|
||||
@@ -1730,7 +1729,7 @@ void Updates::feedUpdate(const MTPUpdate &update) {
|
||||
|
||||
case mtpc_updateUserStatus: {
|
||||
auto &d = update.c_updateUserStatus();
|
||||
if (auto user = session().data().userLoaded(d.vuser_id())) {
|
||||
if (auto user = session().data().userLoaded(d.vuser_id().v)) {
|
||||
switch (d.vstatus().type()) {
|
||||
case mtpc_userStatusEmpty: user->onlineTill = 0; break;
|
||||
case mtpc_userStatusRecently:
|
||||
@@ -1747,7 +1746,7 @@ void Updates::feedUpdate(const MTPUpdate &update) {
|
||||
user,
|
||||
Data::PeerUpdate::Flag::OnlineStatus);
|
||||
}
|
||||
if (UserId(d.vuser_id()) == session().userId()) {
|
||||
if (d.vuser_id().v == session().userId()) {
|
||||
if (d.vstatus().type() == mtpc_userStatusOffline
|
||||
|| d.vstatus().type() == mtpc_userStatusEmpty) {
|
||||
updateOnline(true);
|
||||
@@ -1764,7 +1763,7 @@ void Updates::feedUpdate(const MTPUpdate &update) {
|
||||
|
||||
case mtpc_updateUserName: {
|
||||
auto &d = update.c_updateUserName();
|
||||
if (auto user = session().data().userLoaded(d.vuser_id())) {
|
||||
if (auto user = session().data().userLoaded(d.vuser_id().v)) {
|
||||
if (!user->isContact()) {
|
||||
user->setName(
|
||||
TextUtilities::SingleLine(qs(d.vfirst_name())),
|
||||
@@ -1783,7 +1782,7 @@ void Updates::feedUpdate(const MTPUpdate &update) {
|
||||
|
||||
case mtpc_updateUserPhoto: {
|
||||
auto &d = update.c_updateUserPhoto();
|
||||
if (auto user = session().data().userLoaded(d.vuser_id())) {
|
||||
if (auto user = session().data().userLoaded(d.vuser_id().v)) {
|
||||
user->setPhoto(d.vphoto());
|
||||
user->loadUserpic();
|
||||
// After that update we don't have enough information to
|
||||
@@ -1794,11 +1793,11 @@ void Updates::feedUpdate(const MTPUpdate &update) {
|
||||
//
|
||||
//if (mtpIsTrue(d.vprevious()) || !user->userpicPhotoId()) {
|
||||
session().storage().remove(Storage::UserPhotosRemoveAfter(
|
||||
peerToUser(user->id),
|
||||
user->bareId(),
|
||||
user->userpicPhotoId()));
|
||||
//} else {
|
||||
// session().storage().add(Storage::UserPhotosAddNew(
|
||||
// peerToUser(user->id),
|
||||
// user->bareId(),
|
||||
// user->userpicPhotoId()));
|
||||
//}
|
||||
}
|
||||
@@ -1832,7 +1831,7 @@ void Updates::feedUpdate(const MTPUpdate &update) {
|
||||
|
||||
case mtpc_updateUserPhone: {
|
||||
const auto &d = update.c_updateUserPhone();
|
||||
if (const auto user = session().data().userLoaded(d.vuser_id())) {
|
||||
if (const auto user = session().data().userLoaded(d.vuser_id().v)) {
|
||||
const auto newPhone = qs(d.vphone());
|
||||
if (newPhone != user->phone()) {
|
||||
user->setPhone(newPhone);
|
||||
@@ -1881,7 +1880,6 @@ void Updates::feedUpdate(const MTPUpdate &update) {
|
||||
case mtpc_updatePhoneCall:
|
||||
case mtpc_updatePhoneCallSignalingData:
|
||||
case mtpc_updateGroupCallParticipants:
|
||||
case mtpc_updateGroupCallConnection:
|
||||
case mtpc_updateGroupCall: {
|
||||
Core::App().calls().handleUpdate(&session(), update);
|
||||
} break;
|
||||
@@ -1916,8 +1914,8 @@ void Updates::feedUpdate(const MTPUpdate &update) {
|
||||
auto &d = update.c_updatePrivacy();
|
||||
const auto allChatsLoaded = [&](const MTPVector<MTPint> &ids) {
|
||||
for (const auto &chatId : ids.v) {
|
||||
if (!session().data().chatLoaded(chatId)
|
||||
&& !session().data().channelLoaded(chatId)) {
|
||||
if (!session().data().chatLoaded(chatId.v)
|
||||
&& !session().data().channelLoaded(chatId.v)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -2001,7 +1999,7 @@ void Updates::feedUpdate(const MTPUpdate &update) {
|
||||
}
|
||||
DEBUG_LOG(("API Error: "
|
||||
"pinned chat not loaded for peer %1, folder: %2"
|
||||
).arg(id.value
|
||||
).arg(id
|
||||
).arg(folderId
|
||||
));
|
||||
return false;
|
||||
@@ -2029,7 +2027,7 @@ void Updates::feedUpdate(const MTPUpdate &update) {
|
||||
|
||||
case mtpc_updateChannel: {
|
||||
auto &d = update.c_updateChannel();
|
||||
if (const auto channel = session().data().channelLoaded(d.vchannel_id())) {
|
||||
if (const auto channel = session().data().channelLoaded(d.vchannel_id().v)) {
|
||||
channel->inviter = UserId(0);
|
||||
if (channel->amIn()) {
|
||||
if (channel->isMegagroup()
|
||||
@@ -2051,7 +2049,7 @@ void Updates::feedUpdate(const MTPUpdate &update) {
|
||||
|
||||
case mtpc_updateChannelTooLong: {
|
||||
const auto &d = update.c_updateChannelTooLong();
|
||||
if (const auto channel = session().data().channelLoaded(d.vchannel_id())) {
|
||||
if (const auto channel = session().data().channelLoaded(d.vchannel_id().v)) {
|
||||
const auto pts = d.vpts();
|
||||
if (!pts || channel->pts() < pts->v) {
|
||||
getChannelDifference(channel);
|
||||
@@ -2110,7 +2108,7 @@ void Updates::feedUpdate(const MTPUpdate &update) {
|
||||
|
||||
case mtpc_updateChannelAvailableMessages: {
|
||||
auto &d = update.c_updateChannelAvailableMessages();
|
||||
if (const auto channel = session().data().channelLoaded(d.vchannel_id())) {
|
||||
if (const auto channel = session().data().channelLoaded(d.vchannel_id().v)) {
|
||||
channel->setAvailableMinId(d.vavailable_min_id().v);
|
||||
if (const auto history = session().data().historyLoaded(channel)) {
|
||||
history->clearUpTill(d.vavailable_min_id().v);
|
||||
|
||||
@@ -40,7 +40,6 @@ public:
|
||||
|
||||
void updateOnline();
|
||||
[[nodiscard]] bool isIdle() const;
|
||||
[[nodiscard]] rpl::producer<bool> isIdleValue() const;
|
||||
void checkIdleFinish();
|
||||
bool lastWasOnline() const;
|
||||
crl::time lastSetOnline() const;
|
||||
@@ -186,7 +185,7 @@ private:
|
||||
base::Timer _idleFinishTimer;
|
||||
crl::time _lastSetOnline = 0;
|
||||
bool _lastWasOnline = false;
|
||||
rpl::variable<bool> _isIdle = false;
|
||||
bool _isIdle = false;
|
||||
|
||||
rpl::lifetime _lifetime;
|
||||
|
||||
|
||||
@@ -692,7 +692,7 @@ QString ApiWrap::exportDirectMessageLink(
|
||||
if (inRepliesContext) {
|
||||
if (const auto rootId = item->replyToTop()) {
|
||||
const auto root = item->history()->owner().message(
|
||||
peerToChannel(channel->id),
|
||||
channel->bareId(),
|
||||
rootId);
|
||||
const auto sender = root
|
||||
? root->discussionPostOriginalSender()
|
||||
@@ -715,7 +715,7 @@ QString ApiWrap::exportDirectMessageLink(
|
||||
}
|
||||
const auto base = linkChannel->hasUsername()
|
||||
? linkChannel->username
|
||||
: "c/" + QString::number(peerToChannel(linkChannel->id).bare);
|
||||
: "c/" + QString::number(linkChannel->bareId());
|
||||
const auto query = base
|
||||
+ '/'
|
||||
+ QString::number(linkItemId)
|
||||
@@ -776,7 +776,7 @@ void ApiWrap::requestContacts() {
|
||||
for (const auto &contact : d.vcontacts().v) {
|
||||
if (contact.type() != mtpc_contact) continue;
|
||||
|
||||
const auto userId = UserId(contact.c_contact().vuser_id());
|
||||
const auto userId = contact.c_contact().vuser_id().v;
|
||||
if (userId == _session->userId()) {
|
||||
_session->user()->setIsContact(true);
|
||||
}
|
||||
@@ -2267,7 +2267,7 @@ void ApiWrap::updatePrivacyLastSeens(const QVector<MTPPrivacyRule> &rules) {
|
||||
for (const auto &item : result.v) {
|
||||
Assert(item.type() == mtpc_contactStatus);
|
||||
auto &data = item.c_contactStatus();
|
||||
if (auto user = _session->data().userLoaded(data.vuser_id())) {
|
||||
if (auto user = _session->data().userLoaded(data.vuser_id().v)) {
|
||||
auto oldOnlineTill = user->onlineTill;
|
||||
auto newOnlineTill = OnlineTillFromStatus(data.vstatus(), oldOnlineTill);
|
||||
if (oldOnlineTill != newOnlineTill) {
|
||||
@@ -3566,7 +3566,7 @@ void ApiWrap::userPhotosDone(
|
||||
}
|
||||
}
|
||||
_session->storage().add(Storage::UserPhotosAddSlice(
|
||||
peerToUser(user->id),
|
||||
user->id,
|
||||
std::move(photoIds),
|
||||
fullCount
|
||||
));
|
||||
@@ -3809,7 +3809,7 @@ void ApiWrap::sendSharedContact(
|
||||
MTP_string(firstName),
|
||||
MTP_string(lastName),
|
||||
MTP_string(vcard),
|
||||
MTP_int(userId.bare)), // #TODO ids
|
||||
MTP_int(userId)),
|
||||
MTPReplyMarkup(),
|
||||
MTPVector<MTPMessageEntity>(),
|
||||
MTP_int(views),
|
||||
@@ -4613,7 +4613,7 @@ void ApiWrap::clearPeerPhoto(not_null<PhotoData*> photo) {
|
||||
MTP_vector<MTPInputPhoto>(1, photo->mtpInput())
|
||||
)).send();
|
||||
_session->storage().remove(Storage::UserPhotosRemoveOne(
|
||||
peerToUser(self->id),
|
||||
self->bareId(),
|
||||
photo->id));
|
||||
}
|
||||
}
|
||||
@@ -4790,11 +4790,11 @@ auto ApiWrap::parsePrivacy(const QVector<MTPPrivacyRule> &rules)
|
||||
}, [&](const MTPDprivacyValueAllowChatParticipants &data) {
|
||||
const auto &chats = data.vchats().v;
|
||||
always.reserve(always.size() + chats.size());
|
||||
for (const auto &chatId : chats) {
|
||||
const auto chat = _session->data().chatLoaded(chatId);
|
||||
for (const auto chatId : chats) {
|
||||
const auto chat = _session->data().chatLoaded(chatId.v);
|
||||
const auto peer = chat
|
||||
? static_cast<PeerData*>(chat)
|
||||
: _session->data().channelLoaded(chatId);
|
||||
: _session->data().channelLoaded(chatId.v);
|
||||
if (peer
|
||||
&& !base::contains(never, peer)
|
||||
&& !base::contains(always, peer)) {
|
||||
@@ -4818,11 +4818,11 @@ auto ApiWrap::parsePrivacy(const QVector<MTPPrivacyRule> &rules)
|
||||
}, [&](const MTPDprivacyValueDisallowChatParticipants &data) {
|
||||
const auto &chats = data.vchats().v;
|
||||
never.reserve(never.size() + chats.size());
|
||||
for (const auto &chatId : chats) {
|
||||
const auto chat = _session->data().chatLoaded(chatId);
|
||||
for (const auto chatId : chats) {
|
||||
const auto chat = _session->data().chatLoaded(chatId.v);
|
||||
const auto peer = chat
|
||||
? static_cast<PeerData*>(chat)
|
||||
: _session->data().channelLoaded(chatId);
|
||||
: _session->data().channelLoaded(chatId.v);
|
||||
if (peer
|
||||
&& !base::contains(always, peer)
|
||||
&& !base::contains(never, peer)) {
|
||||
|
||||
@@ -76,15 +76,6 @@ inline QString ToString(uint64 value) {
|
||||
return QString::number(value);
|
||||
}
|
||||
|
||||
template <uchar Shift>
|
||||
inline QString ToString(ChatIdType<Shift> value) {
|
||||
return QString::number(value.bare);
|
||||
}
|
||||
|
||||
inline QString ToString(PeerId value) {
|
||||
return QString::number(value.value);
|
||||
}
|
||||
|
||||
} // namespace details
|
||||
|
||||
template <
|
||||
|
||||
@@ -94,7 +94,7 @@ void ChatCreateDone(
|
||||
}
|
||||
| [&](auto chats) {
|
||||
return navigation->session().data().chat(
|
||||
chats->front().c_chat().vid());
|
||||
chats->front().c_chat().vid().v);
|
||||
}
|
||||
| [&](not_null<ChatData*> chat) {
|
||||
if (!image.isNull()) {
|
||||
@@ -401,7 +401,7 @@ void AddContactBox::save() {
|
||||
const auto extractUser = [&](const MTPImportedContact &data) {
|
||||
return data.match([&](const MTPDimportedContact &data) {
|
||||
return (data.vclient_id().v == _contactId)
|
||||
? _session->data().userLoaded(data.vuser_id())
|
||||
? _session->data().userLoaded(data.vuser_id().v)
|
||||
: nullptr;
|
||||
});
|
||||
};
|
||||
@@ -687,7 +687,7 @@ void GroupInfoBox::createChannel(const QString &title, const QString &descriptio
|
||||
}
|
||||
| [&](auto chats) {
|
||||
return _navigation->session().data().channel(
|
||||
chats->front().c_channel().vid());
|
||||
chats->front().c_channel().vid().v);
|
||||
}
|
||||
| [&](not_null<ChannelData*> channel) {
|
||||
auto image = _photo->takeResultImage();
|
||||
|
||||
@@ -295,7 +295,7 @@ AdminLog::OwnedItem GenerateTextItem(
|
||||
| (out ? Flag::f_out : Flag(0));
|
||||
const auto clientFlags = MTPDmessage_ClientFlag::f_fake_history_item;
|
||||
const auto replyTo = 0;
|
||||
const auto viaBotId = UserId(0);
|
||||
const auto viaBotId = 0;
|
||||
const auto item = history->makeMessage(
|
||||
++id,
|
||||
flags,
|
||||
@@ -402,12 +402,14 @@ BackgroundPreviewBox::BackgroundPreviewBox(
|
||||
, _controller(controller)
|
||||
, _text1(GenerateTextItem(
|
||||
delegate(),
|
||||
_controller->session().data().history(PeerData::kServiceNotificationsId),
|
||||
_controller->session().data().history(
|
||||
peerFromUser(PeerData::kServiceNotificationsId)),
|
||||
tr::lng_background_text1(tr::now),
|
||||
false))
|
||||
, _text2(GenerateTextItem(
|
||||
delegate(),
|
||||
_controller->session().data().history(PeerData::kServiceNotificationsId),
|
||||
_controller->session().data().history(
|
||||
peerFromUser(PeerData::kServiceNotificationsId)),
|
||||
tr::lng_background_text2(tr::now),
|
||||
true))
|
||||
, _paper(paper)
|
||||
|
||||
@@ -433,7 +433,7 @@ editMediaButtonFileSkipRight: 1px;
|
||||
editMediaButtonFileSkipTop: 7px;
|
||||
|
||||
editMediaButtonIconFile: icon {{ "settings_edit", menuIconFg }};
|
||||
editMediaButtonIconPhoto: icon {{ "settings_edit", roundedFg }};
|
||||
editMediaButtonIconPhoto: icon {{ "settings_edit", msgServiceFg }};
|
||||
editMediaButton: IconButton {
|
||||
width: editMediaButtonSize;
|
||||
height: editMediaButtonSize;
|
||||
@@ -464,8 +464,8 @@ sendBoxAlbumGroupButtonFile: IconButton(editMediaButton) {
|
||||
sendBoxAlbumGroupEditButtonIconFile: editMediaButtonIconFile;
|
||||
sendBoxAlbumGroupDeleteButtonIconFile: icon {{ "history_file_cancel", menuIconFg, point(6px, 6px) }};
|
||||
|
||||
sendBoxAlbumGroupButtonMediaEdit: icon {{ "settings_edit", roundedFg, point(3px, -2px) }};
|
||||
sendBoxAlbumGroupButtonMediaDelete: icon {{ "history_file_cancel", roundedFg, point(2px, 5px) }};
|
||||
sendBoxAlbumGroupButtonMediaEdit: icon {{ "settings_edit", msgServiceFg, point(3px, -2px) }};
|
||||
sendBoxAlbumGroupButtonMediaDelete: icon {{ "history_file_cancel", msgServiceFg, point(2px, 5px) }};
|
||||
sendBoxAlbumGroupButtonMedia: IconButton {
|
||||
width: sendBoxAlbumGroupHeight;
|
||||
height: sendBoxAlbumGroupHeight;
|
||||
@@ -729,6 +729,10 @@ termsAgePadding: margins(22px, 16px, 16px, 0px);
|
||||
|
||||
themesSmallSkip: 10px;
|
||||
themesBackgroundSize: 120px;
|
||||
themesScroll: ScrollArea(defaultScrollArea) {
|
||||
bottomsh: 0px;
|
||||
topsh: 0px;
|
||||
}
|
||||
themesMenuToggle: IconButton(defaultIconButton) {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
|
||||
@@ -304,10 +304,9 @@ void ConfirmBox::mouseReleaseEvent(QMouseEvent *e) {
|
||||
_lastMousePos = e->globalPos();
|
||||
updateHover();
|
||||
if (const auto activated = ClickHandler::unpressed()) {
|
||||
ActivateClickHandler(window(), activated, e->button());
|
||||
crl::on_main(this, [=] {
|
||||
closeBox();
|
||||
});
|
||||
const auto guard = window();
|
||||
Ui::hideLayer();
|
||||
ActivateClickHandler(guard, activated, e->button());
|
||||
return;
|
||||
}
|
||||
BoxContent::mouseReleaseEvent(e);
|
||||
|
||||
@@ -26,7 +26,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "ui/effects/animations.h"
|
||||
#include "ui/effects/radial_animation.h"
|
||||
#include "ui/text/text_options.h"
|
||||
#include "ui/basic_click_handlers.h"
|
||||
#include "facades.h"
|
||||
#include "styles/style_layers.h"
|
||||
#include "styles/style_boxes.h"
|
||||
@@ -1087,25 +1086,10 @@ void ProxiesBoxController::ShowApplyConfirmation(
|
||||
proxy.password = fields.value(qsl("secret"));
|
||||
}
|
||||
if (proxy) {
|
||||
const auto displayed = "https://" + server + "/";
|
||||
const auto parsed = QUrl::fromUserInput(displayed);
|
||||
const auto displayUrl = !UrlClickHandler::IsSuspicious(displayed)
|
||||
? displayed
|
||||
: parsed.isValid()
|
||||
? QString::fromUtf8(parsed.toEncoded())
|
||||
: UrlClickHandler::ShowEncoded(displayed);
|
||||
const auto displayServer = QString(
|
||||
displayUrl
|
||||
).replace(
|
||||
QRegularExpression(
|
||||
"^https://",
|
||||
QRegularExpression::CaseInsensitiveOption),
|
||||
QString()
|
||||
).replace(QRegularExpression("/$"), QString());
|
||||
const auto text = tr::lng_sure_enable_socks(
|
||||
tr::now,
|
||||
lt_server,
|
||||
displayServer,
|
||||
server,
|
||||
lt_port,
|
||||
QString::number(port))
|
||||
+ (proxy.type == Type::Mtproto
|
||||
|
||||
@@ -47,7 +47,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/checkbox.h"
|
||||
#include "ui/widgets/checkbox.h"
|
||||
#include "ui/text/format_song_document_name.h"
|
||||
#include "ui/text/format_values.h"
|
||||
#include "ui/text/text_options.h"
|
||||
#include "ui/chat/attach/attach_prepare.h"
|
||||
@@ -221,7 +220,7 @@ EditCaptionBox::EditCaptionBox(
|
||||
const auto document = _documentMedia->owner();
|
||||
const auto nameString = document->isVoiceMessage()
|
||||
? tr::lng_media_audio(tr::now)
|
||||
: Ui::Text::FormatSongNameFor(document).string();
|
||||
: document->composeNameString();
|
||||
setName(nameString, document->size);
|
||||
_isImage = document->isImage();
|
||||
_isAudio = document->isVoiceMessage()
|
||||
@@ -487,13 +486,13 @@ void EditCaptionBox::handleStreamingError(Error &&error) {
|
||||
}
|
||||
|
||||
void EditCaptionBox::streamingReady(Information &&info) {
|
||||
const auto calculateGifDimensions = [&] {
|
||||
const auto calculateGifDimensions = [&]() {
|
||||
const auto scaled = QSize(
|
||||
info.video.size.width(),
|
||||
info.video.size.height()
|
||||
).scaled(
|
||||
st::sendMediaPreviewSize,
|
||||
st::confirmMaxHeight,
|
||||
st::sendMediaPreviewSize * cIntRetinaFactor(),
|
||||
st::confirmMaxHeight * cIntRetinaFactor(),
|
||||
Qt::KeepAspectRatio);
|
||||
_thumbw = _gifw = scaled.width();
|
||||
_thumbh = _gifh = scaled.height();
|
||||
@@ -550,10 +549,10 @@ void EditCaptionBox::updateEditPreview() {
|
||||
if (shouldAsDoc) {
|
||||
auto nameString = filename;
|
||||
if (const auto song = std::get_if<Info::Song>(fileMedia)) {
|
||||
nameString = Ui::Text::FormatSongName(
|
||||
nameString = Ui::ComposeNameString(
|
||||
filename,
|
||||
song->title,
|
||||
song->performer).string();
|
||||
song->performer);
|
||||
_isAudio = true;
|
||||
|
||||
if (auto cover = song->cover; !cover.isNull()) {
|
||||
@@ -621,7 +620,7 @@ void EditCaptionBox::updateEditMediaButton() {
|
||||
const auto icon = _doc
|
||||
? &st::editMediaButtonIconFile
|
||||
: &st::editMediaButtonIconPhoto;
|
||||
const auto color = _doc ? &st::windowBgRipple : &st::roundedBg;
|
||||
const auto color = _doc ? &st::windowBgRipple : &st::callFingerprintBg;
|
||||
_editMedia->setIconOverride(icon);
|
||||
_editMedia->setRippleColorOverride(color);
|
||||
_editMedia->setForceRippled(!_doc, anim::type::instant);
|
||||
|
||||
@@ -349,9 +349,7 @@ EditColorBox::Slider::Slider(
|
||||
, _type(type)
|
||||
, _color(color.red(), color.green(), color.blue())
|
||||
, _value(valueFromColor(color))
|
||||
, _transparent((_type == Type::Opacity)
|
||||
? style::TransparentPlaceholder()
|
||||
: QBrush()) {
|
||||
, _transparent((_type == Type::Opacity) ? style::transparentPlaceholderBrush() : QBrush()) {
|
||||
prepareMinSize();
|
||||
}
|
||||
|
||||
@@ -760,7 +758,7 @@ EditColorBox::EditColorBox(
|
||||
, _greenField(this, st::colorValueInput, "G", 255)
|
||||
, _blueField(this, st::colorValueInput, "B", 255)
|
||||
, _result(this, st::colorResultInput)
|
||||
, _transparent(style::TransparentPlaceholder())
|
||||
, _transparent(style::transparentPlaceholderBrush())
|
||||
, _current(current)
|
||||
, _new(current) {
|
||||
if (_mode == Mode::RGBA) {
|
||||
|
||||
@@ -182,11 +182,11 @@ QVector<MTPInputPrivacyRule> EditPrivacyBox::collectResult() {
|
||||
return result;
|
||||
};
|
||||
const auto collectInputChats = [](const auto &peers) {
|
||||
auto result = QVector<MTPint>(); // #TODO ids
|
||||
auto result = QVector<MTPint>();
|
||||
result.reserve(peers.size());
|
||||
for (const auto peer : peers) {
|
||||
if (!peer->isUser()) {
|
||||
result.push_back(peerToBareMTPInt(peer->id));
|
||||
result.push_back(MTP_int(peer->bareId()));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
||||
@@ -119,7 +119,7 @@ private:
|
||||
}
|
||||
|
||||
[[nodiscard]] uint64 TypeId(Flag flag) {
|
||||
return PeerId(FakeChatId(static_cast<BareId>(flag))).value;
|
||||
return PeerIdFakeShift | static_cast<uint64>(flag);
|
||||
}
|
||||
|
||||
TypeRow::TypeRow(Flag flag) : PeerListRow(TypeId(flag)) {
|
||||
|
||||
@@ -361,11 +361,7 @@ void PasscodeBox::closeReplacedBy() {
|
||||
}
|
||||
|
||||
void PasscodeBox::setPasswordFail(const MTP::Error &error) {
|
||||
setPasswordFail(error.type());
|
||||
}
|
||||
|
||||
void PasscodeBox::setPasswordFail(const QString &type) {
|
||||
if (MTP::IsFloodError(type)) {
|
||||
if (MTP::IsFloodError(error)) {
|
||||
closeReplacedBy();
|
||||
_setRequest = 0;
|
||||
|
||||
@@ -382,19 +378,20 @@ void PasscodeBox::setPasswordFail(const QString &type) {
|
||||
|
||||
closeReplacedBy();
|
||||
_setRequest = 0;
|
||||
if (type == qstr("PASSWORD_HASH_INVALID")
|
||||
|| type == qstr("SRP_PASSWORD_CHANGED")) {
|
||||
const auto &err = error.type();
|
||||
if (err == qstr("PASSWORD_HASH_INVALID")
|
||||
|| err == qstr("SRP_PASSWORD_CHANGED")) {
|
||||
if (_oldPasscode->isHidden()) {
|
||||
_passwordReloadNeeded.fire({});
|
||||
closeBox();
|
||||
} else {
|
||||
badOldPasscode();
|
||||
}
|
||||
} else if (type == qstr("SRP_ID_INVALID")) {
|
||||
} else if (err == qstr("SRP_ID_INVALID")) {
|
||||
handleSrpIdInvalid();
|
||||
//} else if (type == qstr("NEW_PASSWORD_BAD")) {
|
||||
//} else if (type == qstr("NEW_SALT_INVALID")) {
|
||||
} else if (type == qstr("EMAIL_INVALID")) {
|
||||
//} else if (err == qstr("NEW_PASSWORD_BAD")) {
|
||||
//} else if (err == qstr("NEW_SALT_INVALID")) {
|
||||
} else if (err == qstr("EMAIL_INVALID")) {
|
||||
_emailError = tr::lng_cloud_password_bad_email(tr::now);
|
||||
_recoverEmail->setFocus();
|
||||
_recoverEmail->showError();
|
||||
@@ -685,15 +682,12 @@ void PasscodeBox::serverError() {
|
||||
}
|
||||
|
||||
bool PasscodeBox::handleCustomCheckError(const MTP::Error &error) {
|
||||
return handleCustomCheckError(error.type());
|
||||
}
|
||||
|
||||
bool PasscodeBox::handleCustomCheckError(const QString &type) {
|
||||
if (MTP::IsFloodError(type)
|
||||
const auto &type = error.type();
|
||||
if (MTP::IsFloodError(error)
|
||||
|| type == qstr("PASSWORD_HASH_INVALID")
|
||||
|| type == qstr("SRP_PASSWORD_CHANGED")
|
||||
|| type == qstr("SRP_ID_INVALID")) {
|
||||
setPasswordFail(type);
|
||||
setPasswordFail(error);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -56,7 +56,6 @@ public:
|
||||
rpl::producer<> clearUnconfirmedPassword() const;
|
||||
|
||||
bool handleCustomCheckError(const MTP::Error &error);
|
||||
bool handleCustomCheckError(const QString &type);
|
||||
|
||||
protected:
|
||||
void prepare() override;
|
||||
@@ -83,7 +82,6 @@ private:
|
||||
|
||||
void setPasswordDone(const QByteArray &newPasswordBytes);
|
||||
void setPasswordFail(const MTP::Error &error);
|
||||
void setPasswordFail(const QString &type);
|
||||
void setPasswordFail(
|
||||
const QByteArray &newPasswordBytes,
|
||||
const QString &email,
|
||||
|
||||
@@ -86,8 +86,8 @@ void PeerListBox::createMultiSelect() {
|
||||
if (_controller->handleDeselectForeignRow(itemId)) {
|
||||
return;
|
||||
}
|
||||
if (const auto peer = _controller->session().data().peerLoaded(PeerId(itemId))) {
|
||||
if (const auto row = peerListFindRow(itemId)) {
|
||||
if (const auto peer = _controller->session().data().peerLoaded(itemId)) {
|
||||
if (const auto row = peerListFindRow(peer->id)) {
|
||||
content()->changeCheckState(row, false, anim::type::normal);
|
||||
update();
|
||||
}
|
||||
@@ -275,11 +275,11 @@ void PeerListController::search(const QString &query) {
|
||||
}
|
||||
|
||||
void PeerListController::peerListSearchAddRow(not_null<PeerData*> peer) {
|
||||
if (auto row = delegate()->peerListFindRow(peer->id.value)) {
|
||||
Assert(row->id() == row->peer()->id.value);
|
||||
if (auto row = delegate()->peerListFindRow(peer->id)) {
|
||||
Assert(row->id() == row->peer()->id);
|
||||
delegate()->peerListAppendFoundRow(row);
|
||||
} else if (auto row = createSearchRow(peer)) {
|
||||
Assert(row->id() == row->peer()->id.value);
|
||||
Assert(row->id() == row->peer()->id);
|
||||
delegate()->peerListAppendSearchRow(std::move(row));
|
||||
}
|
||||
}
|
||||
@@ -353,7 +353,7 @@ void PeerListBox::addSelectItem(
|
||||
? tr::lng_replies_messages(tr::now)
|
||||
: peer->shortName();
|
||||
addSelectItem(
|
||||
peer->id.value,
|
||||
peer->id,
|
||||
text,
|
||||
PaintUserpicCallback(peer, respect),
|
||||
animated);
|
||||
@@ -420,7 +420,7 @@ auto PeerListBox::collectSelectedRows()
|
||||
result.reserve(items.size());
|
||||
for (const auto itemId : items) {
|
||||
if (!_controller->isForeignRow(itemId)) {
|
||||
result.push_back(_controller->session().data().peer(PeerId(itemId)));
|
||||
result.push_back(_controller->session().data().peer(itemId));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -428,13 +428,12 @@ auto PeerListBox::collectSelectedRows()
|
||||
}
|
||||
|
||||
PeerListRow::PeerListRow(not_null<PeerData*> peer)
|
||||
: PeerListRow(peer, peer->id.value) {
|
||||
: PeerListRow(peer, peer->id) {
|
||||
}
|
||||
|
||||
PeerListRow::PeerListRow(not_null<PeerData*> peer, PeerListRowId id)
|
||||
: _id(id)
|
||||
, _peer(peer)
|
||||
, _hidden(false)
|
||||
, _initialized(false)
|
||||
, _isSearchResult(false)
|
||||
, _isSavedMessagesChat(false)
|
||||
@@ -443,7 +442,6 @@ PeerListRow::PeerListRow(not_null<PeerData*> peer, PeerListRowId id)
|
||||
|
||||
PeerListRow::PeerListRow(PeerListRowId id)
|
||||
: _id(id)
|
||||
, _hidden(false)
|
||||
, _initialized(false)
|
||||
, _isSearchResult(false)
|
||||
, _isSavedMessagesChat(false)
|
||||
@@ -531,7 +529,7 @@ QString PeerListRow::generateShortName() {
|
||||
: peer()->shortName();
|
||||
}
|
||||
|
||||
std::shared_ptr<Data::CloudImageView> &PeerListRow::ensureUserpicView() {
|
||||
std::shared_ptr<Data::CloudImageView> PeerListRow::ensureUserpicView() {
|
||||
if (!_userpic) {
|
||||
_userpic = peer()->createUserpicView();
|
||||
}
|
||||
@@ -590,14 +588,11 @@ void PeerListRow::paintStatusText(
|
||||
_status.drawLeftElided(p, x, y, availableWidth, outerWidth);
|
||||
}
|
||||
|
||||
template <typename MaskGenerator, typename UpdateCallback>
|
||||
void PeerListRow::addRipple(const style::PeerListItem &st, MaskGenerator &&maskGenerator, QPoint point, UpdateCallback &&updateCallback) {
|
||||
template <typename UpdateCallback>
|
||||
void PeerListRow::addRipple(const style::PeerListItem &st, QSize size, QPoint point, UpdateCallback updateCallback) {
|
||||
if (!_ripple) {
|
||||
auto mask = maskGenerator();
|
||||
if (mask.isNull()) {
|
||||
return;
|
||||
}
|
||||
_ripple = std::make_unique<Ui::RippleAnimation>(st.button.ripple, std::move(mask), std::forward<UpdateCallback>(updateCallback));
|
||||
auto mask = Ui::RippleAnimation::rectMask(size);
|
||||
_ripple = std::make_unique<Ui::RippleAnimation>(st.button.ripple, std::move(mask), std::move(updateCallback));
|
||||
}
|
||||
_ripple->add(point);
|
||||
}
|
||||
@@ -746,42 +741,12 @@ PeerListContent::PeerListContent(
|
||||
_repaintByStatus.setCallback([this] { update(); });
|
||||
}
|
||||
|
||||
void PeerListContent::setMode(Mode mode) {
|
||||
if (mode == Mode::Default && _mode == Mode::Default) {
|
||||
return;
|
||||
}
|
||||
_mode = mode;
|
||||
switch (_mode) {
|
||||
case Mode::Default:
|
||||
_rowHeight = _st.item.height;
|
||||
break;
|
||||
case Mode::Custom:
|
||||
_rowHeight = _controller->customRowHeight();
|
||||
break;
|
||||
}
|
||||
const auto wasMouseSelection = _mouseSelection;
|
||||
const auto wasLastMousePosition = _lastMousePosition;
|
||||
_contextMenu = nullptr;
|
||||
if (wasMouseSelection) {
|
||||
setSelected(Selected());
|
||||
}
|
||||
setPressed(Selected());
|
||||
refreshRows();
|
||||
if (wasMouseSelection && wasLastMousePosition) {
|
||||
selectByMouse(*wasLastMousePosition);
|
||||
}
|
||||
}
|
||||
|
||||
void PeerListContent::appendRow(std::unique_ptr<PeerListRow> row) {
|
||||
Expects(row != nullptr);
|
||||
|
||||
if (_rowsById.find(row->id()) == _rowsById.cend()) {
|
||||
row->setAbsoluteIndex(_rows.size());
|
||||
addRowEntry(row.get());
|
||||
if (!_hiddenRows.empty()) {
|
||||
Assert(!row->hidden());
|
||||
_filterResults.push_back(row.get());
|
||||
}
|
||||
_rows.push_back(std::move(row));
|
||||
}
|
||||
}
|
||||
@@ -819,17 +784,6 @@ void PeerListContent::changeCheckState(
|
||||
[=] { updateRow(row); });
|
||||
}
|
||||
|
||||
void PeerListContent::setRowHidden(not_null<PeerListRow*> row, bool hidden) {
|
||||
Expects(!row->isSearchResult());
|
||||
|
||||
row->setHidden(hidden);
|
||||
if (hidden) {
|
||||
_hiddenRows.emplace(row);
|
||||
} else {
|
||||
_hiddenRows.remove(row);
|
||||
}
|
||||
}
|
||||
|
||||
void PeerListContent::addRowEntry(not_null<PeerListRow*> row) {
|
||||
if (_controller->respectSavedMessagesChat() && !row->special()) {
|
||||
if (row->peer()->isSelf()) {
|
||||
@@ -846,7 +800,7 @@ void PeerListContent::addRowEntry(not_null<PeerListRow*> row) {
|
||||
addToSearchIndex(row);
|
||||
}
|
||||
if (_controller->isRowSelected(row)) {
|
||||
Assert(row->special() || row->id() == row->peer()->id.value);
|
||||
Assert(row->special() || row->id() == row->peer()->id);
|
||||
changeCheckState(row, true, anim::type::instant);
|
||||
}
|
||||
}
|
||||
@@ -896,10 +850,6 @@ void PeerListContent::prependRow(std::unique_ptr<PeerListRow> row) {
|
||||
|
||||
if (_rowsById.find(row->id()) == _rowsById.cend()) {
|
||||
addRowEntry(row.get());
|
||||
if (!_hiddenRows.empty()) {
|
||||
Assert(!row->hidden());
|
||||
_filterResults.insert(_filterResults.begin(), row.get());
|
||||
}
|
||||
_rows.insert(_rows.begin(), std::move(row));
|
||||
refreshIndices();
|
||||
}
|
||||
@@ -915,10 +865,6 @@ void PeerListContent::prependRowFromSearchResult(not_null<PeerListRow*> row) {
|
||||
Assert(_searchRows[index].get() == row);
|
||||
|
||||
row->setIsSearchResult(false);
|
||||
if (!_hiddenRows.empty()) {
|
||||
Assert(!row->hidden());
|
||||
_filterResults.insert(_filterResults.begin(), row);
|
||||
}
|
||||
_rows.insert(_rows.begin(), std::move(_searchRows[index]));
|
||||
refreshIndices();
|
||||
removeRowAtIndex(_searchRows, index);
|
||||
@@ -972,7 +918,6 @@ void PeerListContent::removeRow(not_null<PeerListRow*> row) {
|
||||
_filterResults.erase(
|
||||
ranges::remove(_filterResults, row),
|
||||
end(_filterResults));
|
||||
_hiddenRows.remove(row);
|
||||
removeRowAtIndex(eraseFrom, index);
|
||||
|
||||
restoreSelection();
|
||||
@@ -1010,9 +955,7 @@ void PeerListContent::convertRowToSearchResult(not_null<PeerListRow*> row) {
|
||||
|
||||
removeFromSearchIndex(row);
|
||||
row->setIsSearchResult(true);
|
||||
row->setHidden(false);
|
||||
row->setAbsoluteIndex(_searchRows.size());
|
||||
_hiddenRows.remove(row);
|
||||
_searchRows.push_back(std::move(_rows[index]));
|
||||
removeRowAtIndex(_rows, index);
|
||||
}
|
||||
@@ -1097,14 +1040,6 @@ int PeerListContent::labelHeight() const {
|
||||
}
|
||||
|
||||
void PeerListContent::refreshRows() {
|
||||
if (!_hiddenRows.empty()) {
|
||||
_filterResults.clear();
|
||||
for (const auto &row : _rows) {
|
||||
if (!row->hidden()) {
|
||||
_filterResults.push_back(row.get());
|
||||
}
|
||||
}
|
||||
}
|
||||
resizeToWidth(width());
|
||||
if (_visibleBottom > 0) {
|
||||
checkScrollForPreload();
|
||||
@@ -1118,7 +1053,7 @@ void PeerListContent::refreshRows() {
|
||||
void PeerListContent::setSearchMode(PeerListSearchMode mode) {
|
||||
if (_searchMode != mode) {
|
||||
if (!addingToSearchIndex()) {
|
||||
for (const auto &row : _rows) {
|
||||
for_const (auto &row, _rows) {
|
||||
addToSearchIndex(row.get());
|
||||
}
|
||||
}
|
||||
@@ -1145,27 +1080,25 @@ void PeerListContent::clearSearchRows() {
|
||||
void PeerListContent::paintEvent(QPaintEvent *e) {
|
||||
Painter p(this);
|
||||
|
||||
const auto clip = e->rect();
|
||||
if (_mode != Mode::Custom) {
|
||||
p.fillRect(clip, _st.item.button.textBg);
|
||||
}
|
||||
auto clip = e->rect();
|
||||
p.fillRect(clip, _st.item.button.textBg);
|
||||
|
||||
const auto repaintByStatusAfter = _repaintByStatus.remainingTime();
|
||||
auto repaintByStatusAfter = _repaintByStatus.remainingTime();
|
||||
auto repaintAfterMin = repaintByStatusAfter;
|
||||
|
||||
const auto rowsTopCached = rowsTop();
|
||||
const auto now = crl::now();
|
||||
const auto yFrom = clip.y() - rowsTopCached;
|
||||
const auto yTo = clip.y() + clip.height() - rowsTopCached;
|
||||
auto rowsTopCached = rowsTop();
|
||||
auto ms = crl::now();
|
||||
auto yFrom = clip.y() - rowsTopCached;
|
||||
auto yTo = clip.y() + clip.height() - rowsTopCached;
|
||||
p.translate(0, rowsTopCached);
|
||||
const auto count = shownRowsCount();
|
||||
auto count = shownRowsCount();
|
||||
if (count > 0) {
|
||||
const auto from = floorclamp(yFrom, _rowHeight, 0, count);
|
||||
const auto to = ceilclamp(yTo, _rowHeight, 0, count);
|
||||
auto from = floorclamp(yFrom, _rowHeight, 0, count);
|
||||
auto to = ceilclamp(yTo, _rowHeight, 0, count);
|
||||
p.translate(0, from * _rowHeight);
|
||||
for (auto index = from; index != to; ++index) {
|
||||
const auto repaintAfter = paintRow(p, now, RowIndex(index));
|
||||
if (repaintAfter > 0
|
||||
auto repaintAfter = paintRow(p, ms, RowIndex(index));
|
||||
if (repaintAfter >= 0
|
||||
&& (repaintAfterMin < 0
|
||||
|| repaintAfterMin > repaintAfter)) {
|
||||
repaintAfterMin = repaintAfter;
|
||||
@@ -1280,16 +1213,9 @@ void PeerListContent::mousePressEvent(QMouseEvent *e) {
|
||||
row->addActionRipple(point, std::move(updateCallback));
|
||||
}
|
||||
} else {
|
||||
auto size = QSize(width(), _rowHeight);
|
||||
auto point = mapFromGlobal(QCursor::pos()) - QPoint(0, getRowTop(_selected.index));
|
||||
if (_mode == Mode::Custom) {
|
||||
row->addRipple(_st.item, _controller->customRowRippleMaskGenerator(), point, std::move(updateCallback));
|
||||
} else {
|
||||
const auto maskGenerator = [&] {
|
||||
return Ui::RippleAnimation::rectMask(
|
||||
QSize(width(), _rowHeight));
|
||||
};
|
||||
row->addRipple(_st.item, maskGenerator, point, std::move(updateCallback));
|
||||
}
|
||||
row->addRipple(_st.item, size, point, std::move(updateCallback));
|
||||
}
|
||||
}
|
||||
if (anim::Disabled()) {
|
||||
@@ -1320,22 +1246,13 @@ void PeerListContent::mousePressReleased(Qt::MouseButton button) {
|
||||
|
||||
void PeerListContent::showRowMenu(
|
||||
not_null<PeerListRow*> row,
|
||||
bool highlightRow,
|
||||
Fn<void(not_null<Ui::PopupMenu*>)> destroyed) {
|
||||
const auto index = findRowIndex(row);
|
||||
showRowMenu(
|
||||
index,
|
||||
row,
|
||||
QCursor::pos(),
|
||||
highlightRow,
|
||||
std::move(destroyed));
|
||||
showRowMenu(findRowIndex(row), QCursor::pos(), std::move(destroyed));
|
||||
}
|
||||
|
||||
bool PeerListContent::showRowMenu(
|
||||
RowIndex index,
|
||||
PeerListRow *row,
|
||||
QPoint globalPos,
|
||||
bool highlightRow,
|
||||
Fn<void(not_null<Ui::PopupMenu*>)> destroyed) {
|
||||
if (_contextMenu) {
|
||||
_contextMenu->setDestroyedCallback(nullptr);
|
||||
@@ -1346,9 +1263,7 @@ bool PeerListContent::showRowMenu(
|
||||
mousePressReleased(_pressButton);
|
||||
}
|
||||
|
||||
if (highlightRow) {
|
||||
row = getRow(index);
|
||||
}
|
||||
const auto row = getRow(index);
|
||||
if (!row) {
|
||||
return false;
|
||||
}
|
||||
@@ -1359,15 +1274,11 @@ bool PeerListContent::showRowMenu(
|
||||
return false;
|
||||
}
|
||||
|
||||
if (highlightRow) {
|
||||
setContexted({ index, false });
|
||||
}
|
||||
setContexted({ index, false });
|
||||
raw->setDestroyedCallback(crl::guard(
|
||||
this,
|
||||
[=] {
|
||||
if (highlightRow) {
|
||||
setContexted(Selected());
|
||||
}
|
||||
setContexted(Selected());
|
||||
handleMouseMove(QCursor::pos());
|
||||
if (destroyed) {
|
||||
destroyed(raw);
|
||||
@@ -1381,7 +1292,7 @@ void PeerListContent::contextMenuEvent(QContextMenuEvent *e) {
|
||||
if (e->reason() == QContextMenuEvent::Mouse) {
|
||||
handleMouseMove(e->globalPos());
|
||||
}
|
||||
if (showRowMenu(_selected.index, nullptr, e->globalPos(), true)) {
|
||||
if (showRowMenu(_selected.index, e->globalPos())) {
|
||||
e->accept();
|
||||
}
|
||||
}
|
||||
@@ -1396,7 +1307,7 @@ void PeerListContent::setPressed(Selected pressed) {
|
||||
|
||||
crl::time PeerListContent::paintRow(
|
||||
Painter &p,
|
||||
crl::time now,
|
||||
crl::time ms,
|
||||
RowIndex index) {
|
||||
const auto row = getRow(index);
|
||||
Assert(row != nullptr);
|
||||
@@ -1404,15 +1315,13 @@ crl::time PeerListContent::paintRow(
|
||||
row->lazyInitialize(_st.item);
|
||||
|
||||
auto refreshStatusAt = row->refreshStatusTime();
|
||||
if (refreshStatusAt > 0 && now >= refreshStatusAt) {
|
||||
if (refreshStatusAt >= 0 && ms >= refreshStatusAt) {
|
||||
row->refreshStatus();
|
||||
refreshStatusAt = row->refreshStatusTime();
|
||||
}
|
||||
const auto refreshStatusIn = (refreshStatusAt > 0)
|
||||
? std::max(refreshStatusAt - now, crl::time(1))
|
||||
: 0;
|
||||
|
||||
const auto peer = row->special() ? nullptr : row->peer().get();
|
||||
const auto user = peer ? peer->asUser() : nullptr;
|
||||
const auto active = (_contexted.index.value >= 0)
|
||||
? _contexted
|
||||
: (_pressed.index.value >= 0)
|
||||
@@ -1421,11 +1330,6 @@ crl::time PeerListContent::paintRow(
|
||||
const auto selected = (active.index == index);
|
||||
const auto actionSelected = (selected && active.action);
|
||||
|
||||
if (_mode == Mode::Custom) {
|
||||
_controller->customRowPaint(p, now, row, selected);
|
||||
return refreshStatusIn;
|
||||
}
|
||||
|
||||
const auto &bg = selected
|
||||
? _st.item.button.textBgOver
|
||||
: _st.item.button.textBg;
|
||||
@@ -1508,7 +1412,7 @@ crl::time PeerListContent::paintRow(
|
||||
} else {
|
||||
row->paintStatusText(p, _st.item, _st.item.statusPosition.x(), _st.item.statusPosition.y(), statusw, width(), selected);
|
||||
}
|
||||
return refreshStatusIn;
|
||||
return (refreshStatusAt - ms);
|
||||
}
|
||||
|
||||
PeerListContent::SkipResult PeerListContent::selectSkip(int direction) {
|
||||
@@ -1658,8 +1562,6 @@ void PeerListContent::searchQueryChanged(QString query) {
|
||||
if (_normalizedSearchQuery != normalizedQuery) {
|
||||
setSearchQuery(query, normalizedQuery);
|
||||
if (_controller->searchInLocal() && !searchWordsList.isEmpty()) {
|
||||
Assert(_hiddenRows.empty());
|
||||
|
||||
auto minimalList = (const std::vector<not_null<PeerListRow*>>*)nullptr;
|
||||
for (const auto &searchWord : searchWordsList) {
|
||||
auto searchWordStart = searchWord[0].toLower();
|
||||
@@ -1709,17 +1611,15 @@ void PeerListContent::searchQueryChanged(QString query) {
|
||||
}
|
||||
|
||||
std::unique_ptr<PeerListState> PeerListContent::saveState() const {
|
||||
Expects(_hiddenRows.empty());
|
||||
|
||||
auto result = std::make_unique<PeerListState>();
|
||||
result->controllerState
|
||||
= std::make_unique<PeerListController::SavedStateBase>();
|
||||
result->list.reserve(_rows.size());
|
||||
for (const auto &row : _rows) {
|
||||
for (auto &row : _rows) {
|
||||
result->list.push_back(row->peer());
|
||||
}
|
||||
result->filterResults.reserve(_filterResults.size());
|
||||
for (const auto &row : _filterResults) {
|
||||
for (auto &row : _filterResults) {
|
||||
result->filterResults.push_back(row->peer());
|
||||
}
|
||||
result->searchQuery = _searchQuery;
|
||||
@@ -1743,7 +1643,7 @@ void PeerListContent::restoreState(
|
||||
auto searchWords = TextUtilities::PrepareSearchWords(query);
|
||||
setSearchQuery(query, searchWords.join(' '));
|
||||
for (auto peer : state->filterResults) {
|
||||
if (auto existingRow = findRow(peer->id.value)) {
|
||||
if (auto existingRow = findRow(peer->id)) {
|
||||
_filterResults.push_back(existingRow);
|
||||
} else if (auto row = _controller->createSearchRow(peer)) {
|
||||
appendSearchRow(std::move(row));
|
||||
@@ -1840,25 +1740,15 @@ void PeerListContent::selectByMouse(QPoint globalPosition) {
|
||||
_mouseSelection = true;
|
||||
_lastMousePosition = globalPosition;
|
||||
const auto point = mapFromGlobal(globalPosition);
|
||||
const auto customMode = (_mode == Mode::Custom);
|
||||
auto in = parentWidget()->rect().contains(parentWidget()->mapFromGlobal(globalPosition));
|
||||
auto selected = Selected();
|
||||
auto rowsPointY = point.y() - rowsTop();
|
||||
selected.index.value = (in
|
||||
&& rowsPointY >= 0
|
||||
&& rowsPointY < shownRowsCount() * _rowHeight)
|
||||
? (rowsPointY / _rowHeight)
|
||||
: -1;
|
||||
selected.index.value = (in && rowsPointY >= 0 && rowsPointY < shownRowsCount() * _rowHeight) ? (rowsPointY / _rowHeight) : -1;
|
||||
if (selected.index.value >= 0) {
|
||||
const auto row = getRow(selected.index);
|
||||
if (row->disabled()
|
||||
|| (customMode
|
||||
&& !_controller->customRowSelectionPoint(
|
||||
row,
|
||||
point.x(),
|
||||
rowsPointY - (selected.index.value * _rowHeight)))) {
|
||||
auto row = getRow(selected.index);
|
||||
if (row->disabled()) {
|
||||
selected = Selected();
|
||||
} else if (!customMode) {
|
||||
} else {
|
||||
if (getActiveActionRect(row, selected.index).contains(point)) {
|
||||
selected.action = true;
|
||||
}
|
||||
@@ -1899,7 +1789,8 @@ void PeerListContent::updateRow(RowIndex index) {
|
||||
if (index.value < 0) {
|
||||
return;
|
||||
}
|
||||
if (const auto row = getRow(index); row && row->disabled()) {
|
||||
auto row = getRow(index);
|
||||
if (row->disabled()) {
|
||||
if (index == _selected.index) {
|
||||
setSelected(Selected());
|
||||
}
|
||||
@@ -1994,10 +1885,3 @@ PeerListContent::~PeerListContent() {
|
||||
_contextMenu->setDestroyedCallback(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
void PeerListContentDelegate::peerListShowRowMenu(
|
||||
not_null<PeerListRow*> row,
|
||||
bool highlightRow,
|
||||
Fn<void(not_null<Ui::PopupMenu *>)> destroyed) {
|
||||
_content->showRowMenu(row, highlightRow, std::move(destroyed));
|
||||
}
|
||||
@@ -82,7 +82,7 @@ public:
|
||||
return _id;
|
||||
}
|
||||
|
||||
[[nodiscard]] std::shared_ptr<Data::CloudImageView> &ensureUserpicView();
|
||||
[[nodiscard]] std::shared_ptr<Data::CloudImageView> ensureUserpicView();
|
||||
|
||||
[[nodiscard]] virtual QString generateName();
|
||||
[[nodiscard]] virtual QString generateShortName();
|
||||
@@ -122,7 +122,7 @@ public:
|
||||
bool actionSelected) {
|
||||
}
|
||||
|
||||
virtual void refreshName(const style::PeerListItem &st);
|
||||
void refreshName(const style::PeerListItem &st);
|
||||
const Ui::Text::String &name() const {
|
||||
return _name;
|
||||
}
|
||||
@@ -161,7 +161,7 @@ public:
|
||||
template <typename UpdateCallback>
|
||||
void setChecked(
|
||||
bool checked,
|
||||
const style::RoundImageCheckbox &st,
|
||||
const style::RoundImageCheckbox &st,
|
||||
anim::type animated,
|
||||
UpdateCallback callback) {
|
||||
if (checked && !_checkbox) {
|
||||
@@ -169,21 +169,15 @@ public:
|
||||
}
|
||||
setCheckedInternal(checked, animated);
|
||||
}
|
||||
void setHidden(bool hidden) {
|
||||
_hidden = hidden;
|
||||
}
|
||||
[[nodiscard]] bool hidden() const {
|
||||
return _hidden;
|
||||
}
|
||||
void finishCheckedAnimation();
|
||||
void invalidatePixmapsCache();
|
||||
|
||||
template <typename MaskGenerator, typename UpdateCallback>
|
||||
template <typename UpdateCallback>
|
||||
void addRipple(
|
||||
const style::PeerListItem &st,
|
||||
MaskGenerator &&maskGenerator,
|
||||
QSize size,
|
||||
QPoint point,
|
||||
UpdateCallback &&updateCallback);
|
||||
UpdateCallback updateCallback);
|
||||
void stopLastRipple();
|
||||
void paintRipple(Painter &p, int x, int y, int outerWidth);
|
||||
void paintUserpic(
|
||||
@@ -243,7 +237,6 @@ private:
|
||||
base::flat_set<QChar> _nameFirstLetters;
|
||||
int _absoluteIndex = -1;
|
||||
State _disabledState = State::Active;
|
||||
bool _hidden : 1;
|
||||
bool _initialized : 1;
|
||||
bool _isSearchResult : 1;
|
||||
bool _isSavedMessagesChat : 1;
|
||||
@@ -281,7 +274,6 @@ public:
|
||||
virtual void peerListConvertRowToSearchResult(not_null<PeerListRow*> row) = 0;
|
||||
virtual bool peerListIsRowChecked(not_null<PeerListRow*> row) = 0;
|
||||
virtual void peerListSetRowChecked(not_null<PeerListRow*> row, bool checked) = 0;
|
||||
virtual void peerListSetRowHidden(not_null<PeerListRow*> row, bool hidden) = 0;
|
||||
virtual void peerListSetForeignRowChecked(
|
||||
not_null<PeerListRow*> row,
|
||||
bool checked,
|
||||
@@ -312,7 +304,6 @@ public:
|
||||
|
||||
virtual void peerListShowRowMenu(
|
||||
not_null<PeerListRow*> row,
|
||||
bool highlightRow,
|
||||
Fn<void(not_null<Ui::PopupMenu*>)> destroyed = nullptr) = 0;
|
||||
virtual int peerListSelectedRowsCount() = 0;
|
||||
virtual std::unique_ptr<PeerListState> peerListSaveState() const = 0;
|
||||
@@ -459,25 +450,6 @@ public:
|
||||
[[nodiscard]] virtual bool respectSavedMessagesChat() const {
|
||||
return false;
|
||||
}
|
||||
[[nodiscard]] virtual int customRowHeight() {
|
||||
Unexpected("PeerListController::customRowHeight.");
|
||||
}
|
||||
virtual void customRowPaint(
|
||||
Painter &p,
|
||||
crl::time now,
|
||||
not_null<PeerListRow*> row,
|
||||
bool selected) {
|
||||
Unexpected("PeerListController::customRowPaint.");
|
||||
}
|
||||
[[nodiscard]] virtual bool customRowSelectionPoint(
|
||||
not_null<PeerListRow*> row,
|
||||
int x,
|
||||
int y) {
|
||||
Unexpected("PeerListController::customRowSelectionPoint.");
|
||||
}
|
||||
[[nodiscard]] virtual Fn<QImage()> customRowRippleMaskGenerator() {
|
||||
Unexpected("PeerListController::customRowRippleMaskGenerator.");
|
||||
}
|
||||
|
||||
[[nodiscard]] virtual rpl::producer<int> onlineCountValue() const;
|
||||
|
||||
@@ -542,12 +514,6 @@ public:
|
||||
SkipResult selectSkip(int direction);
|
||||
void selectSkipPage(int height, int direction);
|
||||
|
||||
enum class Mode {
|
||||
Default,
|
||||
Custom,
|
||||
};
|
||||
void setMode(Mode mode);
|
||||
|
||||
[[nodiscard]] rpl::producer<int> selectedIndexValue() const;
|
||||
[[nodiscard]] bool hasSelection() const;
|
||||
[[nodiscard]] bool hasPressed() const;
|
||||
@@ -586,9 +552,6 @@ public:
|
||||
not_null<PeerListRow*> row,
|
||||
bool checked,
|
||||
anim::type animated);
|
||||
void setRowHidden(
|
||||
not_null<PeerListRow*> row,
|
||||
bool hidden);
|
||||
|
||||
template <typename ReorderCallback>
|
||||
void reorderRows(ReorderCallback &&callback) {
|
||||
@@ -597,9 +560,6 @@ public:
|
||||
callback(searchEntity.second.begin(), searchEntity.second.end());
|
||||
}
|
||||
refreshIndices();
|
||||
if (!_hiddenRows.empty()) {
|
||||
callback(_filterResults.begin(), _filterResults.end());
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -608,7 +568,6 @@ public:
|
||||
|
||||
void showRowMenu(
|
||||
not_null<PeerListRow*> row,
|
||||
bool highlightRow,
|
||||
Fn<void(not_null<Ui::PopupMenu*>)> destroyed);
|
||||
|
||||
auto scrollToRequests() const {
|
||||
@@ -696,12 +655,10 @@ private:
|
||||
|
||||
bool showRowMenu(
|
||||
RowIndex index,
|
||||
PeerListRow *row,
|
||||
QPoint globalPos,
|
||||
bool highlightRow,
|
||||
Fn<void(not_null<Ui::PopupMenu*>)> destroyed = nullptr);
|
||||
|
||||
crl::time paintRow(Painter &p, crl::time now, RowIndex index);
|
||||
crl::time paintRow(Painter &p, crl::time ms, RowIndex index);
|
||||
|
||||
void addRowEntry(not_null<PeerListRow*> row);
|
||||
void addToSearchIndex(not_null<PeerListRow*> row);
|
||||
@@ -709,7 +666,7 @@ private:
|
||||
void removeFromSearchIndex(not_null<PeerListRow*> row);
|
||||
void setSearchQuery(const QString &query, const QString &normalizedQuery);
|
||||
bool showingSearch() const {
|
||||
return !_hiddenRows.empty() || !_searchQuery.isEmpty();
|
||||
return !_searchQuery.isEmpty();
|
||||
}
|
||||
int shownRowsCount() const {
|
||||
return showingSearch() ? _filterResults.size() : _rows.size();
|
||||
@@ -731,7 +688,6 @@ private:
|
||||
not_null<PeerListController*> _controller;
|
||||
PeerListSearchMode _searchMode = PeerListSearchMode::Disabled;
|
||||
|
||||
Mode _mode = Mode::Default;
|
||||
int _rowHeight = 0;
|
||||
int _visibleTop = 0;
|
||||
int _visibleBottom = 0;
|
||||
@@ -755,7 +711,6 @@ private:
|
||||
QString _normalizedSearchQuery;
|
||||
QString _mentionHighlight;
|
||||
std::vector<not_null<PeerListRow*>> _filterResults;
|
||||
base::flat_set<not_null<PeerListRow*>> _hiddenRows;
|
||||
|
||||
int _aboveHeight = 0;
|
||||
int _belowHeight = 0;
|
||||
@@ -820,11 +775,6 @@ public:
|
||||
bool checked) override {
|
||||
_content->changeCheckState(row, checked, anim::type::normal);
|
||||
}
|
||||
void peerListSetRowHidden(
|
||||
not_null<PeerListRow*> row,
|
||||
bool hidden) override {
|
||||
_content->setRowHidden(row, hidden);
|
||||
}
|
||||
void peerListSetForeignRowChecked(
|
||||
not_null<PeerListRow*> row,
|
||||
bool checked,
|
||||
@@ -895,9 +845,10 @@ public:
|
||||
_content->restoreState(std::move(state));
|
||||
}
|
||||
void peerListShowRowMenu(
|
||||
not_null<PeerListRow*> row,
|
||||
bool highlightRow,
|
||||
Fn<void(not_null<Ui::PopupMenu*>)> destroyed = nullptr) override;
|
||||
not_null<PeerListRow*> row,
|
||||
Fn<void(not_null<Ui::PopupMenu*>)> destroyed = nullptr) override {
|
||||
_content->showRowMenu(row, std::move(destroyed));
|
||||
}
|
||||
|
||||
protected:
|
||||
not_null<PeerListContent*> content() const {
|
||||
|
||||
@@ -344,7 +344,7 @@ std::unique_ptr<PeerListRow> ChatsListBoxController::createSearchRow(not_null<Pe
|
||||
}
|
||||
|
||||
bool ChatsListBoxController::appendRow(not_null<History*> history) {
|
||||
if (auto row = delegate()->peerListFindRow(history->peer->id.value)) {
|
||||
if (auto row = delegate()->peerListFindRow(history->peer->id)) {
|
||||
updateRowHook(static_cast<Row*>(row));
|
||||
return false;
|
||||
}
|
||||
@@ -426,7 +426,7 @@ void ContactsBoxController::rowClicked(not_null<PeerListRow*> row) {
|
||||
}
|
||||
|
||||
bool ContactsBoxController::appendRow(not_null<UserData*> user) {
|
||||
if (auto row = delegate()->peerListFindRow(user->id.value)) {
|
||||
if (auto row = delegate()->peerListFindRow(user->id)) {
|
||||
updateRowHook(row);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ auto PeerListsBox::collectSelectedRows()
|
||||
return false;
|
||||
}();
|
||||
if (!foreign) {
|
||||
result.push_back(session->data().peer(PeerId(itemId)));
|
||||
result.push_back(session->data().peer(itemId));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -108,10 +108,10 @@ void PeerListsBox::createMultiSelect() {
|
||||
}
|
||||
}
|
||||
const auto session = &firstController()->session();
|
||||
if (const auto peer = session->data().peerLoaded(PeerId(itemId))) {
|
||||
if (const auto peer = session->data().peerLoaded(itemId)) {
|
||||
const auto id = peer->id;
|
||||
for (const auto &list : _lists) {
|
||||
if (const auto row = list.delegate->peerListFindRow(id.value)) {
|
||||
if (const auto row = list.delegate->peerListFindRow(id)) {
|
||||
list.content->changeCheckState(
|
||||
row,
|
||||
false,
|
||||
@@ -385,7 +385,7 @@ void PeerListsBox::addSelectItem(
|
||||
not_null<PeerData*> peer,
|
||||
anim::type animated) {
|
||||
addSelectItem(
|
||||
peer->id.value,
|
||||
peer->id,
|
||||
peer->shortName(),
|
||||
PaintUserpicCallback(peer, false),
|
||||
animated);
|
||||
|
||||
@@ -661,12 +661,12 @@ void AddSpecialBoxController::editAdminDone(
|
||||
using Flag = MTPDchannelParticipantCreator::Flag;
|
||||
_additional.applyParticipant(MTP_channelParticipantCreator(
|
||||
MTP_flags(rank.isEmpty() ? Flag(0) : Flag::f_rank),
|
||||
peerToBareMTPInt(user->id),
|
||||
MTP_int(user->bareId()),
|
||||
rights,
|
||||
MTP_string(rank)));
|
||||
} else if (rights.c_chatAdminRights().vflags().v == 0) {
|
||||
_additional.applyParticipant(MTP_channelParticipant(
|
||||
peerToBareMTPInt(user->id),
|
||||
MTP_int(user->bareId()),
|
||||
MTP_int(date)));
|
||||
} else {
|
||||
using Flag = MTPDchannelParticipantAdmin::Flag;
|
||||
@@ -674,11 +674,11 @@ void AddSpecialBoxController::editAdminDone(
|
||||
_additional.applyParticipant(MTP_channelParticipantAdmin(
|
||||
MTP_flags(Flag::f_can_edit
|
||||
| (rank.isEmpty() ? Flag(0) : Flag::f_rank)),
|
||||
peerToBareMTPInt(user->id),
|
||||
MTP_int(user->bareId()),
|
||||
MTPint(), // inviter_id
|
||||
peerToBareMTPInt(alreadyPromotedBy
|
||||
? alreadyPromotedBy->id
|
||||
: user->session().userPeerId()),
|
||||
MTP_int(alreadyPromotedBy
|
||||
? alreadyPromotedBy->bareId()
|
||||
: user->session().userId()),
|
||||
MTP_int(date),
|
||||
rights,
|
||||
MTP_string(rank)));
|
||||
@@ -763,7 +763,7 @@ void AddSpecialBoxController::editRestrictedDone(
|
||||
if (Data::ChatBannedRightsFlags(rights) == 0) {
|
||||
if (const auto user = participant->asUser()) {
|
||||
_additional.applyParticipant(MTP_channelParticipant(
|
||||
peerToBareMTPInt(user->id),
|
||||
MTP_int(user->bareId()),
|
||||
MTP_int(date)));
|
||||
} else {
|
||||
_additional.setExternal(participant);
|
||||
@@ -777,10 +777,14 @@ void AddSpecialBoxController::editRestrictedDone(
|
||||
MTP_flags(kicked
|
||||
? MTPDchannelParticipantBanned::Flag::f_left
|
||||
: MTPDchannelParticipantBanned::Flag(0)),
|
||||
peerToMTP(participant->id),
|
||||
peerToBareMTPInt(alreadyRestrictedBy
|
||||
? alreadyRestrictedBy->id
|
||||
: participant->session().userPeerId()),
|
||||
(participant->isUser()
|
||||
? MTP_peerUser(MTP_int(participant->bareId()))
|
||||
: participant->isChat()
|
||||
? MTP_peerChat(MTP_int(participant->bareId()))
|
||||
: MTP_peerChannel(MTP_int(participant->bareId()))),
|
||||
MTP_int(alreadyRestrictedBy
|
||||
? alreadyRestrictedBy->bareId()
|
||||
: participant->session().userId()),
|
||||
MTP_int(date),
|
||||
rights));
|
||||
}
|
||||
@@ -857,7 +861,7 @@ void AddSpecialBoxController::kickUser(
|
||||
}
|
||||
|
||||
bool AddSpecialBoxController::appendRow(not_null<PeerData*> participant) {
|
||||
if (delegate()->peerListFindRow(participant->id.value)
|
||||
if (delegate()->peerListFindRow(participant->id)
|
||||
|| (_excludeSelf && participant->isSelf())) {
|
||||
return false;
|
||||
}
|
||||
@@ -866,7 +870,7 @@ bool AddSpecialBoxController::appendRow(not_null<PeerData*> participant) {
|
||||
}
|
||||
|
||||
bool AddSpecialBoxController::prependRow(not_null<UserData*> user) {
|
||||
if (delegate()->peerListFindRow(user->id.value)) {
|
||||
if (delegate()->peerListFindRow(user->id)) {
|
||||
return false;
|
||||
}
|
||||
delegate()->peerListPrependRow(createRow(user));
|
||||
|
||||
@@ -31,7 +31,7 @@ constexpr auto kMaxUserFirstLastName = 64; // See also add_contact_box.
|
||||
QString UserPhone(not_null<UserData*> user) {
|
||||
const auto phone = user->phone();
|
||||
return phone.isEmpty()
|
||||
? user->owner().findContactPhone(peerToUser(user->id))
|
||||
? user->owner().findContactPhone(user->bareId())
|
||||
: phone;
|
||||
}
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ int Controller::contentWidth() const {
|
||||
|
||||
void Controller::prepare() {
|
||||
const auto appendRow = [&](not_null<PeerData*> chat) {
|
||||
if (delegate()->peerListFindRow(chat->id.value)) {
|
||||
if (delegate()->peerListFindRow(chat->id)) {
|
||||
return;
|
||||
}
|
||||
auto row = std::make_unique<PeerListRow>(chat);
|
||||
|
||||
@@ -607,7 +607,7 @@ UserData *ParticipantsAdditionalData::applyCreator(
|
||||
|
||||
UserData *ParticipantsAdditionalData::applyAdmin(
|
||||
const MTPDchannelParticipantAdmin &data) {
|
||||
const auto user = _peer->owner().userLoaded(UserId(data.vuser_id().v));
|
||||
const auto user = _peer->owner().userLoaded(data.vuser_id().v);
|
||||
if (!user) {
|
||||
return nullptr;
|
||||
} else if (const auto chat = _peer->asChat()) {
|
||||
@@ -631,7 +631,7 @@ UserData *ParticipantsAdditionalData::applyAdmin(
|
||||
} else {
|
||||
_adminRanks.remove(user);
|
||||
}
|
||||
if (const auto by = _peer->owner().userLoaded(data.vpromoted_by())) {
|
||||
if (const auto by = _peer->owner().userLoaded(data.vpromoted_by().v)) {
|
||||
const auto i = _adminPromotedBy.find(user);
|
||||
if (i == _adminPromotedBy.end()) {
|
||||
_adminPromotedBy.emplace(user, by);
|
||||
@@ -646,7 +646,7 @@ UserData *ParticipantsAdditionalData::applyAdmin(
|
||||
}
|
||||
|
||||
UserData *ParticipantsAdditionalData::applyRegular(MTPint userId) {
|
||||
const auto user = _peer->owner().userLoaded(userId);
|
||||
const auto user = _peer->owner().userLoaded(userId.v);
|
||||
if (!user) {
|
||||
return nullptr;
|
||||
} else if (const auto chat = _peer->asChat()) {
|
||||
@@ -685,7 +685,7 @@ PeerData *ParticipantsAdditionalData::applyBanned(
|
||||
_kicked.erase(participant);
|
||||
}
|
||||
_restrictedRights[participant] = data.vbanned_rights();
|
||||
if (const auto by = _peer->owner().userLoaded(data.vkicked_by())) {
|
||||
if (const auto by = _peer->owner().userLoaded(data.vkicked_by().v)) {
|
||||
const auto i = _restrictedBy.find(participant);
|
||||
if (i == _restrictedBy.end()) {
|
||||
_restrictedBy.emplace(participant, by);
|
||||
@@ -725,7 +725,7 @@ ParticipantsOnlineSorter::ParticipantsOnlineSorter(
|
||||
Data::PeerUpdate::Flag::OnlineStatus
|
||||
) | rpl::start_with_next([=](const Data::PeerUpdate &update) {
|
||||
const auto peerId = update.peer->id;
|
||||
if (const auto row = _delegate->peerListFindRow(peerId.value)) {
|
||||
if (const auto row = _delegate->peerListFindRow(peerId)) {
|
||||
row->refreshStatus();
|
||||
sortDelayed();
|
||||
}
|
||||
@@ -827,7 +827,7 @@ void ParticipantsBoxController::setupListChangeViewers() {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (const auto row = delegate()->peerListFindRow(user->id.value)) {
|
||||
if (const auto row = delegate()->peerListFindRow(user->id)) {
|
||||
delegate()->peerListPartitionRows([&](const PeerListRow &row) {
|
||||
return (row.peer() == user);
|
||||
});
|
||||
@@ -843,7 +843,7 @@ void ParticipantsBoxController::setupListChangeViewers() {
|
||||
channel->owner().megagroupParticipantRemoved(
|
||||
channel
|
||||
) | rpl::start_with_next([=](not_null<UserData*> user) {
|
||||
if (const auto row = delegate()->peerListFindRow(user->id.value)) {
|
||||
if (const auto row = delegate()->peerListFindRow(user->id)) {
|
||||
delegate()->peerListRemoveRow(row);
|
||||
}
|
||||
delegate()->peerListRefreshRows();
|
||||
@@ -1457,6 +1457,8 @@ void ParticipantsBoxController::rowActionClicked(
|
||||
base::unique_qptr<Ui::PopupMenu> ParticipantsBoxController::rowContextMenu(
|
||||
QWidget *parent,
|
||||
not_null<PeerListRow*> row) {
|
||||
Expects(row->peer()->isUser());
|
||||
|
||||
const auto chat = _peer->asChat();
|
||||
const auto channel = _peer->asChannel();
|
||||
const auto participant = row->peer();
|
||||
@@ -1464,11 +1466,7 @@ base::unique_qptr<Ui::PopupMenu> ParticipantsBoxController::rowContextMenu(
|
||||
auto result = base::make_unique_q<Ui::PopupMenu>(parent);
|
||||
if (_navigation) {
|
||||
result->addAction(
|
||||
(participant->isUser()
|
||||
? tr::lng_context_view_profile
|
||||
: participant->isBroadcast()
|
||||
? tr::lng_context_view_channel
|
||||
: tr::lng_context_view_group)(tr::now),
|
||||
tr::lng_context_view_profile(tr::now),
|
||||
crl::guard(this, [=] {
|
||||
_navigation->showPeerInfo(participant); }));
|
||||
}
|
||||
@@ -1495,12 +1493,12 @@ base::unique_qptr<Ui::PopupMenu> ParticipantsBoxController::rowContextMenu(
|
||||
: tr::lng_context_promote_admin)(tr::now),
|
||||
crl::guard(this, [=] { showAdmin(user); }));
|
||||
}
|
||||
if (user && _additional.canRestrictParticipant(participant)) {
|
||||
if (_additional.canRestrictParticipant(participant)) {
|
||||
const auto canRestrictWithoutKick = [&] {
|
||||
if (const auto chat = _peer->asChat()) {
|
||||
return chat->amCreator();
|
||||
}
|
||||
return _peer->isMegagroup() && !_peer->isGigagroup();
|
||||
return _peer->isMegagroup();
|
||||
}();
|
||||
if (canRestrictWithoutKick) {
|
||||
result->addAction(
|
||||
@@ -1508,7 +1506,7 @@ base::unique_qptr<Ui::PopupMenu> ParticipantsBoxController::rowContextMenu(
|
||||
crl::guard(this, [=] { showRestricted(user); }));
|
||||
}
|
||||
}
|
||||
if (user && _additional.canRemoveParticipant(participant)) {
|
||||
if (_additional.canRemoveParticipant(participant)) {
|
||||
if (!_additional.isKicked(participant)) {
|
||||
const auto isGroup = _peer->isChat() || _peer->isMegagroup();
|
||||
result->addAction(
|
||||
@@ -1563,12 +1561,12 @@ void ParticipantsBoxController::editAdminDone(
|
||||
using Flag = MTPDchannelParticipantCreator::Flag;
|
||||
_additional.applyParticipant(MTP_channelParticipantCreator(
|
||||
MTP_flags(rank.isEmpty() ? Flag(0) : Flag::f_rank),
|
||||
peerToBareMTPInt(user->id),
|
||||
MTP_int(user->bareId()),
|
||||
rights,
|
||||
MTP_string(rank)));
|
||||
} else if (rights.c_chatAdminRights().vflags().v == 0) {
|
||||
_additional.applyParticipant(MTP_channelParticipant(
|
||||
peerToBareMTPInt(user->id),
|
||||
MTP_int(user->bareId()),
|
||||
MTP_int(date)));
|
||||
if (_role == Role::Admins) {
|
||||
removeRow(user);
|
||||
@@ -1579,11 +1577,11 @@ void ParticipantsBoxController::editAdminDone(
|
||||
_additional.applyParticipant(MTP_channelParticipantAdmin(
|
||||
MTP_flags(Flag::f_can_edit
|
||||
| (rank.isEmpty() ? Flag(0) : Flag::f_rank)),
|
||||
peerToBareMTPInt(user->id),
|
||||
MTP_int(user->bareId()),
|
||||
MTPint(), // inviter_id
|
||||
peerToBareMTPInt(alreadyPromotedBy
|
||||
? alreadyPromotedBy->id
|
||||
: user->session().userPeerId()),
|
||||
MTP_int(alreadyPromotedBy
|
||||
? alreadyPromotedBy->bareId()
|
||||
: user->session().userId()),
|
||||
MTP_int(date),
|
||||
rights,
|
||||
MTP_string(rank)));
|
||||
@@ -1639,7 +1637,7 @@ void ParticipantsBoxController::editRestrictedDone(
|
||||
if (Data::ChatBannedRightsFlags(rights) == 0) {
|
||||
if (user) {
|
||||
_additional.applyParticipant(MTP_channelParticipant(
|
||||
peerToBareMTPInt(user->id),
|
||||
MTP_int(user->bareId()),
|
||||
MTP_int(date)));
|
||||
} else {
|
||||
_additional.setExternal(participant);
|
||||
@@ -1656,10 +1654,14 @@ void ParticipantsBoxController::editRestrictedDone(
|
||||
MTP_flags(kicked
|
||||
? MTPDchannelParticipantBanned::Flag::f_left
|
||||
: MTPDchannelParticipantBanned::Flag(0)),
|
||||
peerToMTP(participant->id),
|
||||
peerToBareMTPInt(alreadyRestrictedBy
|
||||
? alreadyRestrictedBy->id
|
||||
: participant->session().userPeerId()),
|
||||
(participant->isUser()
|
||||
? MTP_peerUser(MTP_int(participant->bareId()))
|
||||
: participant->isChat()
|
||||
? MTP_peerChat(MTP_int(participant->bareId()))
|
||||
: MTP_peerChannel(MTP_int(participant->bareId()))),
|
||||
MTP_int(alreadyRestrictedBy
|
||||
? alreadyRestrictedBy->bareId()
|
||||
: participant->session().userId()),
|
||||
MTP_int(date),
|
||||
rights));
|
||||
if (kicked) {
|
||||
@@ -1702,7 +1704,7 @@ void ParticipantsBoxController::kickParticipant(not_null<PeerData*> participant)
|
||||
|
||||
void ParticipantsBoxController::unkickParticipant(not_null<UserData*> user) {
|
||||
_editBox = nullptr;
|
||||
if (const auto row = delegate()->peerListFindRow(user->id.value)) {
|
||||
if (const auto row = delegate()->peerListFindRow(user->id)) {
|
||||
delegate()->peerListRemoveRow(row);
|
||||
delegate()->peerListRefreshRows();
|
||||
}
|
||||
@@ -1718,7 +1720,7 @@ void ParticipantsBoxController::kickParticipantSure(
|
||||
? *restrictedRights
|
||||
: ChannelData::EmptyRestrictedRights(participant);
|
||||
|
||||
if (const auto row = delegate()->peerListFindRow(participant->id.value)) {
|
||||
if (const auto row = delegate()->peerListFindRow(participant->id)) {
|
||||
delegate()->peerListRemoveRow(row);
|
||||
delegate()->peerListRefreshRows();
|
||||
}
|
||||
@@ -1768,7 +1770,7 @@ void ParticipantsBoxController::removeAdminSure(not_null<UserData*> user) {
|
||||
|
||||
void ParticipantsBoxController::removeKickedWithRow(
|
||||
not_null<PeerData*> participant) {
|
||||
if (const auto row = delegate()->peerListFindRow(participant->id.value)) {
|
||||
if (const auto row = delegate()->peerListFindRow(participant->id)) {
|
||||
removeKicked(row, participant);
|
||||
} else {
|
||||
removeKicked(participant);
|
||||
@@ -1794,7 +1796,7 @@ void ParticipantsBoxController::removeKicked(
|
||||
}
|
||||
|
||||
bool ParticipantsBoxController::appendRow(not_null<PeerData*> participant) {
|
||||
if (delegate()->peerListFindRow(participant->id.value)) {
|
||||
if (delegate()->peerListFindRow(participant->id)) {
|
||||
recomputeTypeFor(participant);
|
||||
return false;
|
||||
} else if (auto row = createRow(participant)) {
|
||||
@@ -1808,7 +1810,7 @@ bool ParticipantsBoxController::appendRow(not_null<PeerData*> participant) {
|
||||
}
|
||||
|
||||
bool ParticipantsBoxController::prependRow(not_null<PeerData*> participant) {
|
||||
if (const auto row = delegate()->peerListFindRow(participant->id.value)) {
|
||||
if (const auto row = delegate()->peerListFindRow(participant->id)) {
|
||||
recomputeTypeFor(participant);
|
||||
refreshCustomStatus(row);
|
||||
if (_role == Role::Admins) {
|
||||
@@ -1827,7 +1829,7 @@ bool ParticipantsBoxController::prependRow(not_null<PeerData*> participant) {
|
||||
}
|
||||
|
||||
bool ParticipantsBoxController::removeRow(not_null<PeerData*> participant) {
|
||||
if (auto row = delegate()->peerListFindRow(participant->id.value)) {
|
||||
if (auto row = delegate()->peerListFindRow(participant->id)) {
|
||||
if (_role == Role::Admins) {
|
||||
// Perhaps we are removing an admin from search results.
|
||||
row->setCustomStatus(tr::lng_channel_admin_status_not_admin(tr::now));
|
||||
@@ -1901,7 +1903,7 @@ void ParticipantsBoxController::recomputeTypeFor(
|
||||
if (_role != Role::Profile) {
|
||||
return;
|
||||
}
|
||||
if (const auto row = delegate()->peerListFindRow(participant->id.value)) {
|
||||
if (const auto row = delegate()->peerListFindRow(participant->id)) {
|
||||
static_cast<Row*>(row)->setType(computeType(participant));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -533,7 +533,7 @@ void LinksController::rowClicked(not_null<PeerListRow*> row) {
|
||||
}
|
||||
|
||||
void LinksController::rowActionClicked(not_null<PeerListRow*> row) {
|
||||
delegate()->peerListShowRowMenu(row, true);
|
||||
delegate()->peerListShowRowMenu(row, nullptr);
|
||||
}
|
||||
|
||||
base::unique_qptr<Ui::PopupMenu> LinksController::rowContextMenu(
|
||||
@@ -766,7 +766,7 @@ void AdminsController::prepare() {
|
||||
owner.processUsers(data.vusers());
|
||||
for (const auto &admin : data.vadmins().v) {
|
||||
admin.match([&](const MTPDchatAdminWithInvites &data) {
|
||||
const auto adminId = data.vadmin_id();
|
||||
const auto adminId = data.vadmin_id().v;
|
||||
if (const auto user = owner.userLoaded(adminId)) {
|
||||
if (!user->isSelf()) {
|
||||
appendRow(user, data.vinvites_count().v);
|
||||
|
||||
@@ -254,7 +254,7 @@ void ShareBox::prepare() {
|
||||
applyFilterUpdate(query);
|
||||
});
|
||||
_select->setItemRemovedCallback([=](uint64 itemId) {
|
||||
if (const auto peer = _descriptor.session->data().peerLoaded(PeerId(itemId))) {
|
||||
if (const auto peer = _descriptor.session->data().peerLoaded(itemId)) {
|
||||
_inner->peerUnselected(peer);
|
||||
selectedChanged();
|
||||
update();
|
||||
@@ -469,7 +469,7 @@ void ShareBox::addPeerToMultiSelect(PeerData *peer, bool skipAnimation) {
|
||||
using AddItemWay = Ui::MultiSelect::AddItemWay;
|
||||
auto addItemWay = skipAnimation ? AddItemWay::SkipAnimation : AddItemWay::Default;
|
||||
_select->addItem(
|
||||
peer->id.value,
|
||||
peer->id,
|
||||
peer->isSelf() ? tr::lng_saved_short(tr::now) : peer->shortName(),
|
||||
st::activeButtonBg,
|
||||
PaintUserpicCallback(peer, true),
|
||||
@@ -481,7 +481,7 @@ void ShareBox::innerSelectedChanged(PeerData *peer, bool checked) {
|
||||
addPeerToMultiSelect(peer);
|
||||
_select->clearQuery();
|
||||
} else {
|
||||
_select->removeItem(peer->id.value);
|
||||
_select->removeItem(peer->id);
|
||||
}
|
||||
selectedChanged();
|
||||
update();
|
||||
@@ -1107,25 +1107,25 @@ QString AppendShareGameScoreUrl(
|
||||
not_null<Main::Session*> session,
|
||||
const QString &url,
|
||||
const FullMsgId &fullId) {
|
||||
auto shareHashData = QByteArray(0x20, Qt::Uninitialized);
|
||||
auto shareHashDataInts = reinterpret_cast<uint64*>(shareHashData.data());
|
||||
auto shareHashData = QByteArray(0x10, Qt::Uninitialized);
|
||||
auto shareHashDataInts = reinterpret_cast<int32*>(shareHashData.data());
|
||||
auto channel = fullId.channel
|
||||
? session->data().channelLoaded(fullId.channel)
|
||||
: static_cast<ChannelData*>(nullptr);
|
||||
auto channelAccessHash = uint64(channel ? channel->access : 0);
|
||||
auto channelAccessHash = channel ? channel->access : 0ULL;
|
||||
auto channelAccessHashInts = reinterpret_cast<int32*>(&channelAccessHash);
|
||||
shareHashDataInts[0] = session->userId().bare;
|
||||
shareHashDataInts[1] = fullId.channel.bare;
|
||||
shareHashDataInts[0] = session->userId();
|
||||
shareHashDataInts[1] = fullId.channel;
|
||||
shareHashDataInts[2] = fullId.msg;
|
||||
shareHashDataInts[3] = channelAccessHash;
|
||||
shareHashDataInts[3] = channelAccessHashInts[0];
|
||||
|
||||
// Count SHA1() of data.
|
||||
auto key128Size = 0x10;
|
||||
auto shareHashEncrypted = QByteArray(key128Size + shareHashData.size(), Qt::Uninitialized);
|
||||
hashSha1(shareHashData.constData(), shareHashData.size(), shareHashEncrypted.data());
|
||||
|
||||
//// Mix in channel access hash to the first 64 bits of SHA1 of data.
|
||||
//*reinterpret_cast<uint64*>(shareHashEncrypted.data()) ^= channelAccessHash;
|
||||
// Mix in channel access hash to the first 64 bits of SHA1 of data.
|
||||
*reinterpret_cast<uint64*>(shareHashEncrypted.data()) ^= *reinterpret_cast<uint64*>(channelAccessHashInts);
|
||||
|
||||
// Encrypt data.
|
||||
if (!session->local().encrypt(shareHashData.constData(), shareHashEncrypted.data() + key128Size, shareHashData.size(), shareHashEncrypted.constData())) {
|
||||
@@ -1157,7 +1157,7 @@ void ShareGameScoreByHash(
|
||||
auto key128Size = 0x10;
|
||||
|
||||
auto hashEncrypted = QByteArray::fromBase64(hash.toLatin1(), QByteArray::Base64UrlEncoding | QByteArray::OmitTrailingEquals);
|
||||
if (hashEncrypted.size() <= key128Size || (hashEncrypted.size() != key128Size + 0x20)) {
|
||||
if (hashEncrypted.size() <= key128Size || (hashEncrypted.size() % 0x10) != 0) {
|
||||
Ui::show(Box<InformBox>(tr::lng_confirm_phone_link_invalid(tr::now)));
|
||||
return;
|
||||
}
|
||||
@@ -1172,46 +1172,37 @@ void ShareGameScoreByHash(
|
||||
char dataSha1[20] = { 0 };
|
||||
hashSha1(hashData.constData(), hashData.size(), dataSha1);
|
||||
|
||||
//// Mix out channel access hash from the first 64 bits of SHA1 of data.
|
||||
//auto channelAccessHash = *reinterpret_cast<uint64*>(hashEncrypted.data()) ^ *reinterpret_cast<uint64*>(dataSha1);
|
||||
// Mix out channel access hash from the first 64 bits of SHA1 of data.
|
||||
auto channelAccessHash = *reinterpret_cast<uint64*>(hashEncrypted.data()) ^ *reinterpret_cast<uint64*>(dataSha1);
|
||||
|
||||
//// Check next 64 bits of SHA1() of data.
|
||||
//auto skipSha1Part = sizeof(channelAccessHash);
|
||||
//if (memcmp(dataSha1 + skipSha1Part, hashEncrypted.constData() + skipSha1Part, key128Size - skipSha1Part) != 0) {
|
||||
// Ui::show(Box<InformBox>(tr::lng_share_wrong_user(tr::now)));
|
||||
// return;
|
||||
//}
|
||||
|
||||
// Check 128 bits of SHA1() of data.
|
||||
if (memcmp(dataSha1, hashEncrypted.constData(), key128Size) != 0) {
|
||||
// Check next 64 bits of SHA1() of data.
|
||||
auto skipSha1Part = sizeof(channelAccessHash);
|
||||
if (memcmp(dataSha1 + skipSha1Part, hashEncrypted.constData() + skipSha1Part, key128Size - skipSha1Part) != 0) {
|
||||
Ui::show(Box<InformBox>(tr::lng_share_wrong_user(tr::now)));
|
||||
return;
|
||||
}
|
||||
|
||||
auto hashDataInts = reinterpret_cast<uint64*>(hashData.data());
|
||||
if (hashDataInts[0] != session->userId().bare) {
|
||||
auto hashDataInts = reinterpret_cast<int32*>(hashData.data());
|
||||
if (hashDataInts[0] != session->userId()) {
|
||||
Ui::show(Box<InformBox>(tr::lng_share_wrong_user(tr::now)));
|
||||
return;
|
||||
}
|
||||
|
||||
// Check first 32 bits of channel access hash.
|
||||
auto channelAccessHash = hashDataInts[3];
|
||||
//auto channelAccessHashInts = reinterpret_cast<int32*>(&channelAccessHash);
|
||||
//if (channelAccessHashInts[0] != hashDataInts[3]) {
|
||||
// Ui::show(Box<InformBox>(tr::lng_share_wrong_user(tr::now)));
|
||||
// return;
|
||||
//}
|
||||
auto channelAccessHashInts = reinterpret_cast<int32*>(&channelAccessHash);
|
||||
if (channelAccessHashInts[0] != hashDataInts[3]) {
|
||||
Ui::show(Box<InformBox>(tr::lng_share_wrong_user(tr::now)));
|
||||
return;
|
||||
}
|
||||
|
||||
if (((hashDataInts[1] >> 40) != 0)
|
||||
|| ((hashDataInts[2] >> 32) != 0)
|
||||
|| (!hashDataInts[1] && channelAccessHash)) {
|
||||
auto channelId = hashDataInts[1];
|
||||
auto msgId = hashDataInts[2];
|
||||
if (!channelId && channelAccessHash) {
|
||||
// If there is no channel id, there should be no channel access_hash.
|
||||
Ui::show(Box<InformBox>(tr::lng_share_wrong_user(tr::now)));
|
||||
return;
|
||||
}
|
||||
|
||||
auto channelId = ChannelId(hashDataInts[1]);
|
||||
auto msgId = MsgId(hashDataInts[2]);
|
||||
if (const auto item = session->data().message(channelId, msgId)) {
|
||||
FastShareMessage(item);
|
||||
} else {
|
||||
@@ -1237,7 +1228,7 @@ void ShareGameScoreByHash(
|
||||
MTP_vector<MTPInputChannel>(
|
||||
1,
|
||||
MTP_inputChannel(
|
||||
MTP_int(channelId.bare), // #TODO ids
|
||||
MTP_int(channelId),
|
||||
MTP_long(channelAccessHash)))
|
||||
)).done([=](const MTPmessages_Chats &result) {
|
||||
result.match([&](const auto &data) {
|
||||
|
||||