Make stickers/messages continuations of each other
parent
008572afe1
commit
01dd494f50
|
@ -447,10 +447,18 @@ module.exports = React.createClass({
|
||||||
// is this a continuation of the previous message?
|
// is this a continuation of the previous message?
|
||||||
let continuation = false;
|
let continuation = false;
|
||||||
|
|
||||||
|
// Some events should appear as continuations from previous events of
|
||||||
|
// different types.
|
||||||
|
const continuedTypes = ['m.sticker', 'm.room.message'];
|
||||||
|
const eventTypeContinues =
|
||||||
|
prevEvent !== null &&
|
||||||
|
continuedTypes.includes(mxEv.getType()) &&
|
||||||
|
continuedTypes.includes(prevEvent.getType());
|
||||||
|
|
||||||
if (prevEvent !== null
|
if (prevEvent !== null
|
||||||
&& prevEvent.sender && mxEv.sender
|
&& prevEvent.sender && mxEv.sender
|
||||||
&& mxEv.sender.userId === prevEvent.sender.userId
|
&& mxEv.sender.userId === prevEvent.sender.userId
|
||||||
&& mxEv.getType() == prevEvent.getType()) {
|
&& (mxEv.getType() == prevEvent.getType() || eventTypeContinues)) {
|
||||||
continuation = true;
|
continuation = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -471,7 +471,7 @@ module.exports = withMatrixClient(React.createClass({
|
||||||
const eventType = this.props.mxEvent.getType();
|
const eventType = this.props.mxEvent.getType();
|
||||||
|
|
||||||
// Info messages are basically information about commands processed on a room
|
// Info messages are basically information about commands processed on a room
|
||||||
const isInfoMessage = (eventType !== 'm.room.message' && eventType !== 'm.room.sticker');
|
const isInfoMessage = (eventType !== 'm.room.message' && eventType !== 'm.sticker');
|
||||||
|
|
||||||
const EventTileType = sdk.getComponent(getHandlerTile(this.props.mxEvent));
|
const EventTileType = sdk.getComponent(getHandlerTile(this.props.mxEvent));
|
||||||
// This shouldn't happen: the caller should check we support this type
|
// This shouldn't happen: the caller should check we support this type
|
||||||
|
|
Loading…
Reference in New Issue