use of org.thoughtcrime.securesms.jobs.ReportSpamJob in project Signal-Android by WhisperSystems.
the class MessageRequestRepository method blockAndReportSpamMessageRequest.
void blockAndReportSpamMessageRequest(@NonNull LiveRecipient liveRecipient, long threadId, @NonNull Runnable onMessageRequestBlocked, @NonNull GroupChangeErrorCallback error) {
executor.execute(() -> {
Recipient recipient = liveRecipient.resolve();
try {
RecipientUtil.block(context, recipient);
} catch (GroupChangeException | IOException e) {
Log.w(TAG, e);
error.onError(GroupChangeFailureReason.fromException(e));
return;
}
liveRecipient.refresh();
ApplicationDependencies.getJobManager().add(new ReportSpamJob(threadId, System.currentTimeMillis()));
if (TextSecurePreferences.isMultiDevice(context)) {
ApplicationDependencies.getJobManager().add(MultiDeviceMessageRequestResponseJob.forBlockAndReportSpam(liveRecipient.getId()));
}
onMessageRequestBlocked.run();
});
}
Aggregations