Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlight keywords in notice messages #256

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Classes/IRC/IRCClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -2106,7 +2106,8 @@ - (BOOL)printChannel:(id)chan type:(LogLineType)type nick:(NSString*)nick text:(
}
}

if (type == LINE_TYPE_PRIVMSG || type == LINE_TYPE_ACTION) {
BOOL keywordNotice = [Preferences keywordNotice];
if (type == LINE_TYPE_PRIVMSG || type == LINE_TYPE_ACTION || (type == LINE_TYPE_NOTICE && keywordNotice)) {
if (memberType != MEMBER_TYPE_MYSELF) {
keywords = [Preferences keywords];
excludeWords = [Preferences excludeWords];
Expand Down
1 change: 1 addition & 0 deletions Classes/Preferences/Preferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ typedef enum {
+ (BOOL)keywordCurrentNick;
+ (KeywordMatchType)keywordMatchingMethod;
+ (BOOL)keywordWholeLine;
+ (BOOL)keywordNotice;

+ (NSString*)pasteCommand;
+ (void)setPasteCommand:(NSString*)value;
Expand Down
7 changes: 7 additions & 0 deletions Classes/Preferences/Preferences.m
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,12 @@ + (BOOL)keywordWholeLine
return [ud boolForKey:@"Preferences.Keyword.whole_line"];
}

+ (BOOL)keywordNotice
{
NSUserDefaults* ud = [NSUserDefaults standardUserDefaults];
return [ud boolForKey:@"Preferences.Keyword.notice"];
}

+ (NSArray*)keywordWords
{
NSUserDefaults* ud = [NSUserDefaults standardUserDefaults];
Expand Down Expand Up @@ -811,6 +817,7 @@ + (void)initPreferences
[d setBool:YES forKey:@"Preferences.Keyword.current_nick"];
[d setInt:KEYWORD_MATCH_PARTIAL forKey:@"Preferences.Keyword.matching_method"];
[d setBool:NO forKey:@"Preferences.Keyword.whole_line"];
[d setBool:YES forKey:@"Preferences.Keyword.notice"];
[d setObject:@"privmsg" forKey:@"Preferences.General.paste_command"];
[d setObject:@"plain text" forKey:@"Preferences.General.paste_syntax"];
[d setObject:@"resource:Limelight" forKey:@"Preferences.Theme.name"];
Expand Down
2 changes: 1 addition & 1 deletion Classes/Views/ThinSplitView.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

#import "ThinSplitView.h"


@implementation ThinSplitView
{
int _myDividerThickness;
}
@synthesize hidden = _hidden;

- (void)setUp
{
Expand Down
33 changes: 22 additions & 11 deletions English.lproj/Preferences.xib
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="4514" systemVersion="13A603" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6254" systemVersion="13F34" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<deployment version="1070" defaultVersion="1080" identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="4514"/>
<deployment version="1070" identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6254"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="PreferencesController">
Expand All @@ -19,8 +19,8 @@
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application"/>
<window title="Preferences" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" wantsToBeColor="NO" visibleAtLaunch="NO" animationBehavior="default" id="5" userLabel="Window" customClass="DialogWindow">
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<window title="Preferences" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="5" userLabel="Window" customClass="DialogWindow">
<windowStyleMask key="styleMask" titled="YES" closable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="682" y="550" width="443" height="397"/>
Expand Down Expand Up @@ -112,7 +112,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnReordering="NO" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" id="2123">
<rect key="frame" x="0.0" y="0.0" width="190" height="152"/>
<rect key="frame" x="0.0" y="0.0" width="190" height="19"/>
<autoresizingMask key="autoresizingMask"/>
<size key="intercellSpacing" width="3" height="2"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
Expand Down Expand Up @@ -179,7 +179,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnReordering="NO" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" id="2514">
<rect key="frame" x="0.0" y="0.0" width="190" height="152"/>
<rect key="frame" x="0.0" y="0.0" width="190" height="19"/>
<autoresizingMask key="autoresizingMask"/>
<size key="intercellSpacing" width="3" height="2"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
Expand Down Expand Up @@ -249,9 +249,9 @@
<action selector="remove:" target="4313" id="4340"/>
<binding destination="4313" name="enabled2" keyPath="canRemove" previousBinding="2595" id="4353">
<dictionary key="options">
<integer key="NSNotApplicablePlaceholder" value="-1"/>
<integer key="NSNoSelectionPlaceholder" value="-1"/>
<integer key="NSMultipleValuesPlaceholder" value="-1"/>
<integer key="NSNoSelectionPlaceholder" value="-1"/>
<integer key="NSNotApplicablePlaceholder" value="-1"/>
<integer key="NSNullPlaceholder" value="-1"/>
</dictionary>
</binding>
Expand All @@ -262,6 +262,17 @@
</binding>
</connections>
</button>
<button id="DpQ-PF-wP5">
<rect key="frame" x="228" y="54" width="203" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Highlight in notice messages" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="tYT-A8-OjJ">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="1247" name="value" keyPath="values.Preferences.Keyword.notice" id="Bas-rW-YAM"/>
</connections>
</button>
</subviews>
</view>
</tabViewItem>
Expand Down Expand Up @@ -780,7 +791,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" columnReordering="NO" multipleSelection="NO" autosaveColumns="NO" headerView="4272" id="101">
<rect key="frame" x="0.0" y="0.0" width="403" height="178"/>
<rect key="frame" x="0.0" y="0.0" width="403" height="19"/>
<autoresizingMask key="autoresizingMask"/>
<size key="intercellSpacing" width="3" height="2"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
Expand Down Expand Up @@ -1180,4 +1191,4 @@
<image name="NSAddTemplate" width="8" height="8"/>
<image name="NSRemoveTemplate" width="8" height="8"/>
</resources>
</document>
</document>