Skip to content

Commit

Permalink
++
Browse files Browse the repository at this point in the history
  • Loading branch information
littleGnAl committed Oct 12, 2024
1 parent 985c67a commit feb60b1
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 28 deletions.
5 changes: 3 additions & 2 deletions lib/src/bindings/agora_rtm_client_impl_override.dart
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,11 @@ class RtmClientImplOverride extends rtmc_binding.RtmClientImpl {
required String message,
required int length,
required PublishOptions option}) async {
final messageUint8List = Uint8List.fromList(utf8.encode(message));
return publishBinaryMessage(
channelName: channelName,
message: Uint8List.fromList(utf8.encode(message)),
length: length,
message: messageUint8List,
length: messageUint8List.length,
option: option);
}
}
10 changes: 6 additions & 4 deletions lib/src/bindings/agora_stream_channel_impl_override.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ class StreamChannelImpl extends sci_binding.StreamChannelImpl
required String message,
required int length,
required TopicMessageOptions option}) async {
final messageUint8List = Uint8List.fromList(utf8.encode(message));
return publishBinaryMessage(
topic: topic,
message: Uint8List.fromList(utf8.encode(message)),
length: length,
message: messageUint8List,
length: messageUint8List.length,
option: option);
}

Expand All @@ -57,10 +58,11 @@ class StreamChannelImpl extends sci_binding.StreamChannelImpl
required String message,
required int length,
required TopicMessageOptions option}) {
final messageUint8List = Uint8List.fromList(utf8.encode(message));
return publishBinaryMessage(
topic: topic,
message: Uint8List.fromList(utf8.encode(message)),
length: length,
message: messageUint8List,
length: messageUint8List.length,
option: option);
}
}
22 changes: 0 additions & 22 deletions lib/src/impl/agora_rtm_client_impl_override.dart
Original file line number Diff line number Diff line change
Expand Up @@ -222,17 +222,6 @@ class RtmClientImplOverride extends rtm_client_impl.RtmClientImpl {
String channelName, String message,
{RtmChannelType channelType = RtmChannelType.message,
String? customType}) async {
// final option = PublishOptions(
// channelType: channelType,
// messageType: RtmMessageType.string,
// customType: customType);
// final requestId = await nativeBindingRtmClientImpl.publish(
// channelName: channelName,
// message: message,
// length: message.length,
// option: option);
// return rtmResultHandler.request(requestId);

final option = PublishOptions(
channelType: channelType,
messageType: RtmMessageType.string,
Expand Down Expand Up @@ -260,17 +249,6 @@ class RtmClientImplOverride extends rtm_client_impl.RtmClientImpl {
String channelName, Uint8List message,
{RtmChannelType channelType = RtmChannelType.message,
String? customType}) async {
// final option = PublishOptions(
// channelType: channelType,
// messageType: RtmMessageType.binary,
// customType: customType);
// final requestId = await nativeBindingRtmClientImpl.publishBinaryMessage(
// channelName: channelName,
// message: message,
// length: message.length,
// option: option);
// return rtmResultHandler.request(requestId);

final option = PublishOptions(
channelType: channelType,
messageType: RtmMessageType.binary,
Expand Down
Empty file.
Empty file.

0 comments on commit feb60b1

Please sign in to comment.