Skip to content

Commit

Permalink
Convert all IRC* classes (except IRCClient)
Browse files Browse the repository at this point in the history
  • Loading branch information
emsquared committed Jun 10, 2012
1 parent b61fbb5 commit bc3754f
Show file tree
Hide file tree
Showing 40 changed files with 861 additions and 1,104 deletions.
4 changes: 1 addition & 3 deletions Classes/Headers/AGKeychain.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
//

@interface AGKeychain : NSObject

+ (NSString *)getPasswordFromSecKeychainItemRef:(SecKeychainItemRef)item;

+ (BOOL)checkForExistanceOfKeychainItem:(NSString *)keychainItemName
Expand Down Expand Up @@ -40,5 +39,4 @@
forUsername:(NSString *)username
serviceName:(NSString *)service
withLegacySupport:(BOOL)legacy;

@end
@end
20 changes: 1 addition & 19 deletions Classes/Headers/AddressBook.h
Original file line number Diff line number Diff line change
@@ -1,31 +1,13 @@
// Created by Codeux Software <support AT codeux DOT com> <https://github.com/codeux/Textual>
// You can redistribute it and/or modify it under the new BSD license.
// Converted to ARC Support on Thursday, June 09, 2012

typedef enum {
ADDRESS_BOOK_IGNORE_ENTRY,
ADDRESS_BOOK_TRACKING_ENTRY
} AddressBookEntryType;

@interface AddressBook : NSObject
{
NSInteger cid;

AddressBookEntryType entryType;

NSString *hostmask;

BOOL ignorePublicMsg;
BOOL ignorePrivateMsg;
BOOL ignoreHighlights;
BOOL ignoreNotices;
BOOL ignoreCTCP;
BOOL ignoreJPQE;
BOOL notifyJoins;
BOOL ignorePMHighlights;

NSString *hostmaskRegex;
}

@property (nonatomic, assign) NSInteger cid;
@property (nonatomic, strong) NSString *hostmask;
@property (nonatomic, assign) BOOL ignorePublicMsg;
Expand Down
9 changes: 5 additions & 4 deletions Classes/Headers/DDExtensions.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@

@interface NSObject (DDExtensions)
- (id)iomt;
+ (id)iomt;
- (id)invokeOnThread:(NSThread *)thread;
+ (id)invokeOnThread:(NSThread *)thread;
- (id)invokeOnMainThread;
+ (id)invokeOnMainThread;
- (id)invokeInBackgroundThread;
+ (id)invokeInBackgroundThread;
- (id)invokeOnMainThreadAndWaitUntilDone:(BOOL)waitUntilDone;

+ (id)iomt;
+ (id)invokeOnThread:(NSThread *)thread;
+ (id)invokeOnMainThread;
+ (id)invokeInBackgroundThread;
+ (id)invokeOnMainThreadAndWaitUntilDone:(BOOL)waitUntilDone;
@end
40 changes: 10 additions & 30 deletions Classes/Headers/IRCChannel.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Created by Satoshi Nakagawa <psychs AT limechat DOT net> <http://github.com/psychs/limechat>
// Modifications by Codeux Software <support AT codeux DOT com> <https://github.com/codeux/Textual>
// You can redistribute it and/or modify it under the new BSD license.
// Converted to ARC Support on Thursday, June 09, 2012

@class IRCClient;

Expand All @@ -12,34 +13,11 @@ typedef enum {
} ChannelStatus;

@interface IRCChannel : IRCTreeItem
{
IRCClient *__weak client;
IRCChannelMode *mode;
IRCChannelConfig *config;

NSMutableArray *members;

NSString *topic;
NSString *storedTopic;

NSString *logDate;

BOOL isOp;
BOOL isHalfOp;
BOOL isModeInit;
BOOL isActive;
BOOL errLastJoin;

ChannelStatus status;

FileLogger *logFile;
}

