|
@@ -100,7 +100,7 @@ export class Tab2Page {
|
|
|
chatpartner:chatpartner.toPointer(),
|
|
|
user:currentUser.toPointer(),
|
|
|
ACL:ACL,
|
|
|
- content: "",
|
|
|
+ content: [],
|
|
|
createdAt: now,
|
|
|
})
|
|
|
|
|
@@ -127,10 +127,10 @@ export class Tab2Page {
|
|
|
onMessage: (chat: FmodeChat, message: FmodeChatMessage) => {
|
|
|
console.log("onMessage", message);
|
|
|
|
|
|
- const allMessages = chat.messageList.map(msg => msg.content).join("\n");
|
|
|
+
|
|
|
|
|
|
consult.set({
|
|
|
- content: allMessages,
|
|
|
+ content: chat.messageList,
|
|
|
});
|
|
|
|
|
|
console.log("准备保存聊天记录:", consult);
|
|
@@ -219,7 +219,8 @@ export class Tab2Page {
|
|
|
if(typeof content == "string"){
|
|
|
messages.push(content);
|
|
|
consult.set({
|
|
|
- content: messages.join("\n"),
|
|
|
+ content:chat.messageList
|
|
|
+
|
|
|
});
|
|
|
consult.save().then(() => {
|
|
|
console.log("聊天记录已保存");
|