Inject stickers
This commit is contained in:
parent
7660176079
commit
e96d199b28
3 changed files with 37 additions and 8 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue