Remove TextSecurePreferences.getAvatarId()

This commit is contained in:
Greyson Parrelli
2020-03-25 18:43:02 -04:00
parent 6aac3baa55
commit e6f9cb9929
15 changed files with 120 additions and 44 deletions

View File

@@ -641,7 +641,7 @@ public class SignalServiceAccountManager {
this.pushServiceSocket.setProfileName(ciphertextName);
}
public String setProfileAvatar(ProfileKey key, StreamDetails avatar)
public Optional<String> setProfileAvatar(ProfileKey key, StreamDetails avatar)
throws IOException
{
if (FeatureFlags.VERSIONED_PROFILES) {
@@ -663,7 +663,7 @@ public class SignalServiceAccountManager {
/**
* @return The avatar URL path, if one was written.
*/
public String setVersionedProfile(UUID uuid, ProfileKey profileKey, String name, StreamDetails avatar)
public Optional<String> setVersionedProfile(UUID uuid, ProfileKey profileKey, String name, StreamDetails avatar)
throws IOException
{
if (!FeatureFlags.VERSIONED_PROFILES) {

View File

@@ -604,7 +604,7 @@ public class PushServiceSocket {
makeServiceRequest(String.format(PROFILE_PATH, "name/" + (name == null ? "" : URLEncoder.encode(name))), "PUT", "");
}
public String setProfileAvatar(ProfileAvatarData profileAvatar)
public Optional<String> setProfileAvatar(ProfileAvatarData profileAvatar)
throws NonSuccessfulResponseCodeException, PushNetworkException
{
if (FeatureFlags.VERSIONED_PROFILES) {
@@ -629,16 +629,16 @@ public class PushServiceSocket {
profileAvatar.getContentType(), profileAvatar.getDataLength(),
profileAvatar.getOutputStreamFactory(), null, null);
return formAttributes.getKey();
return Optional.of(formAttributes.getKey());
}
return null;
return Optional.absent();
}
/**
* @return The avatar URL path, if one was written.
*/
public String writeProfile(SignalServiceProfileWrite signalServiceProfileWrite, ProfileAvatarData profileAvatar)
public Optional<String> writeProfile(SignalServiceProfileWrite signalServiceProfileWrite, ProfileAvatarData profileAvatar)
throws NonSuccessfulResponseCodeException, PushNetworkException
{
if (!FeatureFlags.VERSIONED_PROFILES) {
@@ -665,10 +665,10 @@ public class PushServiceSocket {
profileAvatar.getContentType(), profileAvatar.getDataLength(),
profileAvatar.getOutputStreamFactory(), null, null);
return formAttributes.getKey();
return Optional.of(formAttributes.getKey());
}
return null;
return Optional.absent();
}
public void setUsername(String username) throws IOException {