From 03d96266f8bbb76e25610e903d74a0afa7dcd03b Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 28 Feb 2014 03:22:05 +0100 Subject: fixed a small graphic glitch --- .../chat/services/XmppConnectionService.java | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src/de/gultsch/chat/services') diff --git a/src/de/gultsch/chat/services/XmppConnectionService.java b/src/de/gultsch/chat/services/XmppConnectionService.java index 4e75f7aa..7ff09957 100644 --- a/src/de/gultsch/chat/services/XmppConnectionService.java +++ b/src/de/gultsch/chat/services/XmppConnectionService.java @@ -210,16 +210,18 @@ public class XmppConnectionService extends Service { } else if (show.getContent().equals("dnd")) { contact.updatePresence(fromParts[1], Presences.DND); } - Element x = packet.findChild("x"); - if ((x != null) - && (x.getAttribute("xmlns").equals("jabber:x:signed"))) { - try { - Log.d(LOGTAG,"pgp signature for contact" +packet.getAttribute("from")); - contact.setPgpKeyId(getPgpEngine().fetchKeyId(packet.findChild("status") - .getContent(), x.getContent())); - databaseBackend.updateContact(contact); - } catch (OpenPgpException e) { - Log.d(LOGTAG,"faulty pgp. just ignore"); + PgpEngine pgp = getPgpEngine(); + if (pgp!=null) { + Element x = packet.findChild("x"); + if ((x != null) + && (x.getAttribute("xmlns").equals("jabber:x:signed"))) { + try { + Log.d(LOGTAG,"pgp signature for contact" +packet.getAttribute("from")); + contact.setPgpKeyId(pgp.fetchKeyId(packet.findChild("status") + .getContent(), x.getContent())); + } catch (OpenPgpException e) { + Log.d(LOGTAG,"faulty pgp. just ignore"); + } } } databaseBackend.updateContact(contact); -- cgit v1.2.3