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:
2026-10-14 20:17:56 +00:00
co-authored by Claude Opus 5.5
parent 902f036ba0
commit cdbf051ca6
@@ -7,6 +7,7 @@ import eu.lixko.ts3j.client.text.ChatHtml;
import java.util.List; import java.util.List;
import java.util.function.Supplier; import java.util.function.Supplier;
import java.util.stream.Collectors;
/** Turns a session's chat events into the lines of its conversations. */ /** Turns a session's chat events into the lines of its conversations. */
final class ChatFeed { final class ChatFeed {
@@ -37,8 +38,9 @@ final class ChatFeed {
void history(ChatKey key, String title, List<String> logEntries) { void history(ChatKey key, String title, List<String> logEntries) {
String room = this.room.get(); 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()) List<String> lines = logEntries.stream().map(e -> ChatHtml.logEntry(e, room)).filter(l -> !l.isEmpty())
.toList(); .collect(Collectors.toList());
sink.setHistory(key, title, lines); sink.setHistory(key, title, lines);
} }