From 269077092dba11341740e963ecece1e0e77b3332 Mon Sep 17 00:00:00 2001 From: f0x Date: Mon, 27 May 2019 19:46:37 +0200 Subject: [PATCH] add option to load more backlog --- components/chat.js | 11 ++++++++--- components/events/Event.js | 4 +++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/components/chat.js b/components/chat.js index 4716398..bba3978 100644 --- a/components/chat.js +++ b/components/chat.js @@ -99,6 +99,7 @@ let chat = create({ }, render: function() { + let client = this.props.client let empty = (
@@ -108,7 +109,7 @@ let chat = create({ return empty } - let room = this.props.client.getRoom(this.props.roomId) + let room = client.getRoom(this.props.roomId) if (room == null) { return empty } @@ -128,7 +129,7 @@ let chat = create({ room.getLiveTimeline().getEvents().forEach((MatrixEvent) => { let event = MatrixEvent.event; event = Object.assign(event, eventFunctions) - if (event.user_id != null) { // localecho messages + if (event.sender == null) { // localecho messages event.sender = event.user_id event.local = true } @@ -154,10 +155,14 @@ let chat = create({
+ {events}
- + ) } diff --git a/components/events/Event.js b/components/events/Event.js index 86a049d..31373fa 100644 --- a/components/events/Event.js +++ b/components/events/Event.js @@ -82,7 +82,9 @@ function parseEvent(event, context) { html = true } - body = body.trim() + if (body) { + body = body.trim() + } let parsedReply = parseReply(event, body) if (parsedReply.isReply) {