Permalink
Browse files

added Preferences for autojoin_on_invite.

  • Loading branch information...
walf443 authored and psychs committed May 26, 2010
1 parent b0677bc commit 789787116eea7ffa69884d1b87c5617f78e7cad7
Showing with 17 additions and 7 deletions.
  1. +9 −7 Classes/IRC/IRCClient.m
  2. +1 −0 Classes/Preferences/Preferences.h
  3. +7 −0 Classes/Preferences/Preferences.m
View
@@ -2971,13 +2971,15 @@ - (void)receiveInvite:(IRCMessage*)m
NSString* text = [NSString stringWithFormat:@"%@ has invited you to %@", nick, chname];
[self printBoth:self type:LINE_TYPE_INVITE text:text];
- IRCChannel* c = [self findChannel: chname];
- if ( !c ) {
- IRCChannelConfig* seed = [[IRCChannelConfig new] autorelease];
- seed.name = chname;
- c = [world createChannel:seed client:self reload:YES adjust:YES];
- [world save];
- [self joinChannel: c];
+ if ( [Preferences autoJoinOnInvited] ) {
+ IRCChannel* c = [self findChannel: chname];
+ if ( !c ) {
+ IRCChannelConfig* seed = [[IRCChannelConfig new] autorelease];
+ seed.name = chname;
+ c = [world createChannel:seed client:self reload:YES adjust:YES];
+ [world save];
+ [self joinChannel: c];
+ }
}
[self notifyEvent:GROWL_INVITED target:nil nick:nick text:chname];
@@ -50,6 +50,7 @@ typedef enum {
+ (BOOL)showInlineImages;
+ (BOOL)showJoinLeave;
+ (BOOL)stopGrowlOnActive;
++ (BOOL)autoJoinOnInvited;
+ (TabActionType)tabAction;
+ (BOOL)useHotkey;
+ (BOOL)keywordCurrentNick;
@@ -98,6 +98,13 @@ + (BOOL)stopGrowlOnActive
return [ud boolForKey:@"Preferences.General.stop_growl_on_active"];
}
++ (BOOL)autoJoinOnInvited
+{
+ NSUserDefaults* ud = [NSUserDefaults standardUserDefaults];
+ return [ud boolForKey:@"Preferences.General.auto_join_on_invited"];
+}
+
+
+ (TabActionType)tabAction
{
NSUserDefaults* ud = [NSUserDefaults standardUserDefaults];

0 comments on commit 7897871

Please sign in to comment.