Android: don't crash on connect on Android 13
ChatFeed used Stream.toList(), which Android only has from API 34. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,7 @@ import eu.lixko.ts3j.client.text.ChatHtml;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/** Turns a session's chat events into the lines of its conversations. */
|
||||
final class ChatFeed {
|
||||
@@ -37,8 +38,9 @@ final class ChatFeed {
|
||||
|
||||
void history(ChatKey key, String title, List<String> logEntries) {
|
||||
String room = this.room.get();
|
||||
// Android < API 34 lacks Stream.toList.
|
||||
List<String> lines = logEntries.stream().map(e -> ChatHtml.logEntry(e, room)).filter(l -> !l.isEmpty())
|
||||
.toList();
|
||||
.collect(Collectors.toList());
|
||||
sink.setHistory(key, title, lines);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user