Page 1 of 1

Bug in PublicMessageRequest validation

Posted: 26 Oct 2011, 14:17
by mmilen
line 57 in GenericMessageRequest.m
-(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]
shows the client not joined, while the server has it right and ROOM isJoined property is also correct, every other message will go out just fine. Replacing this check with

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]

Posted: 01 Nov 2011, 19:54
by Lapo
Thanks for reporting