From dcffb22eb6535018563514c90331b9b2ce505d0a Mon Sep 17 00:00:00 2001 From: CloudWebRTC Date: Mon, 8 Jan 2024 19:07:07 +0800 Subject: [PATCH] Change publishData signature. (#436) * Change publishData signature. * update. * update. --- lib/src/participant/local.dart | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/src/participant/local.dart b/lib/src/participant/local.dart index de2d9db8a..ab5cce43a 100644 --- a/lib/src/participant/local.dart +++ b/lib/src/participant/local.dart @@ -400,20 +400,23 @@ class LocalParticipant extends Participant { } /// Publish a new data payload to the room. - /// @param destinationSids When empty, data will be forwarded to each participant in the room. + /// @param reliable, when true, data will be sent reliably. + /// @param destinationIdentities When empty, data will be forwarded to each participant in the room. /// @param topic, the topic under which the message gets published. Future publishData( List data, { - Reliability reliability = Reliability.reliable, - List? destinationSids, + bool? reliable, + List? destinationIdentities, String? topic, }) async { final packet = lk_models.DataPacket( - kind: reliability.toPBType(), + kind: reliable == true + ? lk_models.DataPacket_Kind.RELIABLE + : lk_models.DataPacket_Kind.LOSSY, user: lk_models.UserPacket( payload: data, - participantSid: sid, - destinationSids: destinationSids, + participantIdentity: identity, + destinationIdentities: destinationIdentities, topic: topic, ), );