mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Add commands to update profile name and avatar
Two new commands are added `setProfileName` and `setProfileAvatar` which allow to update the name and avatar visible by other users for the current profiles. Closes #227
This commit is contained in:
parent
c53bb132eb
commit
abb6ebc910
6 changed files with 113 additions and 0 deletions
|
@ -54,6 +54,7 @@ import org.whispersystems.signalservice.api.push.exceptions.NetworkFailureExcept
|
|||
import org.whispersystems.signalservice.api.push.exceptions.UnregisteredUserException;
|
||||
import org.whispersystems.signalservice.api.util.InvalidNumberException;
|
||||
import org.whispersystems.signalservice.api.util.SleepTimer;
|
||||
import org.whispersystems.signalservice.api.util.StreamDetails;
|
||||
import org.whispersystems.signalservice.api.util.UptimeSleepTimer;
|
||||
import org.whispersystems.signalservice.internal.push.SignalServiceProtos;
|
||||
import org.whispersystems.signalservice.internal.push.UnsupportedDataMessageException;
|
||||
|
@ -204,6 +205,14 @@ public class Manager implements Signal {
|
|||
accountManager.setAccountAttributes(account.getSignalingKey(), account.getSignalProtocolStore().getLocalRegistrationId(), true, account.getRegistrationLockPin(), getSelfUnidentifiedAccessKey(), false);
|
||||
}
|
||||
|
||||
public void setProfileName(String name) throws IOException {
|
||||
accountManager.setProfileName(account.getProfileKey(), name);
|
||||
}
|
||||
|
||||
public void setProfileAvatar(File avatar) throws IOException {
|
||||
accountManager.setProfileAvatar(account.getProfileKey(), Utils.createStreamDetailsFromFile(avatar));
|
||||
}
|
||||
|
||||
public void unregister() throws IOException {
|
||||
// When setting an empty GCM id, the Signal-Server also sets the fetchesMessages property to false.
|
||||
// If this is the master device, other users can't send messages to this number anymore.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue