- public void setProfile(String name, Optional<File> avatar) throws IOException {
- // TODO
- String about = null;
- String aboutEmoji = null;
+ public void setProfile(String name, String about, String aboutEmoji, Optional<File> avatar) throws IOException {
+ SignalProfileEntry profileEntry = account.getProfileStore().getProfileEntry(getSelfAddress());
+ SignalProfile profile = profileEntry == null ? null : profileEntry.getProfile();
+ SignalProfile newProfile = new SignalProfile(profile == null ? null : profile.getIdentityKey(),
+ name != null ? name : profile == null || profile.getName() == null ? "" : profile.getName(),
+ about != null ? about : profile == null || profile.getAbout() == null ? "" : profile.getAbout(),
+ aboutEmoji != null
+ ? aboutEmoji
+ : profile == null || profile.getAboutEmoji() == null ? "" : profile.getAboutEmoji(),
+ profile == null ? null : profile.getUnidentifiedAccess(),
+ account.isUnrestrictedUnidentifiedAccess(),
+ profile == null ? null : profile.getCapabilities());