message.setStatusMessage(statusMsg);
message.setStatusCode(statusType);
invokeMessageListener(message);
}
else if (type.equals(PacketType.ACTION_MESSAGE)) {
ActionMessage message = new ActionMessage();
message.setFrom((String) rawPacket.get("f"));
message.setAction((String) rawPacket.get("msg"));
invokeMessageListener(message);
}
else {
Log.debug("Unsupported buddy message type: " + type);
}
}
else if (rawPacket.containsKey("ka")) {
// Keepalive status packet.
Log.debug("Received keepalive packet.");
}
else if (rawPacket.containsKey("persistr")) {
// Persistent roster packet.
contactManager.parseContactListPacket(rawPacket);
}
else if (rawPacket.containsKey("error")) {
// Error message
ErrorMessage message = new ErrorMessage();
message.setErrorMessage((String) rawPacket.get("errmsg"));
message.setIsFatal(rawPacket.containsKey("fatal"));
invokeMessageListener(message);
}
else {
Log.debug("Unsupported packet type: " + rawPacket);
}