Page 1 of 1

OnBuddyMessage bug in SystemController.m

Posted: 11 Aug 2011, 14:39
by mmilen
There is bug on line 503 in the SystemController.m file that sets the userID to the ID of the message sender. Also on the previous line isItMe is assigned a int value of the senderID rather that a boolean value comparing userID to senderID.

Re: OnBuddyMessage bug in SystemController.m

Posted: 08 Mar 2012, 12:05
by skipper3k
Hi,

I would like to report the same bug. When I'm in -(void)onBuddyMessage:(SFSBuddyEvent *)evt comparing id of the evt.params buddy to the [smartFox.myself id] I get the sam id's even though the sender is not myself.

I am using iOS 1.0.2 API version.

Re: OnBuddyMessage bug in SystemController.m

Posted: 08 Mar 2012, 19:54
by A51Integrated
Just looking at the code, the id that is passed should be that of the buddy, but please ignore your own id at that point. There seems to be a mistake in the API that resets your own id to that of the buddies - so they would equal one another.

To work around this, before your buddy messages are sent (and subsequently received, it's really on the event dispatcher that it happens), save your own user id to a variable. In your onBuddyMessage handler, reset your id back to the variable you saved before sending the message.

We'll work to fix this bug in the next release, but that should allow you to work around the issue for the time being.

Re: OnBuddyMessage bug in SystemController.m

Posted: 08 Mar 2012, 21:52
by mmilen
Fixing the code of the API it self was simple, you can fix it for your self. Just debug / rack the handling of the message and you will see the line that messes up the ID's .

Re: OnBuddyMessage bug in SystemController.m

Posted: 08 Mar 2012, 21:59
by A51Integrated
With the latest API that's not possible since it's packaged as a framework.

Re: OnBuddyMessage bug in SystemController.m

Posted: 09 Mar 2012, 13:29
by skipper3k
Thank you. I will work around this issue and wait for the update.

Re: OnBuddyMessage bug in SystemController.m

Posted: 26 Mar 2012, 15:14
by Bax
Bug fixed. You can get the latest version of the API /1.0.3) from the download page.