Changeset 3592
- Timestamp:
- 03/01/07 11:03:48 (2 years ago)
- Files:
-
- trunk/Chat Core/MVICBChatConnection.m (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Chat Core/MVICBChatConnection.m
r3591 r3592 50 50 #import "NSNotificationAdditions.h" 51 51 52 #pragma mark Prototypes for auxiliary functions 53 54 static BOOL hasSubstring( NSString *str, NSString *substr, NSRange *r ); 55 56 #pragma mark Bodies for auxiliary functions 57 58 /* 59 * Takes a string and a substring within it and returns a boolean 60 * indicating whether the latter was found inside the former. 61 * If found, the given range is updated accordingly. 62 * 63 * The whole point of this function is to ease the usage of NSString's 64 * rangeOfString in conditions. 65 */ 66 static BOOL hasSubstring( NSString *str, NSString *substr, NSRange *r ) { 67 *r = [str rangeOfString:substr]; 68 return r->location != NSNotFound; 69 } 70 71 #pragma mark - 72 52 73 @interface MVICBChatConnection (MVICBChatConnectionPrivate) 53 74 - (void) _connect; … … 823 844 824 845 NSString *message = [fields objectAtIndex:0]; 846 NSRange r; 825 847 826 848 if( [message compare:@"Open messages not permitted in quiet groups."] == 0 ) { … … 846 868 } 847 869 } else if( [message compare:@"You aren't the moderator."] == 0 ) { 870 // XXX 871 } else if( hasSubstring( message, @" is not in the database.", &r ) ) { 848 872 // XXX 849 873 } else
