File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,3 +74,7 @@ limitations under the License.
7474. mx_MessageTile_highlight {
7575 color : # 00f;
7676}
77+
78+ . mx_MessageTile_msgOption {
79+ float : right;
80+ }
Original file line number Diff line number Diff line change @@ -57,8 +57,7 @@ module.exports = React.createClass({
5757 mx_MessageTile_continuation : this . props . continuation ,
5858 } ) ;
5959 var timestamp = this . props . last ? < MessageTimestamp ts = { this . props . mxEvent . getTs ( ) } /> : null ;
60- var avatar ;
61- var sender ;
60+ var avatar , sender , resend ;
6261 if ( ! this . props . continuation ) {
6362 avatar = (
6463 < div className = "mx_MessageTile_avatar" >
@@ -67,10 +66,16 @@ module.exports = React.createClass({
6766 ) ;
6867 sender = < SenderProfile mxEvent = { this . props . mxEvent } /> ;
6968 }
69+ if ( this . props . mxEvent . status === "not_sent" && ! this . state . resending ) {
70+ resend = < button className = "mx_MessageTile_msgOption" onClick = { this . onResend } >
71+ Resend
72+ </ button > ;
73+ }
7074 return (
7175 < div className = { classes } >
7276 { avatar }
7377 { timestamp }
78+ { resend }
7479 { sender }
7580 < TileType mxEvent = { this . props . mxEvent } />
7681 </ div >
Original file line number Diff line number Diff line change @@ -232,6 +232,10 @@ module.exports = {
232232 dis . dispatch ( {
233233 action : 'message_sent'
234234 } ) ;
235+ } , function ( ) {
236+ dis . dispatch ( {
237+ action : 'message_send_failed'
238+ } ) ;
235239 } ) ;
236240 this . refs . textarea . getDOMNode ( ) . value = '' ;
237241 ev . preventDefault ( ) ;
Original file line number Diff line number Diff line change @@ -23,6 +23,28 @@ module.exports = {
2323 var actions = MatrixClientPeg . get ( ) . getPushActionsForEvent ( this . props . mxEvent ) ;
2424 if ( ! actions || ! actions . tweaks ) { return false ; }
2525 return actions . tweaks . highlight ;
26+ } ,
27+
28+ getInitialState : function ( ) {
29+ return {
30+ resending : false
31+ } ;
32+ } ,
33+
34+ onResend : function ( ) {
35+ var self = this ;
36+ self . setState ( {
37+ resending : true
38+ } ) ;
39+ MatrixClientPeg . get ( ) . resendEvent (
40+ this . props . mxEvent , MatrixClientPeg . get ( ) . getRoom (
41+ this . props . mxEvent . getRoomId ( )
42+ )
43+ ) . finally ( function ( ) {
44+ self . setState ( {
45+ resending : false
46+ } ) ;
47+ } )
2648 }
2749} ;
2850
Original file line number Diff line number Diff line change @@ -79,10 +79,12 @@ module.exports = {
7979
8080 onAction : function ( payload ) {
8181 switch ( payload . action ) {
82+ case 'message_send_failed' :
8283 case 'message_sent' :
8384 this . setState ( {
8485 room : MatrixClientPeg . get ( ) . getRoom ( this . props . roomId )
8586 } ) ;
87+ this . forceUpdate ( ) ;
8688 break ;
8789 case 'notifier_enabled' :
8890 this . forceUpdate ( ) ;
You can’t perform that action at this time.
0 commit comments