@@ -197,6 +197,7 @@ var TimelinePanel = React.createClass({
197
197
MatrixClientPeg . get ( ) . on ( "Room.receipt" , this . onRoomReceipt ) ;
198
198
MatrixClientPeg . get ( ) . on ( "Room.localEchoUpdated" , this . onLocalEchoUpdated ) ;
199
199
MatrixClientPeg . get ( ) . on ( "Room.accountData" , this . onAccountData ) ;
200
+ MatrixClientPeg . get ( ) . on ( "Event.decrypted" , this . onEventDecrypted ) ;
200
201
MatrixClientPeg . get ( ) . on ( "sync" , this . onSync ) ;
201
202
202
203
this . _initTimeline ( this . props ) ;
@@ -266,6 +267,7 @@ var TimelinePanel = React.createClass({
266
267
client . removeListener ( "Room.receipt" , this . onRoomReceipt ) ;
267
268
client . removeListener ( "Room.localEchoUpdated" , this . onLocalEchoUpdated ) ;
268
269
client . removeListener ( "Room.accountData" , this . onAccountData ) ;
270
+ client . removeListener ( "Event.decrypted" , this . onEventDecrypted ) ;
269
271
client . removeListener ( "sync" , this . onSync ) ;
270
272
}
271
273
} ,
@@ -503,6 +505,18 @@ var TimelinePanel = React.createClass({
503
505
} , this . props . onReadMarkerUpdated ) ;
504
506
} ,
505
507
508
+ onEventDecrypted : function ( ev ) {
509
+ // Need to update as we don't display event tiles for events that
510
+ // haven't yet been decrypted. The event will have just been updated
511
+ // in place so we just need to re-render.
512
+ // TODO: We should restrict this to only events in our timeline,
513
+ // but possibly the event tile itself should just update when this
514
+ // happens to save us re-rendering the whole timeline.
515
+ if ( ev . getRoomId ( ) === this . props . timelineSet . room . roomId ) {
516
+ this . forceUpdate ( ) ;
517
+ }
518
+ } ,
519
+
506
520
onSync : function ( state , prevState , data ) {
507
521
this . setState ( { clientSyncState : state } ) ;
508
522
} ,
0 commit comments