From 6fd61f58162498709533f79418a2dd5efffeff89 Mon Sep 17 00:00:00 2001 From: wmwragg Date: Tue, 16 Aug 2016 10:26:27 +0100 Subject: [PATCH 1/9] Initial reposition of the timestamp --- src/components/views/rooms/EventTile.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js index 7945debd1a..67e63e3e62 100644 --- a/src/components/views/rooms/EventTile.js +++ b/src/components/views/rooms/EventTile.js @@ -420,16 +420,18 @@ module.exports = React.createClass({ return (
- { timestamp } { readAvatars }
{ avatar } { sender }
- + { timestamp } +
); From c359358101f06c72488c6df110ec8f6f899af504 Mon Sep 17 00:00:00 2001 From: wmwragg Date: Tue, 16 Aug 2016 11:59:26 +0100 Subject: [PATCH 2/9] Initial context menu positioning and style change --- src/components/views/rooms/EventTile.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js index 67e63e3e62..cd49bef412 100644 --- a/src/components/views/rooms/EventTile.js +++ b/src/components/views/rooms/EventTile.js @@ -320,7 +320,6 @@ module.exports = React.createClass({ left -= 15; } } - var editButton; var remText; if (!this.state.allReadAvatars) { var remainder = receipts.length - MAX_READ_AVATARS; @@ -331,15 +330,9 @@ module.exports = React.createClass({ ; left -= 15; } - editButton = ( - - ); } return - { editButton } { remText } { avatars } ; @@ -417,6 +410,11 @@ module.exports = React.createClass({ sender = ; } } + + var editButton = ( + + ); + return (
@@ -432,6 +430,7 @@ module.exports = React.createClass({ highlightLink={this.props.highlightLink} showUrlPreview={this.props.showUrlPreview} onWidgetLoad={this.props.onWidgetLoad} /> + { editButton }
); From 8e8e6fd5fe2856ce5c2bd64dd7115f7f05d2bf15 Mon Sep 17 00:00:00 2001 From: wmwragg Date: Tue, 16 Aug 2016 15:01:01 +0100 Subject: [PATCH 3/9] formatTime for use with new timestamp format --- src/DateUtils.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/DateUtils.js b/src/DateUtils.js index f291111981..2b51c5903f 100644 --- a/src/DateUtils.js +++ b/src/DateUtils.js @@ -42,6 +42,11 @@ module.exports = { return days[date.getDay()] + ", " + months[date.getMonth()] + " " + date.getDate() + " " + date.getFullYear() + " " + pad(date.getHours()) + ':' + pad(date.getMinutes()); } */ + }, + + formatTime: function(date) { + //return pad(date.getHours()) + ':' + pad(date.getMinutes()); + return ('00' + date.getHours()).slice(-2) + ':' + ('00' + date.getMinutes()).slice(-2); } } From 58d97896457ed0007af1afa7ee1f9b3f0cca0832 Mon Sep 17 00:00:00 2001 From: wmwragg Date: Tue, 16 Aug 2016 16:03:34 +0100 Subject: [PATCH 4/9] Increase main avatar size --- src/components/views/rooms/EventTile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js index cd49bef412..b2e4e4af77 100644 --- a/src/components/views/rooms/EventTile.js +++ b/src/components/views/rooms/EventTile.js @@ -401,7 +401,7 @@ module.exports = React.createClass({ if (this.props.mxEvent.sender) { avatar = (
-
); From 52f5061cc53956ac0b681bda1fb442b37d69c526 Mon Sep 17 00:00:00 2001 From: wmwragg Date: Tue, 16 Aug 2016 17:34:33 +0100 Subject: [PATCH 5/9] Made the menu button a clickable image rather than an input element --- src/components/views/rooms/EventTile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js index b2e4e4af77..0222f7bfc3 100644 --- a/src/components/views/rooms/EventTile.js +++ b/src/components/views/rooms/EventTile.js @@ -412,7 +412,7 @@ module.exports = React.createClass({ } var editButton = ( - + Options ); return ( From a55c4a2a5252e9b56990543ddc05d3ca1dfde623 Mon Sep 17 00:00:00 2001 From: wmwragg Date: Thu, 18 Aug 2016 21:53:37 +0100 Subject: [PATCH 6/9] Initial pass at the /me and action messages, without name highlighting, and missing avatar for continuation messages after a /me or action message --- src/components/views/rooms/EventTile.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js index 0222f7bfc3..cf013c0ae4 100644 --- a/src/components/views/rooms/EventTile.js +++ b/src/components/views/rooms/EventTile.js @@ -362,6 +362,8 @@ module.exports = React.createClass({ var content = this.props.mxEvent.getContent(); var msgtype = content.msgtype; + var eventType = this.props.mxEvent.getType(); + var isInfoMessage = (msgtype === 'm.emote' || eventType !== 'm.room.message'); var EventTileType = sdk.getComponent(eventTileTypes[this.props.mxEvent.getType()]); // This shouldn't happen: the caller should check we support this type @@ -372,6 +374,7 @@ module.exports = React.createClass({ var classes = classNames({ mx_EventTile: true, + mx_EventTile_info: isInfoMessage, mx_EventTile_sending: ['sending', 'queued'].indexOf( this.props.eventSendStatus ) !== -1, @@ -397,12 +400,17 @@ module.exports = React.createClass({ var readAvatars = this.getReadAvatars(); var avatar, sender; - if (!this.props.continuation) { + if (isInfoMessage) { + avatar = ( +
+ +
+ ); + } else if (!this.props.continuation) { if (this.props.mxEvent.sender) { avatar = (
- +
); } From ddda435e9e7237b8a923afb68754a584a5973c15 Mon Sep 17 00:00:00 2001 From: wmwragg Date: Thu, 18 Aug 2016 22:15:53 +0100 Subject: [PATCH 7/9] Updated the MessagePanel to now take account of /me messages when working out if an event is a continuation message or not --- src/components/structures/MessagePanel.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/components/structures/MessagePanel.js b/src/components/structures/MessagePanel.js index 53efac6406..73ea2fd1a0 100644 --- a/src/components/structures/MessagePanel.js +++ b/src/components/structures/MessagePanel.js @@ -337,6 +337,18 @@ module.exports = React.createClass({ continuation = true; } + // Work out if this is still a continuation, as we are now showing commands + // and /me messages with their own little avatar. The case of a change of + // event type (commands) is handled above, but we need to handle the /me + // messages seperately as they have a msgtype of 'm.emote' but are classed + // as normal messages + if (prevEvent !== null && prevEvent.sender && mxEv.sender + && mxEv.sender.userId === prevEvent.sender.userId + && mxEv.getType() == prevEvent.getType() + && prevEvent.getContent().msgtype === 'm.emote') { + continuation = false; + } + // local echoes have a fake date, which could even be yesterday. Treat them // as 'today' for the date separators. var ts1 = mxEv.getTs(); From afd1ab1582980fd09270c665b47bbfcc4d7ef7e0 Mon Sep 17 00:00:00 2001 From: wmwragg Date: Thu, 18 Aug 2016 22:19:23 +0100 Subject: [PATCH 8/9] Comment to describe what info messages are --- src/components/views/rooms/EventTile.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js index cf013c0ae4..7f88f08226 100644 --- a/src/components/views/rooms/EventTile.js +++ b/src/components/views/rooms/EventTile.js @@ -363,6 +363,9 @@ module.exports = React.createClass({ var content = this.props.mxEvent.getContent(); var msgtype = content.msgtype; var eventType = this.props.mxEvent.getType(); + + // Info messages are basically information about commands processed on a + // room, or emote messages var isInfoMessage = (msgtype === 'm.emote' || eventType !== 'm.room.message'); var EventTileType = sdk.getComponent(eventTileTypes[this.props.mxEvent.getType()]); From 993333490df27cad3dce9ee7c729fa9e10c7c507 Mon Sep 17 00:00:00 2001 From: wmwragg Date: Fri, 19 Aug 2016 16:38:05 +0100 Subject: [PATCH 9/9] Removal of the mini avatars for action (info) messages --- src/components/views/rooms/EventTile.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js index 7f88f08226..bc0317addd 100644 --- a/src/components/views/rooms/EventTile.js +++ b/src/components/views/rooms/EventTile.js @@ -403,13 +403,7 @@ module.exports = React.createClass({ var readAvatars = this.getReadAvatars(); var avatar, sender; - if (isInfoMessage) { - avatar = ( -
- -
- ); - } else if (!this.props.continuation) { + if (!this.props.continuation && !isInfoMessage) { if (this.props.mxEvent.sender) { avatar = (