This commit is contained in:
Jeena Paradies 2013-02-03 20:18:31 +01:00
parent aac70a1083
commit 3fee55ea1a
2 changed files with 3 additions and 3 deletions

View file

@ -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

View file

@ -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;