import org.asamk.signal.manager.util.StickerUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.whispersystems.libsignal.util.guava.Optional;
import org.whispersystems.signalservice.api.SignalSessionLock;
import org.whispersystems.signalservice.api.messages.SignalServiceDataMessage;
import org.whispersystems.signalservice.api.messages.SignalServiceReceiptMessage;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Optional;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ExecutorService;
@Override
public void setProfile(
- String givenName, final String familyName, String about, String aboutEmoji, java.util.Optional<File> avatar
+ String givenName, final String familyName, String about, String aboutEmoji, Optional<File> avatar
) throws IOException {
- context.getProfileHelper()
- .setProfile(givenName,
- familyName,
- about,
- aboutEmoji,
- avatar == null ? null : Optional.fromNullable(avatar.orElse(null)));
+ context.getProfileHelper().setProfile(givenName, familyName, about, aboutEmoji, avatar);
context.getSyncHelper().sendSyncFetchProfileMessage();
}
}
@Override
- public void setRegistrationLockPin(java.util.Optional<String> pin) throws IOException, NotMasterDeviceException {
+ public void setRegistrationLockPin(Optional<String> pin) throws IOException, NotMasterDeviceException {
if (!account.isMasterDevice()) {
throw new NotMasterDeviceException();
}
final var timestamp = System.currentTimeMillis();
for (var recipient : recipients) {
if (recipient instanceof RecipientIdentifier.Single single) {
- final var message = new SignalServiceTypingMessage(action, timestamp, Optional.absent());
+ final var message = new SignalServiceTypingMessage(action, timestamp, Optional.empty());
try {
final var recipientId = context.getRecipientHelper().resolveRecipient(single);
final var result = context.getSendHelper().sendTypingMessage(message, recipientId);
stickerPack.getPackKey(),
stickerId,
manifestSticker.emoji(),
- AttachmentUtils.createAttachment(streamDetails, Optional.absent())));
+ AttachmentUtils.createAttachment(streamDetails, Optional.empty())));
}
}
pack.isInstalled(),
manifest.title(),
manifest.author(),
- java.util.Optional.ofNullable(manifest.cover() == null ? null : manifest.cover().toApi()),
+ Optional.ofNullable(manifest.cover() == null ? null : manifest.cover().toApi()),
manifest.stickers().stream().map(JsonStickerPack.JsonSticker::toApi).toList());
} catch (Exception e) {
logger.warn("Failed to read local sticker pack manifest: {}", e.getMessage(), e);