-(void)validatePublicMessage:(SmartFoxiPhoneClient *)sfs errors:(NSMutableArray *)errors {
if(_message == nil || [_message length] == 0) {
[errors addObject:@"Public message is empty!"];
}
if (_room != nil && ![sfs.mySelf isJoinedInRoom:_room]) {
[errors addObject:[NSString stringWithFormat:@"You are not joined in the target Room: %@", _room]];
}
}
[/code]
in some circumstances
Code: Select all
[sfs.mySelf isJoinedInRoom:_room]
Code: Select all
[_room isJoined]
fixes the problem and it is much faster, as it checks single boolean value vs going through isJoinedInRoom , which involves search in array.[/code]