Consider own broadcasts from other device as a playback (#9821)

This commit is contained in:
Michael Weimann 2022-12-23 17:41:18 +01:00 committed by GitHub
parent 32140855fb
commit 6c40e2476a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 49 additions and 29 deletions

View file

@ -16,7 +16,7 @@ limitations under the License.
import { MatrixClient, MatrixEvent } from "matrix-js-sdk/src/matrix";
import { VoiceBroadcastInfoState } from "..";
import { VoiceBroadcastInfoEventContent, VoiceBroadcastInfoState } from "..";
export const shouldDisplayAsVoiceBroadcastRecordingTile = (
state: VoiceBroadcastInfoState,
@ -24,5 +24,10 @@ export const shouldDisplayAsVoiceBroadcastRecordingTile = (
event: MatrixEvent,
): boolean => {
const userId = client.getUserId();
return !!userId && userId === event.getSender() && state !== VoiceBroadcastInfoState.Stopped;
return (
!!userId &&
userId === event.getSender() &&
client.getDeviceId() === event.getContent<VoiceBroadcastInfoEventContent>()?.device_id &&
state !== VoiceBroadcastInfoState.Stopped
);
};