added posting private posts

This commit is contained in:
Jeena Paradies 2012-12-22 19:37:03 +01:00
parent eb540fae1d
commit 2ca5d1ea68
12 changed files with 144 additions and 92 deletions

View file

@ -296,11 +296,12 @@
[[NSDocumentController sharedDocumentController] openUntitledDocumentAndDisplay:YES error:nil];
}
- (void)openNewMessageWindowInReplyTo:(NSString *)userName statusId:(NSString *)statusId withString:(NSString *)string
- (void)openNewMessageWindowInReplyTo:(NSString *)userName statusId:(NSString *)statusId withString:(NSString *)string isPrivate:(BOOL)isPrivate
{
[NSApp activateIgnoringOtherApps:YES];
NewMessageWindow *newTweet = (NewMessageWindow *)[[NSDocumentController sharedDocumentController] openUntitledDocumentAndDisplay:YES error:nil];
[newTweet inReplyTo:userName statusId:statusId withString:string];
NewMessageWindow *newMessage = (NewMessageWindow *)[[NSDocumentController sharedDocumentController] openUntitledDocumentAndDisplay:YES error:nil];
[newMessage inReplyTo:userName statusId:statusId withString:string];
[newMessage setIsPrivate:isPrivate];
}
- (void)openNewMessageWindowWithString:(NSString *)aString
@ -347,12 +348,18 @@
imageFilePath = [NSString stringWithFormat:@"\"data:%@;base64,%@\"", mimeType, base64];
}
NSString *func = [NSString stringWithFormat:@"tentia_instance.sendNewMessage(\"%@\", \"%@\", \"%@\", %@, %@)",
NSString *isPrivate = @"false";
if (post.isPrivate) {
isPrivate = @"true";
}
NSString *func = [NSString stringWithFormat:@"tentia_instance.sendNewMessage(\"%@\", \"%@\", \"%@\", %@, %@, %@)",
text,
post.inReplyTostatusId,
post.inReplyToEntity,
locationObject,
imageFilePath];
imageFilePath,
isPrivate];
[timelineView stringByEvaluatingJavaScriptFromString:func];
}