Skip to content

Instantly share code, notes, and snippets.

@moyashi
Created January 19, 2011 14:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moyashi/786221 to your computer and use it in GitHub Desktop.
Save moyashi/786221 to your computer and use it in GitHub Desktop.
//
// ReederMacPatcherShareTwitter.m
// ReederMacPatcher
//
// Created by moyashi on 11/01/16.
// Copyright 2011 __MyCompanyName__. All rights reserved.
//
#import "ReederMacPatcherShareTwitter.h"
@implementation NSViewController (ReederMacPatcherShareTwitter)
-(void)willPresentPostForm_SwizzledByReederMacPatcher {
[self willPresentPostForm_SwizzledByReederMacPatcher];
[self addText:[NSString stringWithFormat:@" \"%@\" ", [[self object]title]]];
if ([[self object] shortening]) {
[self addText:[[self object] shortenedUrl]];
} else {
[[self object] shortenUrlWithDelegate:self];
viaReederMacPatcher = YES;
}
for (id element in [self postCells]) {
if ([[element class] isEqual:objc_getClass("ShareFormButton")]) {
[[element button] setKeyEquivalent:@"m"];
[[element button] setKeyEquivalentModifierMask:NSCommandKeyMask];
}
}
return;
}
- (void)shareObjectDidShortenUrl_SwizzledByReederMacPatcher:(id)arg1 {
[self shareObjectDidShortenUrl_SwizzledByReederMacPatcher:arg1];
[self addText:[[self object] shortenedUrl]];
/*
if ([[self object] shortening]) {
[self addText:[[self object] shortenedUrl]];
} else {
[self addText:[[self object] url]];
}
*/
if (viaReederMacPatcher) {
[[[self textareaCellWithName:@"status"] input] setSelectedRange:NSMakeRange(0, 0)];
viaReederMacPatcher = NO;
}
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment