This file contains hidden or 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
- (BOOL)handleMessage:(Connection *)connection data:(NSData *)data onTopic:(NSString *)topic retained:(BOOL)retained { | |
DDLogVerbose(@"handleMessage"); | |
if (![[OwnTracking sharedInstance] processMessage:topic data:data retained:retained context:self.queueManagedObjectContext]) { | |
return false; | |
} | |
NSArray *baseComponents = [[Settings theGeneralTopic] componentsSeparatedByString:@"/"]; | |
NSArray *topicComponents = [[Settings theGeneralTopic] componentsSeparatedByString:@"/"]; | |
This file contains hidden or 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
- (NSString*) postedSince { | |
NSInteger days = self.age.integerValue / (60 * 60 * 24); | |
NSInteger second = self.age.integerValue % (60 * 60 * 24); | |
NSInteger hours = second / (60 * 60); | |
NSInteger minute = (second % (60 * 60)) / 60; | |
NSMutableString* postedSince = [NSMutableString new]; | |
if(self.age.integerValue < 60){ | |
return [NSString stringWithFormat:@"%ld s", (long)self.age.integerValue]; |