Skip to content

Commit

Permalink
ContactList hide error when trying to get last activity from a server…
Browse files Browse the repository at this point in the history
… that doesn't support it yet

Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
  • Loading branch information
stokito committed Aug 15, 2024
1 parent 50c54bf commit ff9fb92
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@

import org.jivesoftware.resource.Res;
import org.jivesoftware.resource.SparkRes;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.packet.Presence;
import org.jivesoftware.smack.packet.StanzaError.Condition;
import org.jivesoftware.smackx.vcardtemp.packet.VCard;
import org.jivesoftware.smackx.iqlast.packet.LastActivity;
import org.jivesoftware.smackx.iqlast.LastActivityManager;
Expand Down Expand Up @@ -261,9 +263,14 @@ public void customizeUI(ContactItem contactItem) {
status += Res.getString("message.idle.for", time);
}
}
} catch (Exception e1) {
Log.warning( "Unable to get Last Activity from: " + contactItem.toString(), e1 );
}
} catch (XMPPException.XMPPErrorException e) {
Condition condition = e.getStanzaError().getCondition();
if (condition != Condition.feature_not_implemented && condition != Condition.service_unavailable) {
Log.warning("Unable to get Last Activity from: " + contactItem, e);
}
} catch (Exception e) {
Log.warning("Unable to get Last Activity from: " + contactItem, e);
}
}
statusLabel.setText(status);

Expand Down

0 comments on commit ff9fb92

Please sign in to comment.