mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-15 22:41:32 +03:00
Allow picking up calls from the timeline
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
dac741d8b9
commit
30365ca1ad
2 changed files with 22 additions and 3 deletions
|
@ -35,15 +35,15 @@ export default class CallEventGrouper extends EventEmitter {
|
||||||
call: MatrixCall;
|
call: MatrixCall;
|
||||||
state: CallEventGrouperState;
|
state: CallEventGrouperState;
|
||||||
|
|
||||||
public answerCall() {
|
public answerCall = () => {
|
||||||
this.call?.answer();
|
this.call?.answer();
|
||||||
}
|
}
|
||||||
|
|
||||||
public rejectCall() {
|
public rejectCall = () => {
|
||||||
this.call?.reject();
|
this.call?.reject();
|
||||||
}
|
}
|
||||||
|
|
||||||
public callBack() {
|
public callBack = () => {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,25 @@ export default class CallEvent extends React.Component<IProps, IState> {
|
||||||
const sender = event.sender ? event.sender.name : event.getSender();
|
const sender = event.sender ? event.sender.name : event.getSender();
|
||||||
|
|
||||||
let content;
|
let content;
|
||||||
|
if (this.state.callState === CallEventGrouperState.Incoming) {
|
||||||
|
content = (
|
||||||
|
<div className="mx_CallEvent_content">
|
||||||
|
<FormButton
|
||||||
|
className={"mx_IncomingCallBox_decline"}
|
||||||
|
onClick={this.props.callEventGrouper.rejectCall}
|
||||||
|
kind="danger"
|
||||||
|
label={_t("Decline")}
|
||||||
|
/>
|
||||||
|
<div className="mx_IncomingCallBox_spacer" />
|
||||||
|
<FormButton
|
||||||
|
className={"mx_IncomingCallBox_accept"}
|
||||||
|
onClick={this.props.callEventGrouper.answerCall}
|
||||||
|
kind="primary"
|
||||||
|
label={_t("Accept")}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mx_CallEvent">
|
<div className="mx_CallEvent">
|
||||||
|
|
Loading…
Reference in a new issue