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

@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { Optional } from "matrix-events-sdk";
import { EventType, MatrixEvent, MsgType, RelationType } from "matrix-js-sdk/src/matrix";
import {
@ -24,10 +25,10 @@ import {
import { mkEvent } from "../../test-utils";
export const mkVoiceBroadcastInfoStateEvent = (
roomId: string,
state: VoiceBroadcastInfoState,
senderId: string,
senderDeviceId: string,
roomId: Optional<string>,
state: Optional<VoiceBroadcastInfoState>,
senderId: Optional<string>,
senderDeviceId: Optional<string>,
startedInfoEvent?: MatrixEvent,
): MatrixEvent => {
const relationContent = {};
@ -41,9 +42,12 @@ export const mkVoiceBroadcastInfoStateEvent = (
return mkEvent({
event: true,
// @ts-ignore allow everything here for edge test cases
room: roomId,
// @ts-ignore allow everything here for edge test cases
user: senderId,
type: VoiceBroadcastInfoEventType,
// @ts-ignore allow everything here for edge test cases
skey: senderId,
content: {
state,