mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Add updateProfile to Dbus (#522)
* Added updateProfile on Dbus * added updateProfile on Dbus (fix) Co-authored-by: Adimarantis <adimarantis@gmail.com>
This commit is contained in:
parent
129a846cc1
commit
d0ce3c1543
2 changed files with 20 additions and 0 deletions
|
@ -13,6 +13,8 @@ import org.whispersystems.libsignal.util.Pair;
|
|||
import org.whispersystems.signalservice.api.messages.SendMessageResult;
|
||||
import org.whispersystems.signalservice.api.push.SignalServiceAddress;
|
||||
import org.whispersystems.signalservice.api.util.InvalidNumberException;
|
||||
import org.whispersystems.libsignal.util.guava.Optional;
|
||||
import org.asamk.signal.manager.storage.contacts.ContactInfo;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
@ -248,4 +250,20 @@ public class DbusSignalImpl implements Signal {
|
|||
public boolean isRegistered() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProfile(final String name,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(name, about, aboutEmoji, avatarFile);
|
||||
} catch (IOException e) {
|
||||
throw new Error.Failure(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue