@Override
public Presence getPresence(JID jabberId, JID fromJid) {
checkArgument(jabberId != null, "Jabber ID cannot be null");
PresenceRequest request = new PresenceRequest();
request.setJid(jabberId.getId());
if (fromJid != null) {
request.setFromJid(fromJid.getId());
}
byte[] responseBytes;
try {
responseBytes = ApiProxy.makeSyncCall(PACKAGE, "GetPresence", request.toByteArray());
} catch (ApiProxy.ApplicationException ex) {
switch (XmppServiceError.ErrorCode.valueOf(ex.getApplicationError())) {
case INVALID_JID:
throw new IllegalArgumentException("Invalid jabber ID: " + jabberId);
case NO_BODY: