Skip to content
Snippets Groups Projects
Commit 248c1145 authored by Richard Hansen's avatar Richard Hansen
Browse files

chat: Omit undefined `authorId`, `displayName` in JSON obj

parent ad45359a
Branches
Tags
No related merge requests found
......@@ -88,13 +88,10 @@ class ChatMessage {
// TODO: Delete this method once users are unlikely to roll back to a version of Etherpad that
// doesn't support authorId and displayName.
toJSON() {
return {
...this,
authorId: undefined,
displayName: undefined,
userId: this.authorId,
userName: this.displayName,
};
const {authorId, displayName, ...obj} = this;
obj.userId = authorId;
obj.userName = displayName;
return obj;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment