Created
March 3, 2012 03:36
-
-
Save JRHeaton/1964177 to your computer and use it in GitHub Desktop.
markthatmessage mac beta
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* MarkThatMessage v0.1 beta for OS X | |
* Designed for use with Messages beta | |
* | |
* John Heaton | |
* [email protected] | |
* http://github.com/Gojohnnyboi | |
*/ | |
#import <Foundation/Foundation.h> | |
#import <AppKit/AppKit.h> | |
#import <objc/runtime.h> | |
static IMP orig = NULL; | |
static Class _IMHeaderChatItem = NULL; | |
static BOOL shouldShowTS(id self, SEL _cmd, id beforeItem, id afterItem) { | |
if(!_IMHeaderChatItem) | |
return (BOOL)orig(self, _cmd, beforeItem, afterItem); | |
return ![afterItem isKindOfClass:_IMHeaderChatItem]; | |
} | |
__attribute__((constructor)) | |
static void initMessagesHook() { | |
_IMHeaderChatItem = objc_getClass("IMHeaderChatItem"); | |
orig = method_setImplementation(class_getInstanceMethod(objc_getClass("IMChat"), @selector(shouldAppendTimestampAfterChatItem:andBeforeChatItem:)), (IMP) shouldShowTS); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment