mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-23 04:00:28 +08:00
tweaks (#1780)
* opt: sized * fix: self send * feat: ctrl enter to send * opt: checked * opt: download notifier * opt: Future.syncValue * mod: account * mod: loading state * opt: DebounceStreamMixin * opt: report * opt: enum map * opt: file handler * opt: dyn color * opt: Uint8List subview * opt: FileExt * opt: computeLuminance * opt: isNullOrEmpty * opt: Get context * update [skip ci] Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me> * opt dynamicColor [skip ci] Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me> * fixes [skip ci] * update Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me> * update Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me> --------- Signed-off-by: My-Responsitories <107370289+My-Responsitories@users.noreply.github.com> Co-authored-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
committed by
GitHub
parent
02e0d34127
commit
ce5e85e64b
@@ -211,11 +211,12 @@ class LiveMessageStream {
|
||||
}
|
||||
|
||||
@pragma('vm:notify-debugger-on-exception')
|
||||
void _processingData(List<int> data) {
|
||||
void _processingData(List<int> value) {
|
||||
try {
|
||||
final subHeader = PackageHeaderRes.fromBytesData(
|
||||
Uint8List.fromList(data),
|
||||
);
|
||||
final Uint8List data = value is Uint8List
|
||||
? value
|
||||
: Uint8List.fromList(value);
|
||||
final subHeader = PackageHeaderRes.fromBytesData(data);
|
||||
if (subHeader != null) {
|
||||
final msgBody = utf8.decode(
|
||||
data.sublist(subHeader.headerSize, subHeader.totalSize),
|
||||
@@ -270,7 +271,7 @@ class LiveMessageStream {
|
||||
void onData(dynamic data) {
|
||||
final header = PackageHeaderRes.fromBytesData(data as Uint8List);
|
||||
if (header != null) {
|
||||
List<int> decompressedData = [];
|
||||
List<int> decompressedData = const [];
|
||||
//心跳包回复不用处理
|
||||
if (header.operationCode == 3) return;
|
||||
if (header.operationCode == 8) {
|
||||
@@ -283,11 +284,13 @@ class LiveMessageStream {
|
||||
_processingData(data);
|
||||
return;
|
||||
case 2:
|
||||
decompressedData = ZLibDecoder().convert(data.sublist(0x10));
|
||||
decompressedData = ZLibDecoder().convert(
|
||||
Uint8List.sublistView(data, 0x10),
|
||||
);
|
||||
break;
|
||||
case 3:
|
||||
decompressedData = const BrotliDecoder().convert(
|
||||
data.sublist(0x10),
|
||||
Uint8List.sublistView(data, 0x10),
|
||||
);
|
||||
//debugPrint('Body: ${utf8.decode()}');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user