@property (nonatomic, weak) IRCClient *client;
@property (nonatomic, readonly) IRCChannelMode *mode;
@property (nonatomic, readonly) IRCChannelConfig *config;
@property (nonatomic, readonly) NSMutableArray *members;
@property (nonatomic, weak, readonly) NSString *channelTypeString;
@property (nonatomic, strong) IRCChannelMode *mode;
@property (nonatomic, strong) IRCChannelConfig *config;
@property (nonatomic, strong) NSMutableArray *members;
@property (nonatomic, weak) NSString *channelTypeString;
@property (nonatomic, strong) NSString *topic;
@property (nonatomic, strong) NSString *storedTopic;
@property (nonatomic, strong) NSString *logDate;
Expand All @@ -49,11 +27,11 @@ typedef enum {
@property (nonatomic, assign) BOOL isActive;
@property (nonatomic, assign) BOOL errLastJoin;
@property (nonatomic, assign) ChannelStatus status;
@property (nonatomic, readonly) BOOL isChannel;
@property (nonatomic, readonly) BOOL isTalk;
@property (nonatomic, assign) BOOL isChannel;
@property (nonatomic, assign) BOOL isTalk;
@property (nonatomic, strong) FileLogger *logFile;
@property (nonatomic, weak) NSString *name;
@property (nonatomic, weak, readonly) NSString *password;
@property (nonatomic, weak) NSString *password;

- (void)setup:(IRCChannelConfig *)seed;
- (void)updateConfig:(IRCChannelConfig *)seed;
Expand Down Expand Up @@ -84,8 +62,10 @@ typedef enum {
- (void)clearMembers;

- (IRCUser *)memberAtIndex:(NSInteger)index;

- (IRCUser *)findMember:(NSString *)nick;
- (IRCUser *)findMember:(NSString *)nick options:(NSStringCompareOptions)mask;

- (NSInteger)indexOfMember:(NSString *)nick;
- (NSInteger)indexOfMember:(NSString *)nick options:(NSStringCompareOptions)mask;

Expand Down
19 changes: 1 addition & 18 deletions Classes/Headers/IRCChannelConfig.h
Original file line number Diff line number Diff line change
@@ -1,30 +1,14 @@
// Created by Satoshi Nakagawa <psychs AT limechat DOT net> <http://github.com/psychs/limechat>
// Modifications by Codeux Software <support AT codeux DOT com> <https://github.com/codeux/Textual>
// You can redistribute it and/or modify it under the new BSD license.
// Converted to ARC Support on Thursday, June 09, 2012

typedef enum {
CHANNEL_TYPE_CHANNEL,
CHANNEL_TYPE_TALK,
} ChannelType;

@interface IRCChannelConfig : NSObject <NSMutableCopying>
{
ChannelType type;

NSString *name;
NSString *password;

BOOL growl;
BOOL autoJoin;
BOOL ihighlights;
BOOL inlineImages;
BOOL iJPQActivity;

NSString *mode;
NSString *topic;
NSString *encryptionKey;
}

@property (nonatomic, assign) ChannelType type;
@property (nonatomic, strong) NSString *name;
@property (nonatomic, strong) NSString *password;
Expand All @@ -39,5 +23,4 @@ typedef enum {

- (id)initWithDictionary:(NSDictionary *)dic;
- (NSMutableDictionary *)dictionaryValue;

@end
12 changes: 3 additions & 9 deletions Classes/Headers/IRCChannelMode.h
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
// Created by Satoshi Nakagawa <psychs AT limechat DOT net> <http://github.com/psychs/limechat>
// Modifications by Codeux Software <support AT codeux DOT com> <https://github.com/codeux/Textual>
// You can redistribute it and/or modify it under the new BSD license.
// Converted to ARC Support on Thursday, June 09, 2012

@class IRCModeInfo;

@interface IRCChannelMode : NSObject <NSMutableCopying>
{
IRCISupportInfo *__weak isupport;

NSMutableArray *allModes;
NSMutableDictionary *modeIndexes;
}

@property (nonatomic, weak) IRCISupportInfo *isupport;
@property (nonatomic, readonly) NSMutableArray *allModes;
@property (nonatomic, readonly) NSMutableDictionary *modeIndexes;
@property (nonatomic, strong) NSMutableArray *allModes;
@property (nonatomic, strong) NSMutableDictionary *modeIndexes;

- (void)clear;

Expand Down
58 changes: 6 additions & 52 deletions Classes/Headers/IRCClientConfig.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Created by Satoshi Nakagawa <psychs AT limechat DOT net> <http://github.com/psychs/limechat>
// Modifications by Codeux Software <support AT codeux DOT com> <https://github.com/codeux/Textual>
// You can redistribute it and/or modify it under the new BSD license.
// Converted to ARC Support on Thursday, June 09, 2012

#define FLOOD_CONTROL_DEFAULT_DELAY_TIMER 2
#define FLOOD_CONTROL_DEFAULT_MESSAGE_COUNT 2
Expand All @@ -15,53 +16,6 @@ typedef enum {
NSComparisonResult channelDataSort(IRCChannel *s1, IRCChannel *s2, void *context);

@interface IRCClientConfig : NSObject <NSMutableCopying>
{
NSInteger cuid;
NSString *guid;
NSString *name;

NSString *host;
NSInteger port;
NSString *server;
NSString *network;

BOOL useSSL;

NSString *nick;
NSString *password;
NSString *username;
NSString *realName;
NSString *nickPassword;
NSMutableArray *altNicks;

ProxyType proxyType;
NSString *proxyHost;
NSInteger proxyPort;
NSString *proxyUser;
NSString *proxyPassword;

BOOL outgoingFloodControl;
NSInteger floodControlMaximumMessages;
NSInteger floodControlDelayTimerInterval;

BOOL autoConnect;
BOOL autoReconnect;
BOOL prefersIPv6;
BOOL bouncerMode;
BOOL invisibleMode;
BOOL isTrustedConnection;

NSStringEncoding encoding;
NSStringEncoding fallbackEncoding;

NSString *leavingComment;
NSString *sleepQuitMessage;

NSMutableArray *loginCommands;
NSMutableArray *channels;
NSMutableArray *ignores;
}

@property (nonatomic, assign) NSInteger cuid;
@property (nonatomic, strong) NSString *guid;
@property (nonatomic, strong) NSString *name;
Expand All @@ -73,7 +27,7 @@ NSComparisonResult channelDataSort(IRCChannel *s1, IRCChannel *s2, void *context
@property (nonatomic, strong) NSString *username;
@property (nonatomic, strong) NSString *realName;
@property (nonatomic, strong) NSString *nickPassword;
@property (nonatomic, readonly) NSMutableArray *altNicks;
@property (nonatomic, strong) NSMutableArray *altNicks;
@property (nonatomic, assign) ProxyType proxyType;
@property (nonatomic, strong) NSString *proxyHost;
@property (nonatomic, assign) NSInteger proxyPort;
Expand All @@ -89,9 +43,9 @@ NSComparisonResult channelDataSort(IRCChannel *s1, IRCChannel *s2, void *context
@property (nonatomic, strong) NSString *leavingComment;
@property (nonatomic, strong) NSString *sleepQuitMessage;
@property (nonatomic, assign) BOOL invisibleMode;
@property (nonatomic, readonly) NSMutableArray *loginCommands;
@property (nonatomic, readonly) NSMutableArray *channels;
@property (nonatomic, readonly) NSMutableArray *ignores;
@property (nonatomic, strong) NSMutableArray *loginCommands;
@property (nonatomic, strong) NSMutableArray *channels;
@property (nonatomic, strong) NSMutableArray *ignores;
@property (nonatomic, strong) NSString *server;
@property (nonatomic, strong) NSString *network;
@property (nonatomic, assign) BOOL outgoingFloodControl;
Expand All @@ -102,4 +56,4 @@ NSComparisonResult channelDataSort(IRCChannel *s1, IRCChannel *s2, void *context
- (NSMutableDictionary *)dictionaryValue;

- (void)destroyKeychains;
@end
@end
30 changes: 1 addition & 29 deletions Classes/Headers/IRCConnection.h
Original file line number Diff line number Diff line change
@@ -1,37 +1,9 @@
// Created by Satoshi Nakagawa <psychs AT limechat DOT net> <http://github.com/psychs/limechat>
// Modifications by Codeux Software <support AT codeux DOT com> <https://github.com/codeux/Textual>
// You can redistribute it and/or modify it under the new BSD license.
// Converted to ARC Support on Thursday, June 09, 2012

@interface IRCConnection : NSObject
{
id __unsafe_unretained delegate;

NSString *host;

NSInteger port;
NSInteger proxyPort;
NSInteger socksVersion;
NSInteger maxMsgCount;

NSStringEncoding encoding;

NSString *proxyHost;
NSString *proxyUser;
NSString *proxyPassword;

TCPClient *conn;

Timer *timer;

BOOL useSystemSocks;
BOOL loggedIn;
BOOL useSocks;
BOOL sending;
BOOL useSSL;

NSMutableArray *sendQueue;
}

@property (nonatomic, unsafe_unretained) id delegate;
@property (nonatomic, strong) Timer *timer;
@property (nonatomic, strong) NSString *host;
Expand Down
5 changes: 1 addition & 4 deletions Classes/Headers/IRCExtras.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
// Created by Codeux Software <support AT codeux DOT com> <https://github.com/codeux/Textual>
// You can redistribute it and/or modify it under the new BSD license.
// Converted to ARC Support on Thursday, June 09, 2012

@class IRCWorld;

@interface IRCExtras : NSObject
{
IRCWorld *__weak world;
}

@property (nonatomic, weak) IRCWorld *world;

- (void)parseIRCProtocolURI:(NSString *)location;
Expand Down
16 changes: 3 additions & 13 deletions Classes/Headers/IRCISupportInfo.h
Original file line number Diff line number Diff line change
@@ -1,27 +1,17 @@
// Created by Satoshi Nakagawa <psychs AT limechat DOT net> <http://github.com/psychs/limechat>
// Modifications by Codeux Software <support AT codeux DOT com> <https://github.com/codeux/Textual>
// You can redistribute it and/or modify it under the new BSD license.
// Converted to ARC Support on Thursday, June 09, 2012

#define MODES_SIZE 52

@interface IRCISupportInfo : NSObject
{
NSInteger nickLen;
NSInteger modesCount;

NSString *networkName;

NSString *userModeQPrefix;
NSString *userModeAPrefix;
NSString *userModeOPrefix;
NSString *userModeHPrefix;
NSString *userModeVPrefix;

unsigned char modes[MODES_SIZE];
}

@property (nonatomic, readonly) NSInteger nickLen;
@property (nonatomic, readonly) NSInteger modesCount;
@property (nonatomic, assign) NSInteger nickLen;
@property (nonatomic, assign) NSInteger modesCount;
@property (nonatomic, strong) NSString *networkName;
@property (nonatomic, strong) NSString *userModeQPrefix;
@property (nonatomic, strong) NSString *userModeAPrefix;
Expand Down
Loading

0 comments on commit bc3754f

Please sign in to comment.