You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +03:00
Cancel pending events in virtual room when call placed (#7583)
As the comment hopefully explains. Also add public qualifiers to the methods in Resend which lacked any visibility specifiers. Fixes https://github.com/vector-im/element-web/issues/17594
This commit is contained in:
@@ -22,7 +22,7 @@ import { MatrixClientPeg } from './MatrixClientPeg';
|
||||
import dis from './dispatcher/dispatcher';
|
||||
|
||||
export default class Resend {
|
||||
static resendUnsentEvents(room: Room): Promise<void[]> {
|
||||
public static resendUnsentEvents(room: Room): Promise<void[]> {
|
||||
return Promise.all(room.getPendingEvents().filter(function(ev: MatrixEvent) {
|
||||
return ev.status === EventStatus.NOT_SENT;
|
||||
}).map(function(event: MatrixEvent) {
|
||||
@@ -30,7 +30,7 @@ export default class Resend {
|
||||
}));
|
||||
}
|
||||
|
||||
static cancelUnsentEvents(room: Room): void {
|
||||
public static cancelUnsentEvents(room: Room): void {
|
||||
room.getPendingEvents().filter(function(ev: MatrixEvent) {
|
||||
return ev.status === EventStatus.NOT_SENT;
|
||||
}).forEach(function(event: MatrixEvent) {
|
||||
@@ -38,7 +38,7 @@ export default class Resend {
|
||||
});
|
||||
}
|
||||
|
||||
static resend(event: MatrixEvent): Promise<void> {
|
||||
public static resend(event: MatrixEvent): Promise<void> {
|
||||
const room = MatrixClientPeg.get().getRoom(event.getRoomId());
|
||||
return MatrixClientPeg.get().resendEvent(event, room).then(function(res) {
|
||||
dis.dispatch({
|
||||
@@ -52,7 +52,7 @@ export default class Resend {
|
||||
});
|
||||
}
|
||||
|
||||
static removeFromQueue(event: MatrixEvent): void {
|
||||
public static removeFromQueue(event: MatrixEvent): void {
|
||||
MatrixClientPeg.get().cancelPendingEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user