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

Commit

Permalink
Say when a call was answered from a different device (#10224)
Browse files Browse the repository at this point in the history
* Say when a call was answered from a different device

* Adjust font size on call tiles to match designs
  • Loading branch information
robintown committed Feb 24, 2023
1 parent 73de534 commit 4c79ecf
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
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

0 comments on commit 4c79ecf

Please sign in to comment.