2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Add push-to-talk release delay.

This commit is contained in:
John Preston
2020-12-06 16:44:20 +04:00
parent 80b7858f5e
commit 72a8b92827
7 changed files with 111 additions and 11 deletions

View File

@@ -111,7 +111,8 @@ QByteArray Settings::serialize() const {
<< _callVideoInputDeviceId
<< qint32(_ipRevealWarning ? 1 : 0)
<< qint32(_groupCallPushToTalk ? 1 : 0)
<< _groupCallPushToTalkShortcut;
<< _groupCallPushToTalkShortcut
<< qint64(_groupCallPushToTalkDelay);
}
return result;
}
@@ -181,6 +182,7 @@ void Settings::addFromSerialized(const QByteArray &serialized) {
qint32 ipRevealWarning = _ipRevealWarning ? 1 : 0;
qint32 groupCallPushToTalk = _groupCallPushToTalk ? 1 : 0;
QByteArray groupCallPushToTalkShortcut = _groupCallPushToTalkShortcut;
qint64 groupCallPushToTalkDelay = _groupCallPushToTalkDelay;
stream >> themesAccentColors;
if (!stream.atEnd()) {
@@ -270,9 +272,11 @@ void Settings::addFromSerialized(const QByteArray &serialized) {
if (!stream.atEnd()) {
stream
>> groupCallPushToTalk
>> groupCallPushToTalkShortcut;
>> groupCallPushToTalkShortcut
>> groupCallPushToTalkDelay;
}
if (stream.status() != QDataStream::Ok) {
if (false && stream.status() != QDataStream::Ok) {
AssertIsDebug();
LOG(("App Error: "
"Bad data for Core::Settings::constructFromSerialized()"));
return;
@@ -365,6 +369,7 @@ void Settings::addFromSerialized(const QByteArray &serialized) {
_systemDarkModeEnabled = (systemDarkModeEnabled == 1);
_groupCallPushToTalk = (groupCallPushToTalk == 1);
_groupCallPushToTalkShortcut = groupCallPushToTalkShortcut;
_groupCallPushToTalkDelay = groupCallPushToTalkDelay;
}
bool Settings::chatWide() const {
@@ -471,6 +476,10 @@ void Settings::resetOnLastLogout() {
//_callInputVolume = 100;
//_callAudioDuckingEnabled = true;
_groupCallPushToTalk = false;
_groupCallPushToTalkShortcut = QByteArray();
_groupCallPushToTalkDelay = 20;
//_themesAccentColors = Window::Theme::AccentColors();
_lastSeenWarningSeen = false;

View File

@@ -229,6 +229,12 @@ public:
void setGroupCallPushToTalkShortcut(const QByteArray &serialized) {
_groupCallPushToTalkShortcut = serialized;
}
[[nodiscard]] crl::time groupCallPushToTalkDelay() const {
return _groupCallPushToTalkDelay;
}
void setGroupCallPushToTalkDelay(crl::time delay) {
_groupCallPushToTalkDelay = delay;
}
[[nodiscard]] Window::Theme::AccentColors &themesAccentColors() {
return _themesAccentColors;
}
@@ -527,6 +533,7 @@ private:
bool _callAudioDuckingEnabled = true;
bool _groupCallPushToTalk = false;
QByteArray _groupCallPushToTalkShortcut;
crl::time _groupCallPushToTalkDelay = 20;
Window::Theme::AccentColors _themesAccentColors;
bool _lastSeenWarningSeen = false;
Ui::SendFilesWay _sendFilesWay;