You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-31 13:44:28 +03:00
specify timestamps for historical previews
This commit is contained in:
@ -91,7 +91,7 @@ module.exports = React.createClass({
|
|||||||
var widget;
|
var widget;
|
||||||
if (this.state.link) {
|
if (this.state.link) {
|
||||||
var LinkPreviewWidget = sdk.getComponent('rooms.LinkPreviewWidget');
|
var LinkPreviewWidget = sdk.getComponent('rooms.LinkPreviewWidget');
|
||||||
widget = <LinkPreviewWidget link={ this.state.link } onWidgetLoad={ this.props.onWidgetLoad }/>;
|
widget = <LinkPreviewWidget link={ this.state.link } ts={ this.props.mxEvent.getTs() } onWidgetLoad={ this.props.onWidgetLoad }/>;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (content.msgtype) {
|
switch (content.msgtype) {
|
||||||
|
@ -31,6 +31,7 @@ module.exports = React.createClass({
|
|||||||
|
|
||||||
propTypes: {
|
propTypes: {
|
||||||
link: React.PropTypes.string.isRequired,
|
link: React.PropTypes.string.isRequired,
|
||||||
|
ts: React.PropTypes.number,
|
||||||
onWidgetLoad: React.PropTypes.func,
|
onWidgetLoad: React.PropTypes.func,
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -41,7 +42,7 @@ module.exports = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
componentWillMount: function() {
|
componentWillMount: function() {
|
||||||
MatrixClientPeg.get().getUrlPreview(this.props.link).then((res)=>{
|
MatrixClientPeg.get().getUrlPreview(this.props.link, this.props.ts).then((res)=>{
|
||||||
this.setState({ preview: res });
|
this.setState({ preview: res });
|
||||||
this.props.onWidgetLoad();
|
this.props.onWidgetLoad();
|
||||||
}, (error)=>{
|
}, (error)=>{
|
||||||
|
Reference in New Issue
Block a user