2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Allow sending silent messages.

This commit is contained in:
John Preston
2019-07-26 18:06:22 +02:00
parent f1cd70d8a8
commit 3f2cc01f48
16 changed files with 118 additions and 66 deletions

View File

@@ -408,7 +408,13 @@ void ShareBox::keyPressEvent(QKeyEvent *e) {
void ShareBox::createButtons() {
clearButtons();
if (_hasSelected) {
addButton(tr::lng_share_confirm(), [=] { submit(); });
const auto send = addButton(tr::lng_share_confirm(), [=] {
submit();
});
SetupSendWithoutSound(
send,
[=] { return true; },
[=] { submit(true); });
} else if (_copyCallback) {
addButton(tr::lng_share_copy_link(), [=] { copyLink(); });
}
@@ -442,11 +448,12 @@ void ShareBox::innerSelectedChanged(PeerData *peer, bool checked) {
update();
}
void ShareBox::submit() {
void ShareBox::submit(bool silent) {
if (_submitCallback) {
_submitCallback(
_inner->selected(),
_comment->entity()->getTextWithAppliedMarkdown());
_comment->entity()->getTextWithAppliedMarkdown(),
silent);
}
}