diff --git a/Linux/Windows.py b/Linux/Windows.py index d76f8f9..122ca5c 100644 --- a/Linux/Windows.py +++ b/Linux/Windows.py @@ -346,8 +346,8 @@ class NewPost(Helper.RestorableWindow): self.statusBar().showMessage(str(count)) def sendMessage(self): - count = 256 - len(self.textInput.toPlainText()) - if count >= 0: + count = len(self.textInput.toPlainText()) + if count > 0 and count <= 256: message = Helper.PostModel() message.text = unicode(self.textInput.toPlainText().toUtf8(), "utf-8") message.inReplyTostatusId = self.status_id diff --git a/Mac/NewMessageWindow.m b/Mac/NewMessageWindow.m index e814a8d..089a907 100644 --- a/Mac/NewMessageWindow.m +++ b/Mac/NewMessageWindow.m @@ -225,7 +225,7 @@ #pragma mark Keyboard delegate methods - (IBAction)sendPost:(NSControl *)control { - if ([[control stringValue] length] <= MESSAGE_MAX_LENGTH) { + if ([[control stringValue] length] <= MESSAGE_MAX_LENGTH && [[control stringValue] length] > 0) { PostModel *post = [[[PostModel alloc] init] autorelease]; post.text = [control stringValue]; post.inReplyTostatusId = inReplyTostatusId;