mirror of
https://github.com/aljazceru/signal-cli.git
synced 2026-01-27 17:44:20 +01:00
Extend updateProfile command to set family name
This commit is contained in:
@@ -354,18 +354,22 @@ public class Manager implements Closeable {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param name if null, the previous name will be kept
|
||||
* @param givenName if null, the previous givenName will be kept
|
||||
* @param familyName if null, the previous familyName will be kept
|
||||
* @param about if null, the previous about text will be kept
|
||||
* @param aboutEmoji if null, the previous about emoji will be kept
|
||||
* @param avatar if avatar is null the image from the local avatar store is used (if present),
|
||||
* if it's Optional.absent(), the avatar will be removed
|
||||
*/
|
||||
public void setProfile(String name, String about, String aboutEmoji, Optional<File> avatar) throws IOException {
|
||||
public void setProfile(
|
||||
String givenName, final String familyName, String about, String aboutEmoji, Optional<File> avatar
|
||||
) throws IOException {
|
||||
var profile = getRecipientProfile(account.getSelfRecipientId());
|
||||
var builder = profile == null ? Profile.newBuilder() : Profile.newBuilder(profile);
|
||||
if (name != null) {
|
||||
builder.withGivenName(name);
|
||||
builder.withFamilyName(null);
|
||||
if (givenName != null) {
|
||||
builder.withGivenName(givenName);
|
||||
}
|
||||
if (familyName != null) {
|
||||
builder.withFamilyName(familyName);
|
||||
}
|
||||
if (about != null) {
|
||||
builder.withAbout(about);
|
||||
|
||||
@@ -162,7 +162,7 @@ public class RegistrationManager implements Closeable {
|
||||
|
||||
m.refreshPreKeys();
|
||||
// Set an initial empty profile so user can be added to groups
|
||||
m.setProfile(null, null, null, null);
|
||||
m.setProfile(null, null, null, null, null);
|
||||
|
||||
final var result = m;
|
||||
m = null;
|
||||
|
||||
Reference in New Issue
Block a user