use of org.thoughtcrime.securesms.database.RecipientDatabase.BlockedReader in project Signal-Android by signalapp.
the class MultiDeviceBlockedUpdateJob method onRun.
@Override
public void onRun(MasterSecret masterSecret) throws IOException, UntrustedIdentityException {
RecipientDatabase database = DatabaseFactory.getRecipientDatabase(context);
BlockedReader reader = database.readerForBlocked(database.getBlocked());
List<String> blocked = new LinkedList<>();
Recipient recipient;
while ((recipient = reader.getNext()) != null) {
if (!recipient.isGroupRecipient()) {
blocked.add(recipient.getAddress().serialize());
}
}
messageSender.sendMessage(SignalServiceSyncMessage.forBlocked(new BlockedListMessage(blocked)));
}
Aggregations