GoogleTalkConfig config = apiClient.getGoogleTalkConfig();
if (config == null) {
return apiRequest.failed("Google Talk configuration was not specified.");
}
JabberFactory factory = new JabberFactory(config.getUserName(), config.getPassword());
if (StringUtils.isNotBlank(config.getRecipientOverride())) {
// This is NOT a "production" request.
factory.sendTo(config.getRecipientOverride(), action.getMessage());
apiMessage = String.format("Request sent to recipient override, %s.", config.getRecipientOverride());
} else {
// This IS a "production" request.
factory.sendTo(action.getRecipient(), action.getMessage());
}
return apiRequest.processed(apiMessage);
}