Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Say when a call was answered from a different device #10224

Merged
merged 3 commits into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions res/css/views/messages/_LegacyCallEvent.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ limitations under the License.
flex-wrap: wrap;
align-items: center;
color: $secondary-content;
font-size: $font-12px;
gap: $spacing-12; /* See mx_IncomingLegacyCallToast_buttons */
margin-inline-start: 42px; /* avatar (32px) + mx_LegacyCallEvent_info_basic margin (10px) */
word-break: break-word;
Expand All @@ -168,6 +169,7 @@ limitations under the License.
.mx_LegacyCallEvent_content_button {
@mixin LegacyCallButton;
padding: 0 $spacing-12;
font-size: inherit;

span::before {
mask-size: 16px;
Expand Down
4 changes: 2 additions & 2 deletions src/components/structures/LegacyCallEventGrouper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export function buildLegacyCallEventGroupers(

export default class LegacyCallEventGrouper extends EventEmitter {
private events: Set<MatrixEvent> = new Set<MatrixEvent>();
private call: MatrixCall;
private call: MatrixCall | null = null;
public state: CallState | CustomCallState;

public constructor() {
Expand Down Expand Up @@ -111,7 +111,7 @@ export default class LegacyCallEventGrouper extends EventEmitter {
}

public get hangupReason(): string | null {
return this.hangup?.getContent()?.reason;
return this.call?.hangupReason ?? this.hangup?.getContent()?.reason ?? null;
}

public get rejectParty(): string {
Expand Down
7 changes: 7 additions & 0 deletions src/components/views/messages/LegacyCallEvent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,13 @@ export default class LegacyCallEvent extends React.PureComponent<IProps, IState>
{this.props.timestamp}
</div>
);
} else if (hangupReason === CallErrorCode.AnsweredElsewhere) {
return (
<div className="mx_LegacyCallEvent_content">
{_t("Answered elsewhere")}
{this.props.timestamp}
</div>
);
}

let reason;
Expand Down
1 change: 1 addition & 0 deletions src/i18n/strings/en_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -2351,6 +2351,7 @@
"Call declined": "Call declined",
"Call back": "Call back",
"No answer": "No answer",
"Answered elsewhere": "Answered elsewhere",
"Could not connect media": "Could not connect media",
"Connection failed": "Connection failed",
"Their device couldn't start the camera or microphone": "Their device couldn't start the camera or microphone",
Expand Down