kopia lustrzana https://github.com/ryukoposting/Signal-Android
Add additional logging to media send jobs.
rodzic
ff4f0b9f42
commit
a361fcc8f3
|
@ -180,7 +180,7 @@ public final class PushGroupSendJob extends PushSendJob {
|
|||
}
|
||||
|
||||
try {
|
||||
log(TAG, String.valueOf(message.getSentTimeMillis()), "Sending message: " + messageId + ", Recipient: " + message.getRecipient().getId() + ", Thread: " + threadId);
|
||||
log(TAG, String.valueOf(message.getSentTimeMillis()), "Sending message: " + messageId + ", Recipient: " + message.getRecipient().getId() + ", Thread: " + threadId + ", Attachments: " + buildAttachmentString(message.getAttachments()));
|
||||
|
||||
if (!groupRecipient.resolve().isProfileSharing() && !database.isGroupQuitMessage(messageId)) {
|
||||
RecipientUtil.shareProfileIfFirstSecureMessage(context, groupRecipient);
|
||||
|
|
|
@ -121,7 +121,7 @@ public class PushMediaSendJob extends PushSendJob {
|
|||
}
|
||||
|
||||
try {
|
||||
log(TAG, String.valueOf(message.getSentTimeMillis()), "Sending message: " + messageId + ", Recipient: " + message.getRecipient().getId() + ", Thread: " + threadId);
|
||||
log(TAG, String.valueOf(message.getSentTimeMillis()), "Sending message: " + messageId + ", Recipient: " + message.getRecipient().getId() + ", Thread: " + threadId + ", Attachments: " + buildAttachmentString(message.getAttachments()));
|
||||
|
||||
RecipientUtil.shareProfileIfFirstSecureMessage(context, message.getRecipient());
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ import org.signal.core.util.logging.Log;
|
|||
import org.thoughtcrime.securesms.BuildConfig;
|
||||
import org.thoughtcrime.securesms.TextSecureExpiredException;
|
||||
import org.thoughtcrime.securesms.attachments.Attachment;
|
||||
import org.thoughtcrime.securesms.attachments.DatabaseAttachment;
|
||||
import org.thoughtcrime.securesms.contactshare.Contact;
|
||||
import org.thoughtcrime.securesms.database.AttachmentDatabase;
|
||||
import org.thoughtcrime.securesms.database.DatabaseFactory;
|
||||
|
@ -20,6 +21,7 @@ import org.thoughtcrime.securesms.util.Util;
|
|||
import java.lang.reflect.Array;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public abstract class SendJob extends BaseJob {
|
||||
|
||||
|
@ -62,4 +64,18 @@ public abstract class SendJob extends BaseJob {
|
|||
database.markAttachmentUploaded(messageId, attachment);
|
||||
}
|
||||
}
|
||||
|
||||
protected String buildAttachmentString(@NonNull List<Attachment> attachments) {
|
||||
List<String> strings = attachments.stream().map(attachment -> {
|
||||
if (attachment instanceof DatabaseAttachment) {
|
||||
return ((DatabaseAttachment) attachment).getAttachmentId().toString();
|
||||
} else if (attachment.getUri() != null) {
|
||||
return attachment.getUri().toString();
|
||||
} else {
|
||||
return attachment.toString();
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
return Util.join(strings, ", ");
|
||||
}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue