Skip to content

Commit

Permalink
Retire setting. Feature is mature. No reason user should need to disa…
Browse files Browse the repository at this point in the history
…ble.
  • Loading branch information
Michael Morris committed Aug 5, 2013
1 parent ca5a0ab commit db59074
Show file tree
Hide file tree
Showing 4 changed files with 458 additions and 184 deletions.
1 change: 0 additions & 1 deletion Classes/Headers/TPCPreferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ typedef enum TXHostmaskBanFormat : NSInteger {

+ (TXNoticeSendLocationType)locationToSendNotices;

+ (BOOL)trackConversations;
+ (BOOL)disableNicknameColorHashing;

+ (BOOL)displayDockBadge;
Expand Down
6 changes: 0 additions & 6 deletions Classes/Preferences/TPCPreferences.m
Original file line number Diff line number Diff line change
Expand Up @@ -611,11 +611,6 @@ + (BOOL)hideMainWindowSegmentedController
return [RZUserDefaults() boolForKey:@"DisableMainWindowSegmentedController"];
}

+ (BOOL)trackConversations
{
return [RZUserDefaults() boolForKey:@"TrackConversationsWithColorHashing"];
}

+ (BOOL)autojoinWaitsForNickServ
{
return [RZUserDefaults() boolForKey:@"AutojoinWaitsForNickservIdentification"];
Expand Down Expand Up @@ -1394,7 +1389,6 @@ + (void)initPreferences
d[@"LogTranscriptInBatches"] = @(YES);
d[@"ProcessChannelModesOnJoin"] = @(YES);
d[@"ReplyUnignoredExternalCTCPRequests"] = @(YES);
d[@"TrackConversationsWithColorHashing"] = @(YES);
d[@"TrackNicknameHighlightsOfLocalUser"] = @(YES);
d[@"WebKitDeveloperExtras"] = @(YES);

Expand Down
114 changes: 56 additions & 58 deletions Classes/Views/Channel View/TVCLogRenderer.m
Original file line number Diff line number Diff line change
Expand Up @@ -678,98 +678,96 @@ + (NSString *)renderBody:(NSString *)body
}

/* Conversation Tracking */
if ([TPCPreferences trackConversations]) {
if (log && isNormalMsg) {
IRCClient *logClient = log.client;
IRCChannel *logChannel = log.channel;
if (log && isNormalMsg) {
IRCClient *logClient = log.client;
IRCChannel *logChannel = log.channel;

NSMutableSet *mentionedUsers = [NSMutableSet set];
NSMutableSet *mentionedUsers = [NSMutableSet set];

NSArray *sortedMembers = logChannel.memberListLengthSorted;
NSArray *sortedMembers = logChannel.memberListLengthSorted;

for (IRCUser *user in sortedMembers) {
start = 0;
for (IRCUser *user in sortedMembers) {
start = 0;

PointerIsEmptyAssertLoopContinue(user.nickname);
PointerIsEmptyAssertLoopContinue(user.nickname);

while (start < length) {
NSRange r = [body rangeOfString:user.nickname
options:NSCaseInsensitiveSearch
range:NSMakeRange(start, (length - start))];
while (start < length) {
NSRange r = [body rangeOfString:user.nickname
options:NSCaseInsensitiveSearch
range:NSMakeRange(start, (length - start))];

if (r.location == NSNotFound) {
break;
}
if (r.location == NSNotFound) {
break;
}

BOOL cleanMatch = YES;
BOOL cleanMatch = YES;

UniChar c = [body characterAtIndex:r.location];
UniChar c = [body characterAtIndex:r.location];

if (TXStringIsAlphabeticNumeric(c)) {
NSInteger prev = (r.location - 1);
if (TXStringIsAlphabeticNumeric(c)) {
NSInteger prev = (r.location - 1);

if (0 <= prev && prev < length) {
UniChar c = [body characterAtIndex:prev];
if (0 <= prev && prev < length) {
UniChar c = [body characterAtIndex:prev];

if (TXStringIsAlphabeticNumeric(c)) {
cleanMatch = NO;
}
if (TXStringIsAlphabeticNumeric(c)) {
cleanMatch = NO;
}
}
}

if (cleanMatch) {
UniChar c = [body characterAtIndex:(NSMaxRange(r) - 1)];
if (cleanMatch) {
UniChar c = [body characterAtIndex:(NSMaxRange(r) - 1)];

if (TXStringIsAlphabeticNumeric(c)) {
NSInteger next = NSMaxRange(r);
if (TXStringIsAlphabeticNumeric(c)) {
NSInteger next = NSMaxRange(r);

if (next < length) {
UniChar c = [body characterAtIndex:next];
if (next < length) {
UniChar c = [body characterAtIndex:next];

if (TXStringIsAlphabeticNumeric(c)) {
cleanMatch = NO;
}
if (TXStringIsAlphabeticNumeric(c)) {
cleanMatch = NO;
}
}
}
}

if (cleanMatch) {
if (isClear(attrBuf, _rendererURLAttribute, r.location, r.length) &&
isClear(attrBuf, _rendererKeywordHighlightAttribute, r.location, r.length))
{
/* Check if the nickname conversation tracking found is matched to an ignore
that is set to hide them. */
IRCAddressBook *ignoreCheck = [logClient checkIgnoreAgainstHostmask:user.hostmask withMatches:@[@"hideMessagesContainingMatch"]];

if (PointerIsNotEmpty(ignoreCheck) && ignoreCheck.hideMessagesContainingMatch) {
if (outputDictionary) {
*outputDictionary = @{@"containsIgnoredNickname" : @(YES)};
}

return nil;
if (cleanMatch) {
if (isClear(attrBuf, _rendererURLAttribute, r.location, r.length) &&
isClear(attrBuf, _rendererKeywordHighlightAttribute, r.location, r.length))
{
/* Check if the nickname conversation tracking found is matched to an ignore
that is set to hide them. */
IRCAddressBook *ignoreCheck = [logClient checkIgnoreAgainstHostmask:user.hostmask withMatches:@[@"hideMessagesContainingMatch"]];

if (PointerIsNotEmpty(ignoreCheck) && ignoreCheck.hideMessagesContainingMatch) {
if (outputDictionary) {
*outputDictionary = @{@"containsIgnoredNickname" : @(YES)};
}

/* Continue normally. */
setFlag(attrBuf, _rendererConversationTrackerAttribute, r.location, r.length);

[mentionedUsers addObject:user];
return nil;
}
}

start = (NSMaxRange(r) + 1);
/* Continue normally. */
setFlag(attrBuf, _rendererConversationTrackerAttribute, r.location, r.length);

[mentionedUsers addObject:user];
}
}
}

if (NSObjectIsNotEmpty(mentionedUsers)) {
[resultInfo safeSetObject:[mentionedUsers allObjects] forKey:@"mentionedUsers"];
start = (NSMaxRange(r) + 1);
}
}

if (NSObjectIsNotEmpty(mentionedUsers)) {
[resultInfo safeSetObject:[mentionedUsers allObjects] forKey:@"mentionedUsers"];
}
}

if (PointerIsEmpty(outputDictionary) == NO) {
*outputDictionary = resultInfo;
}

/* End HTML drawing. */
}
} // isPlainText
Expand Down
Loading

0 comments on commit db59074

Please sign in to comment.