possible error in api?

You think you've found a bug? Please report it here.

Moderators: Lapo, Bax

Post Reply
rikki-tikki
Posts: 4
Joined: 13 Apr 2006, 11:51
Location: Novosibirsk, Russia
Contact:

possible error in api?

Post by rikki-tikki »

now is...

Code: Select all

scope.onObjectReceived(asObj, scope.roomList[fromRoom].userList[senderId] )
may be must be...

Code: Select all

scope.onObjectReceived(asObj, scope.roomList[fromRoom].userList[senderId], fromRoom)
?
patso
Posts: 380
Joined: 13 Nov 2006, 13:44
Location: Sofia, Bulgaria

Re: possible error in api?

Post by patso »

rikki-tikki wrote:now is...

Code: Select all

scope.onObjectReceived(asObj, scope.roomList[fromRoom].userList[senderId] )
may be must be...

Code: Select all

scope.onObjectReceived(asObj, scope.roomList[fromRoom].userList[senderId], fromRoom)
?
I don't know for wich version of the API you talk, but for SFS 5.0 pro AS2 API the situation is:

Code: Select all

Usage:

smartFox.onObjectReceived(obj:Object, sender:User) 

There is no optional fromRoom variable. May be you suggest SFS team to add the optional fromRoom variable in the onObjectReceived. But this is not bug for me.

offtopic: It seams that there is also a some other functions(onModeratorMessage() for example) that use fromRoom, but not passed it to the event handler. btw onModeratorMessage() have second, user id, parametar that is not pointed in the docs.
rikki-tikki
Posts: 4
Joined: 13 Apr 2006, 11:51
Location: Novosibirsk, Russia
Contact:

Re: possible error in api?

Post by rikki-tikki »

I don't know for wich version of the API you talk, but for SFS 5.0 pro AS2 API the situation is:

Code: Select all

Usage:
smartFox.onObjectReceived(obj:Object, sender:User) 
look at class SmartFoxClient, private method handleSysMessages, line 515
where onObjectReceived "event" is fired
patso
Posts: 380
Joined: 13 Nov 2006, 13:44
Location: Sofia, Bulgaria

Post by patso »

I'm looking exacly there. The qoute I give was from the docs. And since it's documented that it fires the onObjectRecieved with two parametars - object and sender, there is no error.
If I understand you correctly you want to add additional parametar - fromRoom. I mean this is more feature request than bug, because nowhere is said that the onObjectRecieved is fired with fromRoom parametar. As I meantion there are also other events where the SFS client class knows the fromRoom parametar and use it to determine the userId, but not fire the event with fromRoom parametar. May be lappo will tell us what is the reason for this.
There is bug and it's in the docs, because some events(as I mention) have userId parametar that is not documented.
Post Reply