Handling RosterListener. presenceChanged

I’m curious to see what other people do when a presenceChanged is fired.

My initial (current) idea was to re-create the friends list of my application for every presence change.

This works well for fewer friends or services that people generally leave running.

e.g. People generally leave Google Talk (via mobile, gmail, or desktop client) and Windows Live Messenger constantly on.

However it doesn’t work well for Facebook since the average friend count is really high and people on Facebook open/close Facebook all the time. Therefore my friends list is in a nearly constant refresh state.

Another idea is to completely drop presenceChanged handling and have a thread to update the friends list, with a wait such that the friends list is only updated after a certain amount of time.

Yet another idea is to count presence changes and update the friends list after a threshhold. i.e. after 10 presence changes, update friends list and reset counter to 0.

I was also thinking of updating an individual entry on the friends list upon presence change but this it seems like that would require a complete overhaul of my code

Thoughts?