Added warning when reaching conversation length limit of 200 messages
This commit is contained in:
parent
d3617f1402
commit
6c3b99ffa4
lib
@ -61,19 +61,22 @@ class GetChatResponseObject {
|
||||
|
||||
static GetChatResponseObject getDateDummy(int timestamp) {
|
||||
DateTime elementDate = DateTime.fromMillisecondsSinceEpoch(timestamp * 1000);
|
||||
return getTextDummy(Jiffy.parseFromDateTime(elementDate).format(pattern: "dd.MM.yyyy"));
|
||||
}
|
||||
|
||||
static GetChatResponseObject getTextDummy(String text) {
|
||||
return GetChatResponseObject(
|
||||
0,
|
||||
"",
|
||||
GetRoomResponseObjectMessageActorType.user,
|
||||
"",
|
||||
"",
|
||||
timestamp,
|
||||
elementDate.toIso8601String(),
|
||||
0,
|
||||
"",
|
||||
GetRoomResponseObjectMessageType.system,
|
||||
false,
|
||||
"",
|
||||
Jiffy.parseFromDateTime(elementDate).format(pattern: "dd.MM.yyyy"),
|
||||
text,
|
||||
null,
|
||||
null,
|
||||
null
|
||||
|
@ -74,6 +74,19 @@ class _ChatViewState extends State<ChatView> {
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
if(data.getChatResponse.data.length >= 200) {
|
||||
messages.insert(0, ChatBubble(
|
||||
context: context,
|
||||
isSender: false,
|
||||
bubbleData: GetChatResponseObject.getTextDummy(
|
||||
"Zurzeit können in dieser App nur die letzten 200 vergangenen Nachrichten angezeigt werden. "
|
||||
"Um ältere Nachrichten abzurufen verwende die Webversion unter https://cloud.marianum-fulda.de"
|
||||
),
|
||||
chatData: widget.room,
|
||||
refetch: _query,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
|
Loading…
x
Reference in New Issue
Block a user