mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-30 12:42:16 -05:00
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());
|
packet.setFrom(account.getJid());
|
||||||
String sig = account.getPgpSignature();
|
String sig = account.getPgpSignature();
|
||||||
if (sig != null) {
|
if (sig != null && mXmppConnectionService.getPgpEngine() != null) {
|
||||||
packet.addChild("x", "jabber:x:signed").setContent(sig);
|
packet.addChild("x", "jabber:x:signed").setContent(sig);
|
||||||
}
|
}
|
||||||
String capHash = getCapHash();
|
String capHash = getCapHash();
|
||||||
|
@ -118,7 +118,7 @@ public class SetPresenceActivity extends XmppActivity implements View.OnClickLis
|
|||||||
xmppConnectionService.changeStatus(status, statusMessage);
|
xmppConnectionService.changeStatus(status, statusMessage);
|
||||||
finish();
|
finish();
|
||||||
} else if (mAccount != null) {
|
} else if (mAccount != null) {
|
||||||
if (mAccount.getPgpId() == 0) {
|
if (mAccount.getPgpId() == 0 && hasPgp()) {
|
||||||
xmppConnectionService.changeStatus(mAccount, status, statusMessage, true);
|
xmppConnectionService.changeStatus(mAccount, status, statusMessage, true);
|
||||||
finish();
|
finish();
|
||||||
} else {
|
} else {
|
||||||
|
@ -540,6 +540,9 @@ public abstract class XmppActivity extends Activity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected boolean noAccountUsesPgp() {
|
protected boolean noAccountUsesPgp() {
|
||||||
|
if (!hasPgp()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
for(Account account : xmppConnectionService.getAccounts()) {
|
for(Account account : xmppConnectionService.getAccounts()) {
|
||||||
if (account.getPgpId() != 0) {
|
if (account.getPgpId() != 0) {
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user