check if pgpengine is still bound before using it
This commit is contained in:
parent
1bc92482e9
commit
09e20f6e01
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue