implement Dbus updateProfile with givenName

two versions of updateProfile implemented:
- one with givenName and familyName
- one with just name

update documentation
This commit is contained in:
John Freed 2021-09-22 07:59:14 +02:00
parent 982e887c9f
commit 766a51c78a
3 changed files with 32 additions and 3 deletions

View file

@ -83,6 +83,10 @@ public interface Signal extends DBusInterface {
boolean isRegistered();
void updateProfile(
String givenName, String familyName, String about, String aboutEmoji, String avatarPath, boolean removeAvatar
) throws Error.Failure;
void updateProfile(
String name, String about, String aboutEmoji, String avatarPath, boolean removeAvatar
) throws Error.Failure;

View file

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