Added warning when reaching conversation length limit of 200 messages
This commit is contained in:
parent
d3617f1402
commit
6c3b99ffa4
@ -61,19 +61,22 @@ class GetChatResponseObject {
|
|||||||
|
|
||||||
static GetChatResponseObject getDateDummy(int timestamp) {
|
static GetChatResponseObject getDateDummy(int timestamp) {
|
||||||
DateTime elementDate = DateTime.fromMillisecondsSinceEpoch(timestamp * 1000);
|
DateTime elementDate = DateTime.fromMillisecondsSinceEpoch(timestamp * 1000);
|
||||||
|
return getTextDummy(Jiffy.parseFromDateTime(elementDate).format(pattern: "dd.MM.yyyy"));
|
||||||
|
}
|
||||||
|
|
||||||
|
static GetChatResponseObject getTextDummy(String text) {
|
||||||
return GetChatResponseObject(
|
return GetChatResponseObject(
|
||||||
0,
|
0,
|
||||||
"",
|
"",
|
||||||
GetRoomResponseObjectMessageActorType.user,
|
GetRoomResponseObjectMessageActorType.user,
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
timestamp,
|
0,
|
||||||
elementDate.toIso8601String(),
|
"",
|
||||||
GetRoomResponseObjectMessageType.system,
|
GetRoomResponseObjectMessageType.system,
|
||||||
false,
|
false,
|
||||||
"",
|
"",
|
||||||
Jiffy.parseFromDateTime(elementDate).format(pattern: "dd.MM.yyyy"),
|
text,
|
||||||
null,
|
null,
|
||||||
null,
|
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(
|
return Scaffold(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user