(obj: ChatMessage)
| 15 | displayName: string|null |
| 16 | time: number|null |
| 17 | static fromObject(obj: ChatMessage) { |
| 18 | // The userId property was renamed to authorId, and userName was renamed to displayName. Accept |
| 19 | // the old names in case the db record was written by an older version of Etherpad. |
| 20 | obj = Object.assign({}, obj); // Don't mutate the caller's object. |
| 21 | if ('userId' in obj && !('authorId' in obj)) { // @ts-ignore |
| 22 | obj.authorId = obj.userId; |
| 23 | } |
| 24 | // @ts-ignore |
| 25 | delete obj.userId; |
| 26 | if ('userName' in obj && !('displayName' in obj)) { // @ts-ignore |
| 27 | obj.displayName = obj.userName; |
| 28 | } |
| 29 | // @ts-ignore |
| 30 | delete obj.userName; |
| 31 | return Object.assign(new ChatMessage(), obj); |
| 32 | } |
| 33 | |
| 34 | /** |
| 35 | * @param {?string} [text] - Initial value of the `text` property. |
no outgoing calls
no test coverage detected