chat functionality completed and ready for release

This commit is contained in:
Ronald A. Richardson
2024-04-13 20:01:39 +08:00
parent ed1609ccf4
commit 801d73215f
17 changed files with 1141 additions and 1279 deletions

View File

@@ -13,11 +13,19 @@ export default class ChatChannelSerializer extends ApplicationSerializer.extend(
get attrs() {
return {
participants: { embedded: 'always' },
messages: { embedded: 'always' },
last_message: { embedded: 'always' },
};
}
serialize(snapshot) {
let json = {
name: snapshot.attr('name'),
meta: snapshot.attr('meta'),
};
return json;
}
normalize(typeClass, hash) {
if (isArray(hash.feed)) {
hash.feed = this.serializeFeed(hash.feed);

View File

@@ -11,6 +11,7 @@ export default class ChatMessageSerializer extends ApplicationSerializer.extend(
return {
sender: { embedded: 'always' },
attachments: { embedded: 'always' },
receipts: { embedded: 'always' },
};
}
}