OnBuddyMessage bug in SystemController.m

Post here your questions about the Objective-C API for SFS2X

Moderators: Lapo, Bax

mmilen
Posts: 298
Joined: 09 Nov 2010, 00:48
Contact:

OnBuddyMessage bug in SystemController.m

Postby mmilen » 11 Aug 2011, 14:39

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.
skipper3k
Posts: 20
Joined: 22 Feb 2012, 09:21

Re: OnBuddyMessage bug in SystemController.m

Postby skipper3k » 08 Mar 2012, 12:05

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.
User avatar
A51Integrated
Posts: 240
Joined: 03 Jan 2012, 19:55
Location: Toronto, Canada
Contact:

Re: OnBuddyMessage bug in SystemController.m

Postby A51Integrated » 08 Mar 2012, 19:54

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.
A51 Integrated
http://a51integrated.com / +1 416-703-2300
mmilen
Posts: 298
Joined: 09 Nov 2010, 00:48
Contact:

Re: OnBuddyMessage bug in SystemController.m

Postby mmilen » 08 Mar 2012, 21:52

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 .
User avatar
A51Integrated
Posts: 240
Joined: 03 Jan 2012, 19:55
Location: Toronto, Canada
Contact:

Re: OnBuddyMessage bug in SystemController.m

Postby A51Integrated » 08 Mar 2012, 21:59

With the latest API that's not possible since it's packaged as a framework.
A51 Integrated

http://a51integrated.com / +1 416-703-2300
skipper3k
Posts: 20
Joined: 22 Feb 2012, 09:21

Re: OnBuddyMessage bug in SystemController.m

Postby skipper3k » 09 Mar 2012, 13:29

Thank you. I will work around this issue and wait for the update.
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: OnBuddyMessage bug in SystemController.m

Postby Bax » 26 Mar 2012, 15:14

Bug fixed. You can get the latest version of the API /1.0.3) from the download page.
Paolo Bax
The SmartFoxServer Team

Return to “SFS2X iPhone / iPad / OSX API”

Who is online

Users browsing this forum: No registered users and 23 guests