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

Commit 4c79ecf

Browse files
authored
Say when a call was answered from a different device (#10224)
* Say when a call was answered from a different device * Adjust font size on call tiles to match designs
1 parent 73de534 commit 4c79ecf

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

res/css/views/messages/_LegacyCallEvent.pcss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ limitations under the License.
160160
flex-wrap: wrap;
161161
align-items: center;
162162
color: $secondary-content;
163+
font-size: $font-12px;
163164
gap: $spacing-12; /* See mx_IncomingLegacyCallToast_buttons */
164165
margin-inline-start: 42px; /* avatar (32px) + mx_LegacyCallEvent_info_basic margin (10px) */
165166
word-break: break-word;
@@ -168,6 +169,7 @@ limitations under the License.
168169
.mx_LegacyCallEvent_content_button {
169170
@mixin LegacyCallButton;
170171
padding: 0 $spacing-12;
172+
font-size: inherit;
171173

172174
span::before {
173175
mask-size: 16px;

src/components/structures/LegacyCallEventGrouper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export function buildLegacyCallEventGroupers(
7272

7373
export default class LegacyCallEventGrouper extends EventEmitter {
7474
private events: Set<MatrixEvent> = new Set<MatrixEvent>();
75-
private call: MatrixCall;
75+
private call: MatrixCall | null = null;
7676
public state: CallState | CustomCallState;
7777

7878
public constructor() {
@@ -111,7 +111,7 @@ export default class LegacyCallEventGrouper extends EventEmitter {
111111
}
112112

113113
public get hangupReason(): string | null {
114-
return this.hangup?.getContent()?.reason;
114+
return this.call?.hangupReason ?? this.hangup?.getContent()?.reason ?? null;
115115
}
116116

117117
public get rejectParty(): string {

src/components/views/messages/LegacyCallEvent.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,13 @@ export default class LegacyCallEvent extends React.PureComponent<IProps, IState>
191191
{this.props.timestamp}
192192
</div>
193193
);
194+
} else if (hangupReason === CallErrorCode.AnsweredElsewhere) {
195+
return (
196+
<div className="mx_LegacyCallEvent_content">
197+
{_t("Answered elsewhere")}
198+
{this.props.timestamp}
199+
</div>
200+
);
194201
}
195202

196203
let reason;

src/i18n/strings/en_EN.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2351,6 +2351,7 @@
23512351
"Call declined": "Call declined",
23522352
"Call back": "Call back",
23532353
"No answer": "No answer",
2354+
"Answered elsewhere": "Answered elsewhere",
23542355
"Could not connect media": "Could not connect media",
23552356
"Connection failed": "Connection failed",
23562357
"Their device couldn't start the camera or microphone": "Their device couldn't start the camera or microphone",

0 commit comments

Comments
 (0)