Inject stickers

This commit is contained in:
Richard Lewis 2018-01-04 09:53:26 +00:00
parent 7660176079
commit e96d199b28
3 changed files with 37 additions and 8 deletions

View file

@ -459,6 +459,9 @@ module.exports = React.createClass({
case 'message_sent':
this._checkIfAlone(this.state.room);
break;
case 'inject_sticker':
this.injectSticker(payload.url, payload.info, payload.text);
break;
case 'picture_snapshot':
this.uploadFile(payload.file);
break;
@ -904,6 +907,21 @@ module.exports = React.createClass({
});
},
injectSticker: function(url, info, text) {
if (MatrixClientPeg.get().isGuest()) {
dis.dispatch({action: 'view_set_mxid'});
return;
}
ContentMessages.sendURLContentToRoom(url, this.state.room.roomId, info, text, MatrixClientPeg.get())
.done(undefined, (error) => {
if (error.name === "UnknownDeviceError") {
// Let the staus bar handle this
return;
}
});
},
onSearch: function(term, scope) {
this.setState({
searchTerm: term,