mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 03:36:07 +03:00
3a8c263e8e
Factor out resend logic which was in the context menu into a separate Resend file (it shouldn't be in the skin, but it also isn't really suitable for a controller given 2 different views invoke it..)
24 lines
No EOL
696 B
JavaScript
24 lines
No EOL
696 B
JavaScript
var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg');
|
|
var dis = require('matrix-react-sdk/lib/dispatcher');
|
|
|
|
module.exports = {
|
|
resend: function(event) {
|
|
MatrixClientPeg.get().resendEvent(
|
|
event, MatrixClientPeg.get().getRoom(event.getRoomId())
|
|
).done(function() {
|
|
dis.dispatch({
|
|
action: 'message_sent',
|
|
event: event
|
|
});
|
|
}, function() {
|
|
dis.dispatch({
|
|
action: 'message_send_failed',
|
|
event: event
|
|
});
|
|
});
|
|
dis.dispatch({
|
|
action: 'message_resend_started',
|
|
event: event
|
|
});
|
|
},
|
|
}; |