use of androidx.core.util.Consumer in project Signal-Android by WhisperSystems.
the class EditGroupProfileRepository method getCurrentName.
@Override
public void getCurrentName(@NonNull Consumer<String> nameConsumer) {
SimpleTask.run(() -> {
RecipientId recipientId = getRecipientId();
Recipient recipient = Recipient.resolved(recipientId);
return SignalDatabase.groups().getGroup(recipientId).transform(groupRecord -> {
String title = groupRecord.getTitle();
return title == null ? "" : title;
}).or(() -> recipient.getGroupName(context));
}, nameConsumer::accept);
}
use of androidx.core.util.Consumer in project Signal-Android by signalapp.
the class EditGroupProfileRepository method getCurrentName.
@Override
public void getCurrentName(@NonNull Consumer<String> nameConsumer) {
SimpleTask.run(() -> {
RecipientId recipientId = getRecipientId();
Recipient recipient = Recipient.resolved(recipientId);
return SignalDatabase.groups().getGroup(recipientId).transform(groupRecord -> {
String title = groupRecord.getTitle();
return title == null ? "" : title;
}).or(() -> recipient.getGroupName(context));
}, nameConsumer::accept);
}
Aggregations