Change summary
src/main/java/eu/siacs/conversations/generator/PresenceGenerator.java | 2
src/main/java/eu/siacs/conversations/ui/SetPresenceActivity.java | 2
src/main/java/eu/siacs/conversations/ui/XmppActivity.java | 3
3 files changed, 5 insertions(+), 2 deletions(-)
Detailed changes
@@ -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();
@@ -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 {
@@ -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;