mirror of
https://github.com/AsamK/signal-cli
synced 2025-09-02 12:30:39 +00:00
Added updateProfile on Dbus
This commit is contained in:
parent
129a846cc1
commit
152fc27c74
2 changed files with 15 additions and 0 deletions
|
@ -51,6 +51,8 @@ public interface Signal extends DBusInterface {
|
|||
|
||||
boolean isRegistered();
|
||||
|
||||
void updateProfile(String name,String about,String aboutEmoji,String avatarPath,boolean removeAvatar) throws Error.Failure;
|
||||
|
||||
class MessageReceived extends DBusSignal {
|
||||
|
||||
private final long timestamp;
|
||||
|
|
|
@ -13,6 +13,7 @@ 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 java.io.File;
|
||||
import java.io.IOException;
|
||||
|
@ -248,4 +249,16 @@ public class DbusSignalImpl implements Signal {
|
|||
public boolean isRegistered() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProfile(final String name,final String about,final String aboutEmoji, final String avatarPath, final boolean removeAvatar) {
|
||||
try {
|
||||
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