mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-06 15:13:57 +02:00
feat: send with sound in menu
This commit is contained in:
parent
409165dec6
commit
12b16577ef
4 changed files with 11 additions and 3 deletions
|
@ -66,6 +66,7 @@ ComposeIcons {
|
||||||
menuGifAdd: icon;
|
menuGifAdd: icon;
|
||||||
menuGifRemove: icon;
|
menuGifRemove: icon;
|
||||||
menuMute: icon;
|
menuMute: icon;
|
||||||
|
menuUnmute: icon;
|
||||||
menuSchedule: icon;
|
menuSchedule: icon;
|
||||||
menuWhenOnline: icon;
|
menuWhenOnline: icon;
|
||||||
menuSpoiler: icon;
|
menuSpoiler: icon;
|
||||||
|
@ -615,6 +616,7 @@ defaultComposeIcons: ComposeIcons {
|
||||||
menuGifAdd: menuIconGif;
|
menuGifAdd: menuIconGif;
|
||||||
menuGifRemove: menuIconDelete;
|
menuGifRemove: menuIconDelete;
|
||||||
menuMute: menuIconMute;
|
menuMute: menuIconMute;
|
||||||
|
menuUnmute: menuIconUnmute;
|
||||||
menuSchedule: menuIconSchedule;
|
menuSchedule: menuIconSchedule;
|
||||||
menuWhenOnline: menuIconWhenOnline;
|
menuWhenOnline: menuIconWhenOnline;
|
||||||
menuSpoiler: menuIconSpoiler;
|
menuSpoiler: menuIconSpoiler;
|
||||||
|
|
|
@ -527,7 +527,7 @@ bool ShouldSendSilent(
|
||||||
const Api::SendOptions &options) {
|
const Api::SendOptions &options) {
|
||||||
const auto& settings = AyuSettings::getInstance();
|
const auto& settings = AyuSettings::getInstance();
|
||||||
if (settings.sendWithoutSound) {
|
if (settings.sendWithoutSound) {
|
||||||
return true;
|
return !options.silent;
|
||||||
}
|
}
|
||||||
|
|
||||||
return options.silent
|
return options.silent
|
||||||
|
|
|
@ -644,6 +644,7 @@ storiesEmojiPan: EmojiPan(defaultEmojiPan) {
|
||||||
menuGifAdd: icon {{ "menu/gif", storiesComposeWhiteText }};
|
menuGifAdd: icon {{ "menu/gif", storiesComposeWhiteText }};
|
||||||
menuGifRemove: icon {{ "menu/delete", storiesComposeWhiteText }};
|
menuGifRemove: icon {{ "menu/delete", storiesComposeWhiteText }};
|
||||||
menuMute: icon {{ "menu/mute", storiesComposeWhiteText }};
|
menuMute: icon {{ "menu/mute", storiesComposeWhiteText }};
|
||||||
|
menuUnmute: icon {{ "menu/unmute", storiesComposeWhiteText }};
|
||||||
menuSchedule: icon {{ "menu/calendar", storiesComposeWhiteText }};
|
menuSchedule: icon {{ "menu/calendar", storiesComposeWhiteText }};
|
||||||
menuWhenOnline: icon {{ "menu/send_when_online", storiesComposeWhiteText }};
|
menuWhenOnline: icon {{ "menu/send_when_online", storiesComposeWhiteText }};
|
||||||
menuSpoiler: icon {{ "menu/spoiler_on", storiesComposeWhiteText }};
|
menuSpoiler: icon {{ "menu/spoiler_on", storiesComposeWhiteText }};
|
||||||
|
|
|
@ -58,6 +58,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
|
|
||||||
#include <QtWidgets/QApplication>
|
#include <QtWidgets/QApplication>
|
||||||
|
|
||||||
|
// AyuGram includes
|
||||||
|
#include "ayu/ayu_settings.h"
|
||||||
|
|
||||||
|
|
||||||
namespace SendMenu {
|
namespace SendMenu {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
@ -690,10 +694,11 @@ FillMenuResult FillSendMenu(
|
||||||
: st::defaultComposeIcons;
|
: st::defaultComposeIcons;
|
||||||
|
|
||||||
if (sending && type != Type::Reminder) {
|
if (sending && type != Type::Reminder) {
|
||||||
|
const auto& settings = AyuSettings::getInstance();
|
||||||
menu->addAction(
|
menu->addAction(
|
||||||
tr::lng_send_silent_message(tr::now),
|
settings.sendWithoutSound ? tr::ayu_SendWithSound(tr::now) : tr::lng_send_silent_message(tr::now),
|
||||||
[=] { action({ Api::SendOptions{ .silent = true } }, details); },
|
[=] { action({ Api::SendOptions{ .silent = true } }, details); },
|
||||||
&icons.menuMute);
|
settings.sendWithoutSound ? &icons.menuUnmute : &icons.menuMute);
|
||||||
}
|
}
|
||||||
if (sending && type != Type::SilentOnly) {
|
if (sending && type != Type::SilentOnly) {
|
||||||
menu->addAction(
|
menu->addAction(
|
||||||
|
|
Loading…
Add table
Reference in a new issue