Responding to UNSUBSCRIBE presence

Hi

Using exodus, when I remove a roster entry, it sends a UNSUBSCRIBE presence type. Looking at Roster.java, it does not seem to handle this event. I am currently handling it like this (goal is to remove the roster entry and response):

} else if (presence.getType() == Presence.Type.UNSUBSCRIBE) {

if (presenceMap.get(key) != null) {

Map userPresences = (Map) presenceMap.get(key);

userPresences.remove(StringUtils.parseResource(from));

if (userPresences.isEmpty()) {

presenceMap.remove(key);

}

}

// If the user is in the roster, remove it and fire an event.

synchronized (entries) {

for (Iterator i=entries.iterator(); i.hasNext(); ) {

RosterEntry entry = (RosterEntry)i.next();

if (entry.getUser().equals(key)) {

removeEntry(entry);

}

}

}

// Respond unsubscribe with unsubscribed

Presence response = new Presence(Presence.Type.UNSUBSCRIBED);

response.setTo(presence.getFrom());

connection.sendPacket(response);

}

It works, but I would like to know if I am doing it correctly.

Thanks

Keith