add error message for messages over 512 chars
This commit is contained in:
@@ -349,6 +349,22 @@ void MainWindow::sendChat() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int max = 512;
|
||||||
|
QString chattext = ui->memoTxtChat->toPlainText();
|
||||||
|
int size = chattext.size();
|
||||||
|
|
||||||
|
if (size > max){
|
||||||
|
|
||||||
|
// auto addr = "";
|
||||||
|
// if (! Settings::isZAddress(AddressBook::addressFromAddressLabel(addr->text()))) {
|
||||||
|
QMessageBox msg(QMessageBox::Critical, tr("Your Message is too long"),
|
||||||
|
tr("You can only write messages with 512 character maximum \n") + tr("\n Please reduce your message to 512 character."),
|
||||||
|
QMessageBox::Ok, this);
|
||||||
|
|
||||||
|
msg.exec();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Tx tx = createTxFromChatPage();
|
Tx tx = createTxFromChatPage();
|
||||||
|
|
||||||
QString error = doSendChatTxValidations(tx);
|
QString error = doSendChatTxValidations(tx);
|
||||||
@@ -646,6 +662,22 @@ void MainWindow::ContactRequest() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int max = 512;
|
||||||
|
QString chattext = contactRequest.getMemo();;
|
||||||
|
int size = chattext.size();
|
||||||
|
|
||||||
|
if (size > max){
|
||||||
|
|
||||||
|
// auto addr = "";
|
||||||
|
// if (! Settings::isZAddress(AddressBook::addressFromAddressLabel(addr->text()))) {
|
||||||
|
QMessageBox msg(QMessageBox::Critical, tr("Your Message is too long"),
|
||||||
|
tr("You can only write messages with 512 character maximum \n") + tr("\n Please reduce your message to 512 character."),
|
||||||
|
QMessageBox::Ok, this);
|
||||||
|
|
||||||
|
msg.exec();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Tx tx = createTxForSafeContactRequest();
|
Tx tx = createTxForSafeContactRequest();
|
||||||
|
|
||||||
QString error = doSendRequestTxValidations(tx);
|
QString error = doSendRequestTxValidations(tx);
|
||||||
|
|||||||
Reference in New Issue
Block a user