Make CallHandler
more EventEmitter
y (#6704)
* sharedInstance() -> instance Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Use CallState event instead of dispatching Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Simplifie some code Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Use a method to start a call instead of the dispatcher Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Use a method instead of place_conference_call Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Make terminateCallApp() and hangupCallApp() public Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Use hangupAllCalls() instead of the dispatcher Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Make dialNumber(), startTransferToMatrixID() and startTransferToPhoneNumber() public instead of using the dispatcher Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Use answerCall() instead of using the dispatcher Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Use hangupOrReject() instead of the dispatcher Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Update docs Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Improve TS Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Dispatch call_state, see https://github.com/vector-im/element-web/pull/18823#issuecomment-917377277 Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Add missing import Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
e3187ed15c
commit
cbb34d8ac7
23 changed files with 300 additions and 511 deletions
|
@ -63,7 +63,6 @@ import { copyPlaintext, selectText } from "../../../utils/strings";
|
|||
import * as ContextMenu from "../../structures/ContextMenu";
|
||||
import { toRightOf } from "../../structures/ContextMenu";
|
||||
import GenericTextContextMenu from "../context_menus/GenericTextContextMenu";
|
||||
import { TransferCallPayload } from '../../../dispatcher/payloads/TransferCallPayload';
|
||||
import Field from '../elements/Field';
|
||||
import TabbedView, { Tab, TabLocation } from '../../structures/TabbedView';
|
||||
import Dialpad from '../voip/DialPad';
|
||||
|
@ -72,6 +71,7 @@ import Spinner from "../elements/Spinner";
|
|||
import BaseDialog from "./BaseDialog";
|
||||
import DialPadBackspaceButton from "../elements/DialPadBackspaceButton";
|
||||
import SpaceStore from "../../../stores/spaces/SpaceStore";
|
||||
import CallHandler from "../../../CallHandler";
|
||||
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
|
@ -806,19 +806,17 @@ export default class InviteDialog extends React.PureComponent<IInviteDialogProps
|
|||
return;
|
||||
}
|
||||
|
||||
dis.dispatch({
|
||||
action: Action.TransferCallToMatrixID,
|
||||
call: this.props.call,
|
||||
destination: targetIds[0],
|
||||
consultFirst: this.state.consultFirst,
|
||||
} as TransferCallPayload);
|
||||
CallHandler.instance.startTransferToMatrixID(
|
||||
this.props.call,
|
||||
targetIds[0],
|
||||
this.state.consultFirst,
|
||||
);
|
||||
} else {
|
||||
dis.dispatch({
|
||||
action: Action.TransferCallToPhoneNumber,
|
||||
call: this.props.call,
|
||||
destination: this.state.dialPadValue,
|
||||
consultFirst: this.state.consultFirst,
|
||||
} as TransferCallPayload);
|
||||
CallHandler.instance.startTransferToPhoneNumber(
|
||||
this.props.call,
|
||||
this.state.dialPadValue,
|
||||
this.state.consultFirst,
|
||||
);
|
||||
}
|
||||
this.props.onFinished();
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue