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

This commit is contained in:
Michael Weimann
2022-12-23 16:41:18 +00:00
committed by GitHub
parent 32140855fb
commit 6c40e2476a
3 changed files with 49 additions and 29 deletions
@@ -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
);
};