Removed old comments, simplified if-statement and added a 'leadingSpaces' field to the print attachments/mentions functions

This commit is contained in:
david-harley 2021-02-18 09:43:11 +10:30
parent 7317291d7a
commit 7191e4371b
2 changed files with 44 additions and 28 deletions

View file

@ -1554,16 +1554,17 @@ public class Manager implements Closeable {
}
}
}
if (message.getAttachments().isPresent() && !ignoreAttachments) {
for (SignalServiceAttachment attachment : message.getAttachments().get()) {
downloadAttachment(attachment);
if (!ignoreAttachments) {
if (message.getAttachments().isPresent()) {
for (SignalServiceAttachment attachment : message.getAttachments().get()) {
downloadAttachment(attachment);
}
}
}
if (message.getSharedContacts().isPresent() && !ignoreAttachments) {
for (SharedContact contact : message.getSharedContacts().get()) {
if (contact.getAvatar().isPresent()) {
// TODO probably should save to contacts instead
downloadAttachment(contact.getAvatar().get().getAttachment());
if (message.getSharedContacts().isPresent()) {
for (SharedContact contact : message.getSharedContacts().get()) {
if (contact.getAvatar().isPresent()) {
downloadAttachment(contact.getAvatar().get().getAttachment());
}
}
}
}