summaryrefslogtreecommitdiff
path: root/src/preview/PreviewController.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/preview/PreviewController.cpp')
-rw-r--r--src/preview/PreviewController.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/preview/PreviewController.cpp b/src/preview/PreviewController.cpp
index 89e3ca6..37561b7 100644
--- a/src/preview/PreviewController.cpp
+++ b/src/preview/PreviewController.cpp
@@ -84,24 +84,27 @@ void PreviewController::Update()
}
}
-void PreviewController::SubmitComment(std::string comment)
+bool PreviewController::SubmitComment(std::string comment)
{
if(comment.length() < 4)
{
new ErrorMessage("Error", "Comment is too short");
+ return false;
}
else
{
RequestStatus status = Client::Ref().AddComment(saveId, comment);
if(status != RequestOkay)
{
- new ErrorMessage("Error Submitting comment", Client::Ref().GetLastError());
+ new ErrorMessage("Error Submitting comment", Client::Ref().GetLastError());
+ return false;
}
else
{
previewModel->UpdateComments(1);
}
}
+ return true;
}
void PreviewController::ShowLogin()