From 757e960b09312824cbb0e0628eb416dd8af86116 Mon Sep 17 00:00:00 2001 From: Adam D Date: Sun, 2 Mar 2014 20:46:40 +1030 Subject: [PATCH] IMDServiceSession exists on ios 5 and 6 too. oops. --- .theos/last_package | 2 +- .../packages/ws.hbang.typestatus-1.1.1~beta5 | 2 +- IMAgentRelay.x | 35 +++---------------- 3 files changed, 7 insertions(+), 32 deletions(-) diff --git a/.theos/last_package b/.theos/last_package index b1d9816..0f5786f 100644 --- a/.theos/last_package +++ b/.theos/last_package @@ -1 +1 @@ -debs/ws.hbang.typestatus_1.1.1~beta5-3+debug_iphoneos-arm.deb +debs/ws.hbang.typestatus_1.1.1~beta5-7_iphoneos-arm.deb diff --git a/.theos/packages/ws.hbang.typestatus-1.1.1~beta5 b/.theos/packages/ws.hbang.typestatus-1.1.1~beta5 index e440e5c..c793025 100644 --- a/.theos/packages/ws.hbang.typestatus-1.1.1~beta5 +++ b/.theos/packages/ws.hbang.typestatus-1.1.1~beta5 @@ -1 +1 @@ -3 \ No newline at end of file +7 \ No newline at end of file diff --git a/IMAgentRelay.x b/IMAgentRelay.x index 457bad1..9479499 100644 --- a/IMAgentRelay.x +++ b/IMAgentRelay.x @@ -18,8 +18,6 @@ void HBTSPostMessage(HBTSStatusBarType type, NSString *name, BOOL typing) { #pragma mark - iMessage hooks -%group JonyIveIsCool - %hook IMDServiceSession - (void)didReceiveMessage:(FZMessage *)message forChat:(id)chat style:(unsigned char)style { @@ -32,43 +30,20 @@ void HBTSPostMessage(HBTSStatusBarType type, NSString *name, BOOL typing) { } } +%group JonyIveIsCool + - (void)didReceiveMessageReadReceiptForMessageID:(NSString *)messageID date:(NSDate *)date completionBlock:(id)completion { %orig; - - FZMessage *message = [[%c(IMDMessageStore) sharedInstance] messageWithGUID:messageID]; - HBTSPostMessage(HBTSStatusBarTypeRead, message.handle, NO); + HBTSPostMessage(HBTSStatusBarTypeRead, [[%c(IMDMessageStore) sharedInstance] messageWithGUID:messageID].handle, NO); } %end -%end - %group ForstallForTheWin -%hook IMDaemonListener - -- (void)account:(id)account chat:(id)chat style:(unsigned char)style chatProperties:(id)properties messageReceived:(FZMessage *)message { +- (void)didReceiveMessageReadReceiptForMessageID:(NSString *)messageID { %orig; - - if (message.flags == FZMessageFlagsTypingBegan) { - HBTSPostMessage(HBTSStatusBarTypeTyping, message.handle, YES); - } else { - HBTSPostMessage(HBTSStatusBarTypeTypingEnded, message.handle, NO); - } -} - -%end - -%hook FZMessage - -// todo: make this less hacky - -- (void)setTimeRead:(NSDate *)timeRead { - %orig; - - if (!self.sender && [[NSDate date] timeIntervalSinceDate:self.timeRead] < 1) { - HBTSPostMessage(HBTSStatusBarTypeRead, self.handle, NO); - } + HBTSPostMessage(HBTSStatusBarTypeRead, [[%c(IMDMessageStore) sharedInstance] messageWithGUID:messageID].handle, NO); } %end