move profileeventenvelope unwrapping to lcg

This commit is contained in:
erinn 2021-03-16 15:51:21 -07:00
parent 62736cefea
commit 98d0e56475
5 changed files with 12 additions and 20 deletions

View File

@ -38,7 +38,7 @@ class CwtchNotifier {
break; break;
case "PeerStateChange": case "PeerStateChange":
ContactInfoState contact = profileCN.getProfile(data["ProfileOnion"]).contactList.getContact(data["RemotePeer"]); ContactInfoState contact = profileCN.getProfile(data["ProfileOnion"]).contactList.getContact(data["RemotePeer"]);
if (contact == null) { if (contact == null) {//todo: stopgap, as lc-g is supposed to handle this
print("PSC -> adding "+data["ProfileOnion"]+" :: " + data["RemotePeer"]); print("PSC -> adding "+data["ProfileOnion"]+" :: " + data["RemotePeer"]);
profileCN.getProfile(data["ProfileOnion"]).contactList.add(ContactInfoState( profileCN.getProfile(data["ProfileOnion"]).contactList.add(ContactInfoState(
profileOnion: data["ProfileOnion"], profileOnion: data["ProfileOnion"],

View File

@ -100,12 +100,7 @@ class CwtchFfi implements Cwtch {
await Isolate.spawn(_checkAppbusEvents, _receivePort.sendPort); await Isolate.spawn(_checkAppbusEvents, _receivePort.sendPort);
_receivePort.listen((message) { _receivePort.listen((message) {
var env = jsonDecode(message); var env = jsonDecode(message);
if (env["EventType"] != null) {//check if env["EventType"] exists cwtchNotifier.handleMessage(env["EventType"], env["Data"]);
cwtchNotifier.handleMessage(env["EventType"], env["Data"]);
} else {//if not, use env["profile"]
env["Event"]["Data"]["ProfileOnion"] = env["Profile"];
cwtchNotifier.handleMessage(env["Event"]["EventType"], env["Event"]["Data"]);
}
}); });
} }

View File

@ -2,6 +2,8 @@
// Generated file. Do not edit. // Generated file. Do not edit.
// //
// clang-format off
#include "generated_plugin_registrant.h" #include "generated_plugin_registrant.h"

View File

@ -2,6 +2,8 @@
// Generated file. Do not edit. // Generated file. Do not edit.
// //
// clang-format off
#ifndef GENERATED_PLUGIN_REGISTRANT_ #ifndef GENERATED_PLUGIN_REGISTRANT_
#define GENERATED_PLUGIN_REGISTRANT_ #define GENERATED_PLUGIN_REGISTRANT_

View File

@ -115,7 +115,7 @@ packages:
name: flutter_lokalise name: flutter_lokalise
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.1.3" version: "0.1.4"
flutter_test: flutter_test:
dependency: "direct dev" dependency: "direct dev"
description: flutter description: flutter
@ -132,7 +132,7 @@ packages:
name: freezed_annotation name: freezed_annotation
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.7.1" version: "0.12.0"
http: http:
dependency: transitive dependency: transitive
description: description:
@ -195,7 +195,7 @@ packages:
name: nested name: nested
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.0.4" version: "1.0.0"
package_info_plus: package_info_plus:
dependency: "direct main" dependency: "direct main"
description: description:
@ -286,7 +286,7 @@ packages:
name: pedantic name: pedantic
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.0" version: "1.11.0"
platform: platform:
dependency: transitive dependency: transitive
description: description:
@ -355,13 +355,6 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0" version: "1.1.0"
string_unescape:
dependency: transitive
description:
name: string_unescape
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.1"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
@ -396,7 +389,7 @@ packages:
name: win32 name: win32
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.0" version: "2.0.4"
xdg_directories: xdg_directories:
dependency: transitive dependency: transitive
description: description:
@ -412,5 +405,5 @@ packages:
source: hosted source: hosted
version: "2.2.1" version: "2.2.1"
sdks: sdks:
dart: ">=2.12.0-259.9.beta <3.0.0" dart: ">=2.12.0 <3.0.0"
flutter: ">=1.20.0" flutter: ">=1.20.0"