1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-22 20:12:07 +01:00

Improve readability by fixing wrong indentation levels

This commit is contained in:
Paul Schaub 2020-01-06 20:01:04 +01:00
parent 6d0bf04c1e
commit 48d5ef9522
4 changed files with 21 additions and 21 deletions

View file

@ -316,9 +316,9 @@ public final class OmemoManager extends Manager {
throws CryptoFailedException, UndecidedOmemoIdentityException, throws CryptoFailedException, UndecidedOmemoIdentityException,
InterruptedException, SmackException.NotConnectedException, InterruptedException, SmackException.NotConnectedException,
SmackException.NoResponseException, SmackException.NotLoggedInException, IOException { SmackException.NoResponseException, SmackException.NotLoggedInException, IOException {
Set<BareJid> recipients = new HashSet<>(); Set<BareJid> recipients = new HashSet<>();
recipients.add(recipient); recipients.add(recipient);
return encrypt(recipients, message); return encrypt(recipients, message);
} }
/** /**
@ -506,8 +506,8 @@ public final class OmemoManager extends Manager {
CryptoFailedException, CannotEstablishOmemoSessionException, IOException { CryptoFailedException, CannotEstablishOmemoSessionException, IOException {
XMPPConnection connection = connection(); XMPPConnection connection = connection();
MessageBuilder message = connection.getStanzaFactory() MessageBuilder message = connection.getStanzaFactory()
.buildMessageStanza() .buildMessageStanza()
.to(recipient.getJid()); .to(recipient.getJid());
OmemoElement element = getOmemoService().createRatchetUpdateElement(new LoggedInOmemoManager(this), recipient); OmemoElement element = getOmemoService().createRatchetUpdateElement(new LoggedInOmemoManager(this), recipient);
message.addExtension(element); message.addExtension(element);
@ -751,8 +751,8 @@ public final class OmemoManager extends Manager {
*/ */
public synchronized void rotateSignedPreKey() public synchronized void rotateSignedPreKey()
throws CorruptedOmemoKeyException, SmackException.NotLoggedInException, XMPPException.XMPPErrorException, throws CorruptedOmemoKeyException, SmackException.NotLoggedInException, XMPPException.XMPPErrorException,
SmackException.NotConnectedException, InterruptedException, SmackException.NoResponseException, SmackException.NotConnectedException, InterruptedException, SmackException.NoResponseException,
IOException, PubSubException.NotALeafNodeException { IOException, PubSubException.NotALeafNodeException {
if (!connection().isAuthenticated()) { if (!connection().isAuthenticated()) {
throw new SmackException.NotLoggedInException(); throw new SmackException.NotLoggedInException();
} }
@ -1037,7 +1037,7 @@ public final class OmemoManager extends Manager {
OmemoDeviceListElement receivedDeviceList = (OmemoDeviceListElement) payloadItem.getPayload(); OmemoDeviceListElement receivedDeviceList = (OmemoDeviceListElement) payloadItem.getPayload();
try { try {
getOmemoService().getOmemoStoreBackend().mergeCachedDeviceList(getOwnDevice(), from, getOmemoService().getOmemoStoreBackend().mergeCachedDeviceList(getOwnDevice(), from,
receivedDeviceList); receivedDeviceList);
if (!from.asBareJid().equals(getOwnJid())) { if (!from.asBareJid().equals(getOwnJid())) {
continue; continue;
@ -1046,8 +1046,8 @@ public final class OmemoManager extends Manager {
deviceList = getOmemoService().cleanUpDeviceList(getOwnDevice()); deviceList = getOmemoService().cleanUpDeviceList(getOwnDevice());
} catch (IOException e) { } catch (IOException e) {
LOGGER.log(Level.SEVERE, LOGGER.log(Level.SEVERE,
"IOException while processing OMEMO PEP device updates. Message: " + message, "IOException while processing OMEMO PEP device updates. Message: " + message,
e); e);
continue; continue;
} }
final OmemoDeviceListElement_VAxolotl newDeviceList = new OmemoDeviceListElement_VAxolotl(deviceList); final OmemoDeviceListElement_VAxolotl newDeviceList = new OmemoDeviceListElement_VAxolotl(deviceList);

View file

@ -1141,8 +1141,8 @@ public abstract class OmemoService<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
OmemoBundleElement bundleElement = getOmemoStoreBackend().packOmemoBundle(userDevice); OmemoBundleElement bundleElement = getOmemoStoreBackend().packOmemoBundle(userDevice);
publishBundle(manager.getConnection(), userDevice, bundleElement); publishBundle(manager.getConnection(), userDevice, bundleElement);
} catch (CorruptedOmemoKeyException | InterruptedException | SmackException.NoResponseException } catch (CorruptedOmemoKeyException | InterruptedException | SmackException.NoResponseException
| SmackException.NotConnectedException | XMPPException.XMPPErrorException | SmackException.NotConnectedException | XMPPException.XMPPErrorException
| NotALeafNodeException e) { | NotALeafNodeException e) {
LOGGER.log(Level.WARNING, "Could not republish replenished bundle.", e); LOGGER.log(Level.WARNING, "Could not republish replenished bundle.", e);
} }
} }
@ -1224,8 +1224,8 @@ public abstract class OmemoService<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
OmemoBundleElement bundleElement = getOmemoStoreBackend().packOmemoBundle(userDevice); OmemoBundleElement bundleElement = getOmemoStoreBackend().packOmemoBundle(userDevice);
publishBundle(manager.getConnection(), userDevice, bundleElement); publishBundle(manager.getConnection(), userDevice, bundleElement);
} catch (CorruptedOmemoKeyException | InterruptedException | SmackException.NoResponseException } catch (CorruptedOmemoKeyException | InterruptedException | SmackException.NoResponseException
| SmackException.NotConnectedException | XMPPException.XMPPErrorException | SmackException.NotConnectedException | XMPPException.XMPPErrorException
| NotALeafNodeException e) { | NotALeafNodeException e) {
LOGGER.log(Level.WARNING, "Could not republish replenished bundle.", e); LOGGER.log(Level.WARNING, "Could not republish replenished bundle.", e);
} }
} }
@ -1307,8 +1307,8 @@ public abstract class OmemoService<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
OmemoBundleElement bundleElement = getOmemoStoreBackend().packOmemoBundle(userDevice); OmemoBundleElement bundleElement = getOmemoStoreBackend().packOmemoBundle(userDevice);
publishBundle(manager.getConnection(), userDevice, bundleElement); publishBundle(manager.getConnection(), userDevice, bundleElement);
} catch (CorruptedOmemoKeyException | InterruptedException | SmackException.NoResponseException } catch (CorruptedOmemoKeyException | InterruptedException | SmackException.NoResponseException
| SmackException.NotConnectedException | XMPPException.XMPPErrorException | SmackException.NotConnectedException | XMPPException.XMPPErrorException
| NotALeafNodeException e) { | NotALeafNodeException e) {
LOGGER.log(Level.WARNING, "Could not republish replenished bundle.", e); LOGGER.log(Level.WARNING, "Could not republish replenished bundle.", e);
} }
} }

