Disable sticker button when sending is blocked

This commit is contained in:
hunbernd 2019-10-09 17:27:14 +02:00
parent e52f1282ec
commit 9c877d3cdd

View File

@ -439,6 +439,7 @@ void ChatWidget::blockSending(QString msg)
#ifndef RS_ASYNC_CHAT #ifndef RS_ASYNC_CHAT
sendingBlocked = true; sendingBlocked = true;
ui->sendButton->setEnabled(false); ui->sendButton->setEnabled(false);
ui->stickerButton->setEnabled(false);
#endif #endif
ui->sendButton->setToolTip(msg); ui->sendButton->setToolTip(msg);
} }
@ -446,6 +447,7 @@ void ChatWidget::blockSending(QString msg)
void ChatWidget::unblockSending() void ChatWidget::unblockSending()
{ {
sendingBlocked = false; sendingBlocked = false;
ui->stickerButton->setEnabled(true);
updateLenOfChatTextEdit(); updateLenOfChatTextEdit();
} }
@ -1559,6 +1561,7 @@ void ChatWidget::stickerWidget()
void ChatWidget::sendSticker() void ChatWidget::sendSticker()
{ {
if(sendingBlocked) return;
QString sticker = qobject_cast<QPushButton*>(sender())->statusTip(); QString sticker = qobject_cast<QPushButton*>(sender())->statusTip();
QString encodedImage; QString encodedImage;
if (RsHtml::makeEmbeddedImage(sticker, encodedImage, 640*480, maxMessageSize() - 200)) { //-200 for the html stuff if (RsHtml::makeEmbeddedImage(sticker, encodedImage, 640*480, maxMessageSize() - 200)) { //-200 for the html stuff