pm.presenceInfoRemoved(pi);
return;
}
if (message instanceof PresenceInfoChangedMessage) {
PresenceInfoChangedMessage m = (PresenceInfoChangedMessage) message;
PresenceInfo pi = pm.getPresenceInfo(m.getCellID());
if (pi == null) {
logger.warning("No presence info found for " + m.getCellID());
return;
}
logger.fine("GOT PresenceInfoChangeMessage for " + pi);
switch (m.getChange()) {
case SPEAKING:
pm.setSpeaking(pi, m.getValue());
break;
case MUTED:
pm.setMute(pi, m.getValue());
break;
case SECRET_CHAT:
pm.setInSecretChat(pi, m.getValue());
break;
case CONE_OF_SILENCE:
pm.setEnteredConeOfSilence(pi, m.getValue());
break;
}
return;
}
if (message instanceof PresenceInfoChangedAliasMessage) {
PresenceInfoChangedAliasMessage m = (PresenceInfoChangedAliasMessage) message;
PresenceInfo pi = pm.getPresenceInfo(m.getCellID());
if (pi == null) {
logger.warning("No presence info found for " + m.getCellID());
return;
}
pm.changeUsernameAlias(pi, m.getAlias());
return;
}
throw new UnsupportedOperationException("Unknown message: " + message);
}