fixed #137
This commit is contained in:
parent
aac70a1083
commit
3fee55ea1a
2 changed files with 3 additions and 3 deletions
|
@ -346,8 +346,8 @@ class NewPost(Helper.RestorableWindow):
|
||||||
self.statusBar().showMessage(str(count))
|
self.statusBar().showMessage(str(count))
|
||||||
|
|
||||||
def sendMessage(self):
|
def sendMessage(self):
|
||||||
count = 256 - len(self.textInput.toPlainText())
|
count = len(self.textInput.toPlainText())
|
||||||
if count >= 0:
|
if count > 0 and count <= 256:
|
||||||
message = Helper.PostModel()
|
message = Helper.PostModel()
|
||||||
message.text = unicode(self.textInput.toPlainText().toUtf8(), "utf-8")
|
message.text = unicode(self.textInput.toPlainText().toUtf8(), "utf-8")
|
||||||
message.inReplyTostatusId = self.status_id
|
message.inReplyTostatusId = self.status_id
|
||||||
|
|
|
@ -225,7 +225,7 @@
|
||||||
#pragma mark Keyboard delegate methods
|
#pragma mark Keyboard delegate methods
|
||||||
|
|
||||||
- (IBAction)sendPost:(NSControl *)control {
|
- (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];
|
PostModel *post = [[[PostModel alloc] init] autorelease];
|
||||||
post.text = [control stringValue];
|
post.text = [control stringValue];
|
||||||
post.inReplyTostatusId = inReplyTostatusId;
|
post.inReplyTostatusId = inReplyTostatusId;
|
||||||
|
|
Reference in a new issue