1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-23 20:42:06 +01:00

Fix rebase errors

This commit is contained in:
Paul Schaub 2017-12-19 14:07:54 +01:00
parent 85171ee71b
commit 0530449e7e
3 changed files with 4 additions and 17 deletions

View file

@ -30,8 +30,6 @@ import org.jivesoftware.smackx.omemo.internal.OmemoDevice;
import org.jivesoftware.smackx.omemo.trust.OmemoFingerprint; import org.jivesoftware.smackx.omemo.trust.OmemoFingerprint;
import org.jivesoftware.smackx.omemo.util.OmemoKeyUtil; import org.jivesoftware.smackx.omemo.util.OmemoKeyUtil;
import org.jxmpp.jid.impl.JidCreate;
import org.jxmpp.stringprep.XmppStringprepException;
import org.whispersystems.libsignal.IdentityKey; import org.whispersystems.libsignal.IdentityKey;
import org.whispersystems.libsignal.IdentityKeyPair; import org.whispersystems.libsignal.IdentityKeyPair;
import org.whispersystems.libsignal.InvalidKeyException; import org.whispersystems.libsignal.InvalidKeyException;
@ -221,16 +219,4 @@ public class SignalOmemoKeyUtil extends OmemoKeyUtil<IdentityKeyPair, IdentityKe
} }
return getFingerprintOfIdentityKey(identityKeyPair.getPublicKey()); return getFingerprintOfIdentityKey(identityKeyPair.getPublicKey());
} }
@Override
public SignalProtocolAddress omemoDeviceAsAddress(OmemoDevice contact) {
return new SignalProtocolAddress(contact.getJid().asBareJid().toString(), contact.getDeviceId());
}
@Override
public OmemoDevice addressAsOmemoDevice(SignalProtocolAddress address)
throws XmppStringprepException
{
return new OmemoDevice(JidCreate.bareFrom(address.getName()), address.getDeviceId());
}
} }

View file

@ -61,7 +61,7 @@ public class OmemoFingerprint implements CharSequence {
public String blocksOf8Chars() { public String blocksOf8Chars() {
StringBuilder pretty = new StringBuilder(); StringBuilder pretty = new StringBuilder();
for (int i = 0; i < 8; i++) { for (int i = 0; i < 8; i++) {
if (i != 0) pretty.append(" "); if (i != 0) pretty.append(' ');
pretty.append(this.fingerprintString.substring(8 * i, 8 * (i + 1))); pretty.append(this.fingerprintString.substring(8 * i, 8 * (i + 1)));
} }
return pretty.toString(); return pretty.toString();

View file

@ -31,6 +31,7 @@ import org.jivesoftware.smackx.omemo.element.OmemoBundleVAxolotlElement;
import org.jivesoftware.smackx.omemo.exceptions.CorruptedOmemoKeyException; import org.jivesoftware.smackx.omemo.exceptions.CorruptedOmemoKeyException;
import org.jivesoftware.smackx.omemo.internal.OmemoDevice; import org.jivesoftware.smackx.omemo.internal.OmemoDevice;
import org.jivesoftware.smackx.omemo.provider.OmemoBundleVAxolotlProvider; import org.jivesoftware.smackx.omemo.provider.OmemoBundleVAxolotlProvider;
import org.jivesoftware.smackx.omemo.trust.OmemoFingerprint;
import org.jivesoftware.smackx.omemo.util.OmemoKeyUtil; import org.jivesoftware.smackx.omemo.util.OmemoKeyUtil;
import org.junit.Test; import org.junit.Test;
@ -127,8 +128,8 @@ extends SmackTestSuite {
@Test @Test
public void testPrettyFingerprint() { public void testPrettyFingerprint() {
String ugly = "FFFFFFFFEEEEEEEEDDDDDDDDCCCCCCCCBBBBBBBBAAAAAAAA9999999988888888"; OmemoFingerprint fingerprint = new OmemoFingerprint("FFFFFFFFEEEEEEEEDDDDDDDDCCCCCCCCBBBBBBBBAAAAAAAA9999999988888888");
String pretty = OmemoKeyUtil.prettyFingerprint(ugly); String pretty = fingerprint.blocksOf8Chars();
assertEquals(pretty, "FFFFFFFF EEEEEEEE DDDDDDDD CCCCCCCC BBBBBBBB AAAAAAAA 99999999 88888888"); assertEquals(pretty, "FFFFFFFF EEEEEEEE DDDDDDDD CCCCCCCC BBBBBBBB AAAAAAAA 99999999 88888888");
} }
} }