diff --git a/Telegram/Resources/art/recording/recording_info_audio.svg b/Telegram/Resources/art/recording/recording_info_audio.svg
new file mode 100644
index 000000000..c5ab383b9
--- /dev/null
+++ b/Telegram/Resources/art/recording/recording_info_audio.svg
@@ -0,0 +1,22 @@
+
+
\ No newline at end of file
diff --git a/Telegram/Resources/art/recording/recording_info_video_landscape.svg b/Telegram/Resources/art/recording/recording_info_video_landscape.svg
new file mode 100644
index 000000000..349edd921
--- /dev/null
+++ b/Telegram/Resources/art/recording/recording_info_video_landscape.svg
@@ -0,0 +1,41 @@
+
+
\ No newline at end of file
diff --git a/Telegram/Resources/art/recording/recording_info_video_portrait.svg b/Telegram/Resources/art/recording/recording_info_video_portrait.svg
new file mode 100644
index 000000000..644b398c5
--- /dev/null
+++ b/Telegram/Resources/art/recording/recording_info_video_portrait.svg
@@ -0,0 +1,41 @@
+
+
\ No newline at end of file
diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings
index 763b1cc00..fde25b3c7 100644
--- a/Telegram/Resources/langs/lang.strings
+++ b/Telegram/Resources/langs/lang.strings
@@ -2202,11 +2202,13 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_group_call_edit_title_channel" = "Edit live stream title";
"lng_group_call_recording_start" = "Start recording";
"lng_group_call_recording_stop" = "Stop recording";
-"lng_group_call_recording_started" = "Voice chat recording started.";
+"lng_group_call_recording_started" = "Started recording the audio stream.";
+"lng_group_call_recording_started_video" = "Started recording the video stream.";
"lng_group_call_recording_started_channel" = "Live stream recording started.";
-"lng_group_call_recording_stopped" = "Voice chat recording stopped.";
+"lng_group_call_recording_stopped" = "Recording stopped.";
"lng_group_call_recording_stopped_channel" = "Live stream recording stopped.";
"lng_group_call_recording_saved" = "Audio saved to Saved Messages.";
+"lng_group_call_recording_saved_video" = "Video 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.";
@@ -2216,10 +2218,14 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"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_start_sure" = "Participants 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";
"lng_group_call_recording_start_button" = "Start";
+"lng_group_call_recording_start_title" = "Add Title";
+"lng_group_call_recording_start_checkbox" = "Also record video";
+"lng_group_call_recording_start_audio_subtitle" = "This chat will be recorded into an audio file";
+"lng_group_call_recording_start_video_subtitle" = "Choose video orientation";
"lng_group_call_is_recorded" = "Voice chat is being recorded.";
"lng_group_call_is_recorded_channel" = "Live stream is being recorded.";
"lng_group_call_can_speak_here" = "You can now speak.";
diff --git a/Telegram/Resources/qrc/telegram/telegram.qrc b/Telegram/Resources/qrc/telegram/telegram.qrc
index 84b19cbba..317c0e2da 100644
--- a/Telegram/Resources/qrc/telegram/telegram.qrc
+++ b/Telegram/Resources/qrc/telegram/telegram.qrc
@@ -62,6 +62,9 @@
../../night-green.tdesktop-theme
../../icons/calls/hands.lottie
../../icons/calls/voice.lottie
+ ../../art/recording/recording_info_audio.svg
+ ../../art/recording/recording_info_video_landscape.svg
+ ../../art/recording/recording_info_video_portrait.svg
../qmime/freedesktop.org.xml
diff --git a/Telegram/SourceFiles/calls/calls.style b/Telegram/SourceFiles/calls/calls.style
index ddbc02737..52b1bdfee 100644
--- a/Telegram/SourceFiles/calls/calls.style
+++ b/Telegram/SourceFiles/calls/calls.style
@@ -1314,3 +1314,14 @@ groupCallStickedTooltipClose: IconButton(defaultIconButton) {
}
groupCallNiceTooltipTop: 4px;
groupCallPaused: icon {{ "calls/video_large_paused", groupCallVideoTextFg }};
+
+groupCallRecordingSubLabel: FlatLabel(boxDividerLabel) {
+ margin: margins(0px, 0px, 0px, 0px);
+ textFg: groupCallMemberNotJoinedStatus;
+ align: align(top);
+}
+groupCallRecordingInfoMargins: margins(0px, 22px, 0px, 22px);
+groupCallRecordingSubLabelMargins: margins(8px, 22px, 8px, 22px);
+groupCallRecordingAudioSkip: 23px;
+groupCallRecordingSelectWidth: 2px;
+groupCallRecordingInfoHeight: 204px;
diff --git a/Telegram/SourceFiles/calls/group/calls_group_call.cpp b/Telegram/SourceFiles/calls/group/calls_group_call.cpp
index 50064d750..c9efe268e 100644
--- a/Telegram/SourceFiles/calls/group/calls_group_call.cpp
+++ b/Telegram/SourceFiles/calls/group/calls_group_call.cpp
@@ -2184,7 +2184,11 @@ void GroupCall::changeTitle(const QString &title) {
}).send();
}
-void GroupCall::toggleRecording(bool enabled, const QString &title) {
+void GroupCall::toggleRecording(
+ bool enabled,
+ const QString &title,
+ bool video,
+ bool videoPortrait) {
const auto real = lookupReal();
if (!real) {
return;
@@ -2201,10 +2205,11 @@ void GroupCall::toggleRecording(bool enabled, const QString &title) {
using Flag = MTPphone_ToggleGroupCallRecord::Flag;
_api.request(MTPphone_ToggleGroupCallRecord(
MTP_flags((enabled ? Flag::f_start : Flag(0))
+ | (video ? Flag::f_video : Flag(0))
| (title.isEmpty() ? Flag(0) : Flag::f_title)),
inputCall(),
MTP_string(title),
- MTPBool() // video_portrait
+ MTP_bool(videoPortrait)
)).done([=](const MTPUpdates &result) {
_peer->session().api().applyUpdates(result);
_recordingStoppedByMe = false;
diff --git a/Telegram/SourceFiles/calls/group/calls_group_call.h b/Telegram/SourceFiles/calls/group/calls_group_call.h
index db625b411..6e9a7887e 100644
--- a/Telegram/SourceFiles/calls/group/calls_group_call.h
+++ b/Telegram/SourceFiles/calls/group/calls_group_call.h
@@ -245,7 +245,11 @@ public:
void handlePossibleCreateOrJoinResponse(
const MTPDupdateGroupCallConnection &data);
void changeTitle(const QString &title);
- void toggleRecording(bool enabled, const QString &title);
+ void toggleRecording(
+ bool enabled,
+ const QString &title,
+ bool video,
+ bool videoPortrait);
[[nodiscard]] bool recordingStoppedByMe() const {
return _recordingStoppedByMe;
}
diff --git a/Telegram/SourceFiles/calls/group/calls_group_menu.cpp b/Telegram/SourceFiles/calls/group/calls_group_menu.cpp
index 63344212a..0fdaf4c20 100644
--- a/Telegram/SourceFiles/calls/group/calls_group_menu.cpp
+++ b/Telegram/SourceFiles/calls/group/calls_group_menu.cpp
@@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "calls/group/calls_group_call.h"
#include "calls/group/calls_group_settings.h"
#include "calls/group/calls_group_panel.h"
+#include "calls/group/ui/calls_group_recording_box.h"
#include "data/data_peer.h"
#include "data/data_group_call.h"
#include "info/profile/info_profile_values.h" // Info::Profile::NameValue.
@@ -31,87 +32,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace Calls::Group {
namespace {
-constexpr auto kMaxGroupCallLength = 40;
-
-void EditGroupCallTitleBox(
- not_null box,
- const QString &placeholder,
- const QString &title,
- bool livestream,
- Fn done) {
- box->setTitle(livestream
- ? tr::lng_group_call_edit_title_channel()
- : tr::lng_group_call_edit_title());
- const auto input = box->addRow(object_ptr(
- box,
- st::groupCallField,
- rpl::single(placeholder),
- title));
- input->setMaxLength(kMaxGroupCallLength);
- box->setFocusCallback([=] {
- input->setFocusFast();
- });
- const auto submit = [=] {
- const auto result = input->getLastText().trimmed();
- box->closeBox();
- done(result);
- };
- QObject::connect(input, &Ui::InputField::submitted, submit);
- box->addButton(tr::lng_settings_save(), submit);
- box->addButton(tr::lng_cancel(), [=] { box->closeBox(); });
-}
-
-void StartGroupCallRecordingBox(
- not_null box,
- const QString &title,
- Fn done) {
- box->setTitle(tr::lng_group_call_recording_start());
-
- box->addRow(
- object_ptr(
- box.get(),
- tr::lng_group_call_recording_start_sure(),
- st::groupCallBoxLabel));
-
- const auto input = box->addRow(object_ptr(
- box,
- st::groupCallField,
- tr::lng_group_call_recording_start_field(),
- title));
- box->setFocusCallback([=] {
- input->setFocusFast();
- });
- const auto submit = [=] {
- const auto result = input->getLastText().trimmed();
- box->closeBox();
- done(result);
- };
- QObject::connect(input, &Ui::InputField::submitted, submit);
- box->addButton(tr::lng_group_call_recording_start_button(), submit);
- box->addButton(tr::lng_cancel(), [=] { box->closeBox(); });
-}
-
-void StopGroupCallRecordingBox(
- not_null box,
- Fn done) {
- box->addRow(
- object_ptr(
- box.get(),
- tr::lng_group_call_recording_stop_sure(),
- st::groupCallBoxLabel),
- style::margins(
- st::boxRowPadding.left(),
- st::boxPadding.top(),
- st::boxRowPadding.right(),
- st::boxPadding.bottom()));
-
- box->addButton(tr::lng_box_ok(), [=] {
- box->closeBox();
- done(QString());
- });
- box->addButton(tr::lng_cancel(), [=] { box->closeBox(); });
-}
-
class JoinAsAction final : public Ui::Menu::ItemBase {
public:
JoinAsAction(
@@ -632,10 +552,15 @@ void FillMenu(
if (!real) {
return;
}
+ const auto type = std::make_shared();
const auto recordStartDate = real->recordStartDate();
const auto done = [=](QString title) {
if (const auto strong = weak.get()) {
- strong->toggleRecording(!recordStartDate, title);
+ strong->toggleRecording(
+ !recordStartDate,
+ title,
+ (*type) != RecordingType::AudioOnly,
+ (*type) == RecordingType::VideoPortrait);
}
};
if (recordStartDate) {
@@ -643,10 +568,14 @@ void FillMenu(
StopGroupCallRecordingBox,
done));
} else {
- showBox(Box(
- StartGroupCallRecordingBox,
- real->title(),
- done));
+ const auto typeDone = [=](RecordingType newType) {
+ *type = newType;
+ showBox(Box(
+ AddTitleGroupCallRecordingBox,
+ real->title(),
+ done));
+ };
+ showBox(Box(StartGroupCallRecordingBox, typeDone));
}
};
menu->addAction(MakeRecordingAction(
diff --git a/Telegram/SourceFiles/calls/group/calls_group_panel.cpp b/Telegram/SourceFiles/calls/group/calls_group_panel.cpp
index c4fadd28f..b1543bc34 100644
--- a/Telegram/SourceFiles/calls/group/calls_group_panel.cpp
+++ b/Telegram/SourceFiles/calls/group/calls_group_panel.cpp
@@ -1028,19 +1028,28 @@ void Panel::subscribeToChanges(not_null real) {
};
using namespace rpl::mappers;
+ const auto startedAsVideo = std::make_shared(real->recordVideo());
real->recordStartDateChanges(
) | rpl::map(
_1 != 0
) | rpl::distinct_until_changed(
) | rpl::start_with_next([=](bool recorded) {
const auto livestream = _call->peer()->isBroadcast();
+ const auto isVideo = real->recordVideo();
+ if (recorded) {
+ *startedAsVideo = isVideo;
+ }
validateRecordingMark(recorded);
showToast((recorded
? (livestream
? tr::lng_group_call_recording_started_channel
+ : isVideo
+ ? tr::lng_group_call_recording_started_video
: tr::lng_group_call_recording_started)
: _call->recordingStoppedByMe()
- ? tr::lng_group_call_recording_saved
+ ? ((*startedAsVideo)
+ ? tr::lng_group_call_recording_saved_video
+ : tr::lng_group_call_recording_saved)
: (livestream
? tr::lng_group_call_recording_stopped_channel
: tr::lng_group_call_recording_stopped))(
diff --git a/Telegram/SourceFiles/calls/group/ui/calls_group_recording_box.cpp b/Telegram/SourceFiles/calls/group/ui/calls_group_recording_box.cpp
new file mode 100644
index 000000000..d73202ccc
--- /dev/null
+++ b/Telegram/SourceFiles/calls/group/ui/calls_group_recording_box.cpp
@@ -0,0 +1,376 @@
+/*
+This file is part of Telegram Desktop,
+the official desktop application for the Telegram messaging service.
+
+For license and copyright information please follow this link:
+https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
+*/
+#include "calls/group/ui/calls_group_recording_box.h"
+
+#include "lang/lang_keys.h"
+#include "ui/effects/animations.h"
+#include "ui/image/image_prepare.h"
+#include "ui/layers/generic_box.h"
+#include "ui/widgets/checkbox.h"
+#include "ui/widgets/input_fields.h"
+#include "ui/widgets/labels.h"
+#include "styles/style_calls.h"
+#include "styles/style_layers.h"
+#include "styles/style_boxes.h"
+
+#include
+
+namespace Calls::Group {
+namespace {
+
+constexpr auto kRoundRadius = 9;
+constexpr auto kMaxGroupCallLength = 40;
+constexpr auto kSwitchDuration = 200;
+constexpr auto kSelectDuration = 120;
+
+class GraphicButton final : public Ui::AbstractButton {
+public:
+ GraphicButton(
+ not_null parent,
+ const QString &filename,
+ int selectWidth = 0);
+
+ void setToggled(bool value);
+protected:
+ void paintEvent(QPaintEvent *e);
+
+private:
+ const style::margins _margins;
+ QSvgRenderer _renderer;
+ Ui::RoundRect _roundRect;
+ Ui::RoundRect _roundRectSelect;
+ Ui::Animations::Simple _animation;
+ bool _toggled = false;
+};
+
+class RecordingInfo final : public Ui::RpWidget {
+public:
+ RecordingInfo(not_null parent);
+
+ void prepareAudio();
+ void prepareVideo();
+
+ RecordingType type() const;
+
+private:
+ void setLabel(const QString &text);
+
+ const object_ptr _container;
+ RecordingType _type = RecordingType::AudioOnly;
+};
+
+class Switcher final : public Ui::RpWidget {
+public:
+ Switcher(
+ not_null parent,
+ rpl::producer &&toggled);
+
+ RecordingType type() const;
+
+private:
+ const object_ptr _background;
+ const object_ptr _audio;
+ const object_ptr _video;
+ bool _toggled = false;
+
+ Ui::Animations::Simple _animation;
+};
+
+GraphicButton::GraphicButton(
+ not_null parent,
+ const QString &filename,
+ int selectWidth)
+: AbstractButton(parent)
+, _margins(selectWidth, selectWidth, selectWidth, selectWidth)
+, _renderer(u":/gui/recording/%1.svg"_q.arg(filename))
+, _roundRect(kRoundRadius, st::groupCallMembersBg)
+, _roundRectSelect(kRoundRadius, st::groupCallActiveFg) {
+ const auto size = style::ConvertScale(_renderer.defaultSize());
+ resize((QRect(QPoint(), size) + _margins).size());
+}
+
+void GraphicButton::setToggled(bool value) {
+ if (_toggled == value) {
+ return;
+ }
+ _toggled = value;
+ _animation.start(
+ [=] { update(); },
+ _toggled ? 0. : 1.,
+ _toggled ? 1. : 0.,
+ kSelectDuration);
+}
+
+void GraphicButton::paintEvent(QPaintEvent *e) {
+ Painter p(this);
+ const auto progress = _animation.value(_toggled ? 1. : 0.);
+ p.setOpacity(progress);
+ _roundRectSelect.paint(p, rect());
+ p.setOpacity(1.);
+ const auto r = rect() - _margins;
+ _roundRect.paint(p, r);
+ _renderer.render(&p, r);
+}
+
+RecordingInfo::RecordingInfo(not_null parent)
+: RpWidget(parent)
+, _container(this) {
+ sizeValue(
+ ) | rpl::start_with_next([=](const QSize &size) {
+ _container->resizeToWidth(size.width());
+ }, _container->lifetime());
+}
+
+void RecordingInfo::prepareAudio() {
+ _type = RecordingType::AudioOnly;
+ setLabel(tr::lng_group_call_recording_start_audio_subtitle(tr::now));
+
+ const auto wrap = _container->add(
+ object_ptr(_container),
+ style::margins(0, st::groupCallRecordingAudioSkip, 0, 0));
+ const auto audioIcon = Ui::CreateChild(
+ wrap,
+ "info_audio");
+ wrap->resize(width(), audioIcon->height());
+ audioIcon->setAttribute(Qt::WA_TransparentForMouseEvents);
+
+ sizeValue(
+ ) | rpl::start_with_next([=](const QSize &size) {
+ audioIcon->moveToLeft((size.width() - audioIcon->width()) / 2, 0);
+ }, lifetime());
+}
+
+void RecordingInfo::prepareVideo() {
+ setLabel(tr::lng_group_call_recording_start_video_subtitle(tr::now));
+
+ const auto wrap = _container->add(
+ object_ptr(_container),
+ style::margins());
+
+ const auto landscapeIcon = Ui::CreateChild(
+ wrap,
+ "info_video_landscape",
+ st::groupCallRecordingSelectWidth);
+ const auto portraitIcon = Ui::CreateChild(
+ wrap,
+ "info_video_portrait",
+ st::groupCallRecordingSelectWidth);
+ wrap->resize(width(), portraitIcon->height());
+
+ landscapeIcon->setToggled(true);
+ _type = RecordingType::VideoLandscape;
+
+ const auto icons = std::vector{
+ landscapeIcon,
+ portraitIcon,
+ };
+ const auto types = std::map{
+ { landscapeIcon, RecordingType::VideoLandscape },
+ { portraitIcon, RecordingType::VideoPortrait },
+ };
+ for (const auto icon : icons) {
+ icon->clicks(
+ ) | rpl::start_with_next([=] {
+ for (const auto &i : icons) {
+ i->setToggled(icon == i);
+ }
+ _type = types.at(icon);
+ }, lifetime());
+ }
+
+ wrap->sizeValue(
+ ) | rpl::start_with_next([=](const QSize &size) {
+ const auto wHalf = size.width() / icons.size();
+ for (auto i = 0; i < icons.size(); i++) {
+ const auto &icon = icons[i];
+ icon->moveToLeft(
+ wHalf * i + (wHalf - icon->width()) / 2,
+ (size.height() - icon->height()) / 2);
+ }
+ }, lifetime());
+}
+
+void RecordingInfo::setLabel(const QString &text) {
+ const auto label = _container->add(
+ object_ptr(
+ _container,
+ text,
+ st::groupCallRecordingSubLabel),
+ st::groupCallRecordingSubLabelMargins);
+
+ rpl::combine(
+ sizeValue(),
+ label->sizeValue()
+ ) | rpl::start_with_next([=](QSize my, QSize labelSize) {
+ label->moveToLeft(
+ (my.width() - labelSize.width()) / 2,
+ label->y(),
+ my.width());
+ }, label->lifetime());
+}
+
+RecordingType RecordingInfo::type() const {
+ return _type;
+}
+
+Switcher::Switcher(
+ not_null parent,
+ rpl::producer &&toggled)
+: RpWidget(parent)
+, _background(this, st::groupCallRecordingInfoHeight, st::groupCallBg)
+, _audio(this)
+, _video(this) {
+ _audio->prepareAudio();
+ _video->prepareVideo();
+
+ resize(0, st::groupCallRecordingInfoHeight);
+
+ const auto updatePositions = [=](float64 progress) {
+ _audio->moveToLeft(-width() * progress, 0);
+ _video->moveToLeft(_audio->x() + _audio->width(), 0);
+ };
+
+ sizeValue(
+ ) | rpl::start_with_next([=](const QSize &size) {
+ _audio->resize(size.width(), size.height());
+ _video->resize(size.width(), size.height());
+
+ updatePositions(_toggled ? 1. : 0.);
+
+ _background->lower();
+ _background->setGeometry(QRect(QPoint(), size));
+ }, lifetime());
+
+ std::move(
+ toggled
+ ) | rpl::start_with_next([=](bool toggled) {
+ _toggled = toggled;
+ _animation.start(
+ updatePositions,
+ toggled ? 0. : 1.,
+ toggled ? 1. : 0.,
+ kSwitchDuration);
+ }, lifetime());
+}
+
+RecordingType Switcher::type() const {
+ return _toggled ? _video->type() : _audio->type();
+}
+
+} // namespace
+
+void EditGroupCallTitleBox(
+ not_null box,
+ const QString &placeholder,
+ const QString &title,
+ bool livestream,
+ Fn done) {
+ box->setTitle(livestream
+ ? tr::lng_group_call_edit_title_channel()
+ : tr::lng_group_call_edit_title());
+ const auto input = box->addRow(object_ptr(
+ box,
+ st::groupCallField,
+ rpl::single(placeholder),
+ title));
+ input->setMaxLength(kMaxGroupCallLength);
+ box->setFocusCallback([=] {
+ input->setFocusFast();
+ });
+ const auto submit = [=] {
+ const auto result = input->getLastText().trimmed();
+ box->closeBox();
+ done(result);
+ };
+ QObject::connect(input, &Ui::InputField::submitted, submit);
+ box->addButton(tr::lng_settings_save(), submit);
+ box->addButton(tr::lng_cancel(), [=] { box->closeBox(); });
+}
+
+void StartGroupCallRecordingBox(
+ not_null box,
+ Fn done) {
+ box->setTitle(tr::lng_group_call_recording_start());
+
+ box->addRow(
+ object_ptr(
+ box.get(),
+ tr::lng_group_call_recording_start_sure(),
+ st::groupCallBoxLabel));
+
+ const auto checkbox = box->addRow(
+ object_ptr(
+ box,
+ tr::lng_group_call_recording_start_checkbox(),
+ false,
+ st::groupCallCheckbox),
+ style::margins(
+ st::boxRowPadding.left(),
+ st::boxRowPadding.left(),
+ st::boxRowPadding.right(),
+ st::boxRowPadding.bottom()));
+
+ const auto switcher = box->addRow(
+ object_ptr(box, checkbox->checkedChanges()),
+ st::groupCallRecordingInfoMargins);
+
+ box->addButton(tr::lng_continue(), [=] {
+ const auto type = switcher->type();
+ box->closeBox();
+ done(type);
+ });
+ box->addButton(tr::lng_cancel(), [=] { box->closeBox(); });
+}
+
+void AddTitleGroupCallRecordingBox(
+ not_null box,
+ const QString &title,
+ Fn done) {
+ box->setTitle(tr::lng_group_call_recording_start_title());
+
+ const auto input = box->addRow(object_ptr(
+ box,
+ st::groupCallField,
+ tr::lng_group_call_recording_start_field(),
+ title));
+ box->setFocusCallback([=] {
+ input->setFocusFast();
+ });
+ const auto submit = [=] {
+ const auto result = input->getLastText().trimmed();
+ box->closeBox();
+ done(result);
+ };
+ QObject::connect(input, &Ui::InputField::submitted, submit);
+ box->addButton(tr::lng_group_call_recording_start_button(), submit);
+ box->addButton(tr::lng_cancel(), [=] { box->closeBox(); });
+}
+
+
+void StopGroupCallRecordingBox(
+ not_null box,
+ Fn done) {
+ box->addRow(
+ object_ptr(
+ box.get(),
+ tr::lng_group_call_recording_stop_sure(),
+ st::groupCallBoxLabel),
+ style::margins(
+ st::boxRowPadding.left(),
+ st::boxPadding.top(),
+ st::boxRowPadding.right(),
+ st::boxPadding.bottom()));
+
+ box->addButton(tr::lng_box_ok(), [=] {
+ box->closeBox();
+ done(QString());
+ });
+ box->addButton(tr::lng_cancel(), [=] { box->closeBox(); });
+}
+
+} // namespace Calls::Group
diff --git a/Telegram/SourceFiles/calls/group/ui/calls_group_recording_box.h b/Telegram/SourceFiles/calls/group/ui/calls_group_recording_box.h
new file mode 100644
index 000000000..f9e567f96
--- /dev/null
+++ b/Telegram/SourceFiles/calls/group/ui/calls_group_recording_box.h
@@ -0,0 +1,42 @@
+ /*
+This file is part of Telegram Desktop,
+the official desktop application for the Telegram messaging service.
+
+For license and copyright information please follow this link:
+https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
+*/
+#pragma once
+
+namespace Ui {
+class GenericBox;
+} // namespace Ui
+
+namespace Calls::Group {
+
+enum class RecordingType {
+ AudioOnly,
+ VideoLandscape,
+ VideoPortrait,
+};
+
+void EditGroupCallTitleBox(
+ not_null box,
+ const QString &placeholder,
+ const QString &title,
+ bool livestream,
+ Fn done);
+
+void StartGroupCallRecordingBox(
+ not_null box,
+ Fn done);
+
+void AddTitleGroupCallRecordingBox(
+ not_null box,
+ const QString &title,
+ Fn done);
+
+void StopGroupCallRecordingBox(
+ not_null box,
+ Fn done);
+
+} // namespace Calls::Group
diff --git a/Telegram/SourceFiles/data/data_group_call.cpp b/Telegram/SourceFiles/data/data_group_call.cpp
index b58e0778e..908cdc9b1 100644
--- a/Telegram/SourceFiles/data/data_group_call.cpp
+++ b/Telegram/SourceFiles/data/data_group_call.cpp
@@ -389,7 +389,10 @@ void GroupCall::applyCallFields(const MTPDgroupCall &data) {
setServerParticipantsCount(data.vparticipants_count().v);
changePeerEmptyCallFlag();
_title = qs(data.vtitle().value_or_empty());
- _recordStartDate = data.vrecord_start_date().value_or_empty();
+ {
+ _recordVideo = data.is_record_video_active();
+ _recordStartDate = data.vrecord_start_date().value_or_empty();
+ }
_scheduleDate = data.vschedule_date().value_or_empty();
_scheduleStartSubscribed = data.is_schedule_start_subscribed();
_unmutedVideoLimit = data.vunmuted_video_limit().v;
diff --git a/Telegram/SourceFiles/data/data_group_call.h b/Telegram/SourceFiles/data/data_group_call.h
index 07b6b51f8..12d3bd725 100644
--- a/Telegram/SourceFiles/data/data_group_call.h
+++ b/Telegram/SourceFiles/data/data_group_call.h
@@ -98,6 +98,9 @@ public:
[[nodiscard]] int unmutedVideoLimit() const {
return _unmutedVideoLimit.current();
}
+ [[nodiscard]] bool recordVideo() const {
+ return _recordVideo.current();
+ }
void setPeer(not_null peer);
@@ -214,6 +217,7 @@ private:
int _serverParticipantsCount = 0;
rpl::variable _fullCount = 0;
rpl::variable _unmutedVideoLimit = 0;
+ rpl::variable _recordVideo = 0;
rpl::variable _recordStartDate = 0;
rpl::variable _scheduleDate = 0;
rpl::variable _scheduleStartSubscribed = false;
diff --git a/Telegram/cmake/td_ui.cmake b/Telegram/cmake/td_ui.cmake
index 8fc8005e7..e763bfbf1 100644
--- a/Telegram/cmake/td_ui.cmake
+++ b/Telegram/cmake/td_ui.cmake
@@ -47,6 +47,8 @@ nice_target_sources(td_ui ${src_loc}
PRIVATE
${style_files}
+ calls/group/ui/calls_group_recording_box.cpp
+ calls/group/ui/calls_group_recording_box.h
calls/group/ui/calls_group_scheduled_labels.cpp
calls/group/ui/calls_group_scheduled_labels.h
calls/group/ui/desktop_capture_choose_source.cpp
diff --git a/Telegram/lib_ui b/Telegram/lib_ui
index db1b4b65c..e0339b7da 160000
--- a/Telegram/lib_ui
+++ b/Telegram/lib_ui
@@ -1 +1 @@
-Subproject commit db1b4b65c7c70001412ce1ca357d82f3590008f3
+Subproject commit e0339b7da1e344bf13b7544676da9613fa8a5640