Reformat code

This commit is contained in:
AsamK 2021-09-28 18:42:05 +02:00
parent ba817e2ae4
commit 4acab9043c
2 changed files with 8 additions and 3 deletions

View file

@ -102,7 +102,12 @@ public interface Signal extends DBusInterface {
void updateDeviceName(String deviceName) throws Error.Failure; void updateDeviceName(String deviceName) throws Error.Failure;
void updateProfile( void updateProfile(
String givenName, String familyName, String about, String aboutEmoji, String avatarPath, boolean removeAvatar String givenName,
String familyName,
String about,
String aboutEmoji,
String avatarPath,
boolean removeAvatar
) throws Error.Failure; ) throws Error.Failure;
void updateProfile( void updateProfile(

View file

@ -505,14 +505,14 @@ public class DbusSignalImpl implements Signal {
final String aboutEmoji, final String aboutEmoji,
String avatarPath, String avatarPath,
final boolean removeAvatar final boolean removeAvatar
) { ) {
try { try {
if (avatarPath.isEmpty()) { if (avatarPath.isEmpty()) {
avatarPath = null; avatarPath = null;
} }
Optional<File> avatarFile = removeAvatar Optional<File> avatarFile = removeAvatar
? Optional.absent() ? Optional.absent()
: avatarPath == null ? null : Optional.of(new File(avatarPath)); : avatarPath == null ? null : Optional.of(new File(avatarPath));
m.setProfile(givenName, familyName, about, aboutEmoji, avatarFile); m.setProfile(givenName, familyName, about, aboutEmoji, avatarFile);
} catch (IOException e) { } catch (IOException e) {
throw new Error.Failure(e.getMessage()); throw new Error.Failure(e.getMessage());