diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-10-29 13:41:08 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2015-10-29 13:41:08 +0100 |
commit | c7ff196f58b5576ca1aeb5fd6d51bbe500754f06 (patch) | |
tree | 281e1c922d70d6a85a098f403448965a861f8ab1 /src/main/java/eu/siacs/conversations/services/XmppConnectionService.java | |
parent | 7410e2023adb2c4535e3301637fa0ecc61e7187c (diff) |
push CN into nick pep node when uploading certificate. subscribe to nick node
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/services/XmppConnectionService.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index cc8f4784..ba235a38 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -1331,6 +1331,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa Account account = new Account(info.first, ""); account.setPrivateKeyAlias(alias); account.setOption(Account.OPTION_DISABLED, true); + account.setDisplayName(info.second); createAccount(account); callback.onAccountCreated(account); if (Config.X509_VERIFICATION) { @@ -1359,6 +1360,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa Pair<Jid, String> info = CryptoHelper.extractJidAndName(chain[0]); if (account.getJid().toBareJid().equals(info.first)) { account.setPrivateKeyAlias(alias); + account.setDisplayName(info.second); databaseBackend.updateAccount(account); if (Config.X509_VERIFICATION) { try { @@ -2871,6 +2873,21 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa } } + public void publishDisplayName(Account account) { + String displayName = account.getDisplayName(); + if (displayName != null && !displayName.isEmpty()) { + IqPacket publish = mIqGenerator.publishNick(displayName); + sendIqPacket(account, publish, new OnIqPacketReceived() { + @Override + public void onIqPacketReceived(Account account, IqPacket packet) { + if (packet.getType() == IqPacket.TYPE.ERROR) { + Log.d(Config.LOGTAG,account.getJid().toBareJid()+": could not publish nick"); + } + } + }); + } + } + public interface OnAccountCreated { void onAccountCreated(Account account); |