2

I am using sleekxmpp to connect to Google Talk. I am trying to track when contacts change their status using the changed_status event. The issue I am having is that as I log a status change, the function associated with the changed_status event seems to be called multiple times. Why might this be?

I am thinking it has something to do with the way that contact is logged into Google Talk, that is they may have it open multiple times from the same computer. So when they close their computer it affects both sessions, and each session triggers a changed_status event.

Jordan
  • 4,928
  • 4
  • 26
  • 39

2 Answers2

5

The answer is that you exposed a bug in SleekXMPP that I need to fix :)

The changed_status event was firing for any presence stanza received, and not firing only when a resource's status or show value changed.

The bug fix is now in the develop branch and it will be in the soon-to-be RC3 release.

0

Check the resource associated with each change. If the resources are all different for the same user, it is because the user is logged on from several different clients, perhaps from multiple different machines. You will get presence updates from all of the user's clients if you're subscribed to them.

Joe Hildebrand
  • 10,354
  • 2
  • 38
  • 48
  • I am logging the full jid each time, which tells me the associated resource (/android.2G29rG or something), in some instances these appear to be the same as well. – Jordan Nov 18 '11 at 15:04