}
- (NSNumber *)isConnected {
- // TODO: why does this return a number?!
- /*
- Check whether stream is already open (could be closed because
- server-timeout
+ /*
+ Check whether stream is already open (could be closed due to a server
+ timeout)
*/
- return [NSNumber numberWithBool:
- (self->socket == nil)
- ? NO : [(NGActiveSocket *)self->socket isAlive]];
+ // TODO: why does that return an object?
+ if (self->socket == nil)
+ return [NSNumber numberWithBool:NO];
+
+ return [NSNumber numberWithBool:[(NGActiveSocket *)self->socket isAlive]];
}
- (void)closeConnection {
map = [self processCommand:s
logText:@"AUTHENTICATE \"PLAIN\" {%d+}\r\nLOGIN:PASSWORD\r\n"];
}
- return map ? [self normalizeResponse:map] : nil;
+
+ if (map == nil) {
+ [self logWithFormat:@"ERROR: got no result from command."];
+ return nil;
+ }
+
+ return [self normalizeResponse:map];
}
/* logout from the connected host and close the connection */
}
-/*
- Filter for all responses
+- (NSMutableDictionary *)normalizeResponse:(NGHashMap *)_map {
+ /*
+ Filter for all responses
result : NSNumber (response result)
exists : NSNumber (number of exists mails in selectet folder
recent : NSNumber (number of recent mails in selectet folder
expunge : NSArray (message sequence number of expunged mails
- in selectet folder)
-*/
-
-- (NSMutableDictionary *)normalizeResponse:(NGHashMap *)_map {
+ in selectet folder)
+ */
id keys[3], values[3];
NSParameterAssert(_map != nil);
forKeys:keys count:2];
}
-
- (NSDictionary *)normalizeOpenConnectionResponse:(NGHashMap *)_map {
/* filter for open connection */
NSMutableDictionary *result;