[FIX] Insert messages with blank users (#1529)

This commit is contained in:
Diego Mello 2020-01-07 17:00:46 -03:00 committed by GitHub
parent 62db1ec950
commit b4e15753aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 6 deletions

View File

@ -18,12 +18,6 @@ function normalizeAttachments(msg) {
} }
export default (msg) => { export default (msg) => {
/**
* 2019-03-29: Realm object properties are *always* optional, but `u.username` is required
* https://realm.io/docs/javascript/latest/#to-one-relationships
*/
if (!msg || !msg.u || !msg.u.username) { return; }
msg = normalizeAttachments(msg); msg = normalizeAttachments(msg);
msg.reactions = msg.reactions || []; msg.reactions = msg.reactions || [];
msg.unread = msg.unread || false; msg.unread = msg.unread || false;