This is a question pertaining to the most basic of chat programs, nothing fancy or odd in behaviour.
I’‘m wondering what the Roster should display, depending on the Presence.Type(s). For example, I’‘ve noticed that when I send out a SUBSCRIBE, a RosterEntry is added to my Roster (but unfiled). I’'ve created a PacketListener for the SUBSCRIBED packet which then calls addEntry() and connects the RosterEntry to the appropriate RosterGroup. However, this initial unfiled RosterEntry – should it even appear on my roster display gui?
As a work-around, I guess I could just assume that any unfiled RosterEntry’‘s are not yet SUBSCRIBED and so I can ignore the unfiled RosterEntry’‘s altogether. However, this would also prevent me from creating any SUBSCRIBED RosterEntry’‘s that also do not have a particular RosterGroup. In other words, is it appropriate to force all SUBSCRIBED RosterEntry’'s into a (even if arbitrary) RosterGroup?
I’‘ve also noticed that when someone sends me a SUBSCRIBE request, even before I can respond (accept/denial), their RosterEntry has already been added to my Roster, and therefore displays on my roster display gui as an unfiled RosterEntry. I can see these unfiled RosterEntry’'s from random SUBSCRIBE requests getting rather numerous, quickly, and sometimes, I may not even want them! Are they automatically purged at some point, or do I have to manually call removeEntry() for each to get them out of my Roster?
Another aspect of this issue is the denial of SUBSCRIBE requests – if I don’‘t want someone to SUBSCRIBE to my presence, what should the denial response packet’'s Presence.Type (if any) be? Should it be an UNSUBSCRIBE? Or just ignore the initial SUBSCRIBE request and never send a SUBSCRIBED? Maybe send an ERROR?
Moving on to UNSUBSCRIBE – is it appropriate to expect a RosterEntry to be online to reply to an UNSUBSCRIBE request with an UNSUBSCRIBED reply before calling removeEntry() to remove the RosterEntry from the Roster? Or should removeEntry() be called first, then an UNSUBCRIBE packet be sent, just in case, but to no real consequence whether a reply is received?
Sorry for the berth of questions – if no direct answers can be provided here, is there documentation elsewhere that would provide such answers?
Message was edited by: