mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Implement Dbus updateProfile with givenName (#734)
two versions of updateProfile implemented: - one with givenName and familyName - one with just name update documentation
This commit is contained in:
parent
375c9d60cf
commit
ba817e2ae4
3 changed files with 32 additions and 3 deletions
|
@ -101,6 +101,10 @@ public interface Signal extends DBusInterface {
|
|||
|
||||
void updateDeviceName(String deviceName) throws Error.Failure;
|
||||
|
||||
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;
|
||||
|
|
|
@ -497,6 +497,28 @@ public class DbusSignalImpl implements Signal {
|
|||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue