How to identify idle users

Hi all,

Made the Jabber based chat client with SMACK API in java swings , how to capture the idle system when the user out for break or tea, I’ve seen in spark same has been captured. Please advise to achieve in my chat client.

Thanks in advance.