aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-05-12 11:30:44 +0200
committerDaniel Gultsch <daniel@gultsch.de>2016-05-12 11:30:53 +0200
commit09e20f6e01f53ff1d4c038a5ff0cbd3d7868130a (patch)
tree45caf8314143ec4dd9bfc7aa520322a07e0c9b0b /src/main/java/eu
parent1bc92482e947abde8a9660baed57b463cd55f403 (diff)
check if pgpengine is still bound before using it
Diffstat (limited to 'src/main/java/eu')
-rw-r--r--src/main/java/eu/siacs/conversations/generator/PresenceGenerator.java2
-rw-r--r--src/main/java/eu/siacs/conversations/ui/SetPresenceActivity.java2
-rw-r--r--src/main/java/eu/siacs/conversations/ui/XmppActivity.java3
3 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/eu/siacs/conversations/generator/PresenceGenerator.java b/src/main/java/eu/siacs/conversations/generator/PresenceGenerator.java
index 093a8963f..f9fed9140 100644
--- a/src/main/java/eu/siacs/conversations/generator/PresenceGenerator.java
+++ b/src/main/java/eu/siacs/conversations/generator/PresenceGenerator.java
@@ -44,7 +44,7 @@ public class PresenceGenerator extends AbstractGenerator {
}
packet.setFrom(account.getJid());
String sig = account.getPgpSignature();
- if (sig != null) {
+ if (sig != null && mXmppConnectionService.getPgpEngine() != null) {
packet.addChild("x", "jabber:x:signed").setContent(sig);
}
String capHash = getCapHash();
diff --git a/src/main/java/eu/siacs/conversations/ui/SetPresenceActivity.java b/src/main/java/eu/siacs/conversations/ui/SetPresenceActivity.java
index effd30bf5..6d13e7eac 100644
--- a/src/main/java/eu/siacs/conversations/ui/SetPresenceActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/SetPresenceActivity.java
@@ -118,7 +118,7 @@ public class SetPresenceActivity extends XmppActivity implements View.OnClickLis
xmppConnectionService.changeStatus(status, statusMessage);
finish();
} else if (mAccount != null) {
- if (mAccount.getPgpId() == 0) {
+ if (mAccount.getPgpId() == 0 && hasPgp()) {
xmppConnectionService.changeStatus(mAccount, status, statusMessage, true);
finish();
} else {
diff --git a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java
index b58fa6c23..5ce74824a 100644
--- a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java
@@ -540,6 +540,9 @@ public abstract class XmppActivity extends Activity {
}
protected boolean noAccountUsesPgp() {
+ if (!hasPgp()) {
+ return true;
+ }
for(Account account : xmppConnectionService.getAccounts()) {
if (account.getPgpId() != 0) {
return false;