View file

@ -216,9 +216,9 @@ public abstract class OmemoBundleElement implements ExtensionElement {
.append(IDENTITY_KEY).append(": ").append(identityKeyB64).append('\n') .append(IDENTITY_KEY).append(": ").append(identityKeyB64).append('\n')
.append(PRE_KEYS).append(" (").append(preKeysB64.size()).append(")\n"); .append(PRE_KEYS).append(" (").append(preKeysB64.size()).append(")\n");
for (Map.Entry<Integer, String> e : preKeysB64.entrySet()) { for (Map.Entry<Integer, String> e : preKeysB64.entrySet()) {
sb.append(PRE_KEY_PUB).append(' ').append(PRE_KEY_ID).append("=").append(e.getKey()).append(": ").append(e.getValue()).append("\n"); sb.append(PRE_KEY_PUB).append(' ').append(PRE_KEY_ID).append('=').append(e.getKey()).append(": ").append(e.getValue()).append('\n');
} }
sb.append("]"); sb.append(']');
return sb.toString(); return sb.toString();
} }

View file

@ -152,8 +152,8 @@ public class OmemoMessageBuilder<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
* @throws IllegalBlockSizeException if the input data length is incorrect. * @throws IllegalBlockSizeException if the input data length is incorrect.
*/ */
private void setMessage(String message) private void setMessage(String message)
throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidAlgorithmParameterException,
InvalidKeyException, BadPaddingException, IllegalBlockSizeException { InvalidKeyException, BadPaddingException, IllegalBlockSizeException {
if (message == null) { if (message == null) {
return; return;
} }
@ -199,7 +199,7 @@ public class OmemoMessageBuilder<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
if (cipherTextWithoutAuthTag.length != cipherText.length - 16) { if (cipherTextWithoutAuthTag.length != cipherText.length - 16) {
throw new IllegalArgumentException("Length of cipherTextWithoutAuthTag must be length of cipherText " + throw new IllegalArgumentException("Length of cipherTextWithoutAuthTag must be length of cipherText " +
"- length of AuthTag (16)"); "- length of AuthTag (16)");
} }
// Move auth tag from cipherText to messageKey // Move auth tag from cipherText to messageKey