Merge pull request 'Move status options under profile image in contacts view' (#722) from stable-blockers into trunk
continuous-integration/drone/push Build is failing Details

Reviewed-on: #722
Reviewed-by: Dan Ballard <dan@openprivacy.ca>
This commit is contained in:
Sarah Jamie Lewis 2023-09-18 15:23:02 +00:00
commit 3856591d2f
40 changed files with 407 additions and 84 deletions

View File

@ -8,7 +8,7 @@ clone:
steps: steps:
- name: clone - name: clone
image: openpriv/flutter-desktop:linux-fstable-3.10.2 image: openpriv/flutter-desktop:linux-fstable-3.13.4
environment: environment:
buildbot_key_b64: buildbot_key_b64:
from_secret: buildbot_key_b64 from_secret: buildbot_key_b64
@ -24,7 +24,7 @@ steps:
- git checkout $DRONE_COMMIT - git checkout $DRONE_COMMIT
- name: fetch - name: fetch
image: openpriv/flutter-desktop:linux-fstable-3.10.2 image: openpriv/flutter-desktop:linux-fstable-3.13.4
volumes: volumes:
- name: deps - name: deps
path: /root/.pub-cache path: /root/.pub-cache
@ -47,7 +47,7 @@ steps:
# #Todo: fix all the lint errors and add `-set_exit_status` above to enforce linting # #Todo: fix all the lint errors and add `-set_exit_status` above to enforce linting
- name: build-linux - name: build-linux
image: openpriv/flutter-desktop:linux-fstable-3.10.2 image: openpriv/flutter-desktop:linux-fstable-3.13.4
volumes: volumes:
- name: deps - name: deps
path: /root/.pub-cache path: /root/.pub-cache
@ -62,7 +62,7 @@ steps:
- rm -r cwtch - rm -r cwtch
- name: linux-ui-tests - name: linux-ui-tests
image: openpriv/flutter-desktop:linux-fstable-3.10.2 image: openpriv/flutter-desktop:linux-fstable-3.13.4
volumes: volumes:
- name: deps - name: deps
path: /root/.pub-cache path: /root/.pub-cache
@ -71,7 +71,7 @@ steps:
- ./run-tests-headless.sh "01_general|01_tor|02_global_settings|04_profile_mgmt" - ./run-tests-headless.sh "01_general|01_tor|02_global_settings|04_profile_mgmt"
- name: test-build-android - name: test-build-android
image: openpriv/flutter-desktop:linux-fstable-3.10.2 image: openpriv/flutter-desktop:linux-fstable-3.13.4
when: when:
event: pull_request event: pull_request
volumes: volumes:
@ -81,7 +81,7 @@ steps:
- flutter build apk --debug - flutter build apk --debug
- name: build-android - name: build-android
image: openpriv/flutter-desktop:linux-fstable-3.10.2 image: openpriv/flutter-desktop:linux-fstable-3.13.4
when: when:
event: push event: push
environment: environment:
@ -105,7 +105,7 @@ steps:
#- cp build/app/outputs/flutter-apk/app-debug.apk deploy/android #- cp build/app/outputs/flutter-apk/app-debug.apk deploy/android
- name: widget-tests - name: widget-tests
image: openpriv/flutter-desktop:linux-fstable-3.10.2 image: openpriv/flutter-desktop:linux-fstable-3.13.4
volumes: volumes:
- name: deps - name: deps
path: /root/.pub-cache path: /root/.pub-cache
@ -178,7 +178,7 @@ clone:
steps: steps:
- name: clone - name: clone
image: openpriv/flutter-desktop:windows-sdk30-fstable-3.10.2 image: openpriv/flutter-desktop:windows-sdk30-fstable-3.13.4
environment: environment:
buildbot_key_b64: buildbot_key_b64:
from_secret: buildbot_key_b64 from_secret: buildbot_key_b64
@ -204,7 +204,7 @@ steps:
- .\fetch-libcwtch-go.ps1 - .\fetch-libcwtch-go.ps1
- name: build-windows - name: build-windows
image: openpriv/flutter-desktop:windows-sdk30-fstable-3.10.2 image: openpriv/flutter-desktop:windows-sdk30-fstable-3.13.4
commands: commands:
- flutter pub get - flutter pub get
- $Env:version += type .\VERSION - $Env:version += type .\VERSION
@ -261,7 +261,7 @@ steps:
- move *.sha512.txt deploy\$Env:builddir - move *.sha512.txt deploy\$Env:builddir
- name: deploy-windows - name: deploy-windows
image: openpriv/flutter-desktop:windows-sdk30-fstable-3.10.2 image: openpriv/flutter-desktop:windows-sdk30-fstable-3.13.4
when: when:
event: push event: push
status: [ success ] status: [ success ]

View File

@ -1 +1 @@
2023-08-31-11-56-v0.0.6-2-gf32ad74 2023-09-18-08-09-v0.0.6-5-gf936166

View File

@ -390,8 +390,21 @@ class MainActivity: FlutterActivity() {
val onion: String = call.argument("onion") ?: "" val onion: String = call.argument("onion") ?: ""
Cwtch.peerWithOnion(profile, onion) Cwtch.peerWithOnion(profile, onion)
} }
"QueueJoinServer" -> {
val profile: String = call.argument("ProfileOnion") ?: ""
val onion: String = call.argument("onion") ?: ""
Cwtch.peerWithOnion(profile, onion)
}
"DisconnectFromPeer" -> {
val profile: String = call.argument("ProfileOnion") ?: ""
val onion: String = call.argument("onion") ?: ""
Cwtch.peerWithOnion(profile, onion)
}
"DisconnectFromServer" -> {
val profile: String = call.argument("ProfileOnion") ?: ""
val onion: String = call.argument("onion") ?: ""
Cwtch.peerWithOnion(profile, onion)
}
"CreateProfile" -> { "CreateProfile" -> {
val nick: String = call.argument("nick") ?: "" val nick: String = call.argument("nick") ?: ""
val pass: String = call.argument("pass") ?: "" val pass: String = call.argument("pass") ?: ""
@ -406,6 +419,13 @@ class MainActivity: FlutterActivity() {
val profile: String = call.argument("profile") ?: "" val profile: String = call.argument("profile") ?: ""
Cwtch.activatePeerEngine(profile) Cwtch.activatePeerEngine(profile)
} }
"ConfigureConnections" -> {
val profile: String = call.argument("profile") ?: ""
val listen: Boolean = call.argument("listen") ?: false
val peers: Boolean = call.argument("peers") ?: false
val servers: Boolean = call.argument("servers") ?: false
Cwtch.configureConnections(profile, listen, peers, servers)
}
"DeactivatePeerEngine" -> { "DeactivatePeerEngine" -> {
val profile: String = call.argument("profile") ?: "" val profile: String = call.argument("profile") ?: ""
Cwtch.deactivatePeerEngine(profile) Cwtch.deactivatePeerEngine(profile)

View File

@ -46,6 +46,9 @@ abstract class Cwtch {
void UnblockContact(String profileOnion, int contactHandle); void UnblockContact(String profileOnion, int contactHandle);
void AttemptReconnection(String profileOnion, String onion); void AttemptReconnection(String profileOnion, String onion);
void AttemptReconnectionServer(String profileOnion, String onion);
void DisconnectFromPeer(String profileOnion, String onion);
void DisconnectFromServer(String profileOnion, String onion);
// ignore: non_constant_identifier_names // ignore: non_constant_identifier_names
Future<dynamic> GetMessage(String profile, int handle, int index); Future<dynamic> GetMessage(String profile, int handle, int index);
@ -151,4 +154,6 @@ abstract class Cwtch {
// ignore: non_constant_identifier_names // ignore: non_constant_identifier_names
Future<String> SearchConversations(String profile, String pattern); Future<String> SearchConversations(String profile, String pattern);
void DeleteServerInfo(String profile, String handle); void DeleteServerInfo(String profile, String handle);
void ConfigureConnections(String onion, bool listen, bool peers, bool servers);
} }

View File

@ -70,8 +70,18 @@ class CwtchNotifier {
case "NewPeer": case "NewPeer":
// EnvironmentConfig.debugLog("NewPeer $data"); // EnvironmentConfig.debugLog("NewPeer $data");
// if tag != v1-defaultPassword then it is either encrypted OR it is an unencrypted account created during pre-beta... // if tag != v1-defaultPassword then it is either encrypted OR it is an unencrypted account created during pre-beta...
profileCN.add(data["Identity"], data["name"], data["picture"], data["defaultPicture"], data["ContactsJson"], data["ServerList"], data["Online"] == "true", data["autostart"] == "true", profileCN.add(
data["tag"] != "v1-defaultPassword"); data["Identity"],
data["name"],
data["picture"],
data["defaultPicture"],
data["ContactsJson"],
data["ServerList"],
data["Online"] == "true",
data["autostart"] == "true",
data["tag"] != "v1-defaultPassword",
data["appearOffline"] == "true",
);
// Update Profile Attributes // Update Profile Attributes
EnvironmentConfig.debugLog("Looking up Profile Attributes ${data["Identity"]} ${profileCN.getProfile(data["Identity"])}"); EnvironmentConfig.debugLog("Looking up Profile Attributes ${data["Identity"]} ${profileCN.getProfile(data["Identity"])}");

View File

@ -45,6 +45,9 @@ typedef VoidFromStringIntStringStringStringFn = void Function(Pointer<Utf8>, int
typedef void_from_string_string_int_int_function = Void Function(Pointer<Utf8>, Int32, Pointer<Utf8>, Int32, Int64, Int64); typedef void_from_string_string_int_int_function = Void Function(Pointer<Utf8>, Int32, Pointer<Utf8>, Int32, Int64, Int64);
typedef VoidFromStringStringIntIntFn = void Function(Pointer<Utf8>, int, Pointer<Utf8>, int, int, int); typedef VoidFromStringStringIntIntFn = void Function(Pointer<Utf8>, int, Pointer<Utf8>, int, int, int);
typedef void_from_string_bool_bool_bool = Void Function(Pointer<Utf8>, Int32, Bool, Bool, Bool);
typedef VoidFromStringBoolBoolBool = void Function(Pointer<Utf8>, int, bool, bool, bool);
typedef void_from_string_string_byte_function = Void Function(Pointer<Utf8>, Int32, Pointer<Utf8>, Int32, Int8); typedef void_from_string_string_byte_function = Void Function(Pointer<Utf8>, Int32, Pointer<Utf8>, Int32, Int8);
typedef VoidFromStringStringByteFn = void Function(Pointer<Utf8>, int, Pointer<Utf8>, int, int); typedef VoidFromStringStringByteFn = void Function(Pointer<Utf8>, int, Pointer<Utf8>, int, int);
@ -1041,6 +1044,42 @@ class CwtchFfi implements Cwtch {
malloc.free(utf8onion); malloc.free(utf8onion);
} }
@override
void AttemptReconnectionServer(String profile, String onion) {
// ignore: non_constant_identifier_names
var queueJoinServerC = library.lookup<NativeFunction<void_from_string_string_function>>("c_QueueJoinServer");
final QueueJoinServerC = queueJoinServerC.asFunction<VoidFromStringStringFn>();
final utf8profile = profile.toNativeUtf8();
final utf8onion = onion.toNativeUtf8();
QueueJoinServerC(utf8profile, utf8profile.length, utf8onion, utf8onion.length);
malloc.free(utf8profile);
malloc.free(utf8onion);
}
@override
void DisconnectFromPeer(String profile, String onion) {
// ignore: non_constant_identifier_names
var disconnectFromPeerC = library.lookup<NativeFunction<void_from_string_string_function>>("c_DisconnectFromPeer");
final DisconnectFromPeerC = disconnectFromPeerC.asFunction<VoidFromStringStringFn>();
final utf8profile = profile.toNativeUtf8();
final utf8onion = onion.toNativeUtf8();
DisconnectFromPeerC(utf8profile, utf8profile.length, utf8onion, utf8onion.length);
malloc.free(utf8profile);
malloc.free(utf8onion);
}
@override
void DisconnectFromServer(String profile, String onion) {
// ignore: non_constant_identifier_names
var disconnectFromServerC = library.lookup<NativeFunction<void_from_string_string_function>>("c_DisconnectFromServer");
final DisconnectFromServerC = disconnectFromServerC.asFunction<VoidFromStringStringFn>();
final utf8profile = profile.toNativeUtf8();
final utf8onion = onion.toNativeUtf8();
DisconnectFromServerC(utf8profile, utf8profile.length, utf8onion, utf8onion.length);
malloc.free(utf8profile);
malloc.free(utf8onion);
}
@override @override
Future<String> SearchConversations(String profile, String pattern) async { Future<String> SearchConversations(String profile, String pattern) async {
var searchConversationsC = library.lookup<NativeFunction<string_string_to_string_function>>("c_SearchConversations"); var searchConversationsC = library.lookup<NativeFunction<string_string_to_string_function>>("c_SearchConversations");
@ -1061,4 +1100,15 @@ class CwtchFfi implements Cwtch {
Future<HashMap<String, String>> PlatformChannelInfo() { Future<HashMap<String, String>> PlatformChannelInfo() {
return Future.value(HashMap<String, String>()); return Future.value(HashMap<String, String>());
} }
@override
void ConfigureConnections(String profile, bool listen, bool peers, bool servers) {
var configureConnections = library.lookup<NativeFunction<void_from_string_bool_bool_bool>>("c_ConfigureConnections");
// ignore: non_constant_identifier_names
final ConfigureConnections = configureConnections.asFunction<VoidFromStringBoolBoolBool>();
final utf8profile = profile.toNativeUtf8();
ConfigureConnections(utf8profile, utf8profile.length, listen, peers, servers);
malloc.free(utf8profile);
return;
}
} }

View File

@ -439,8 +439,28 @@ class CwtchGomobile implements Cwtch {
cwtchPlatform.invokeMethod("PeerWithOnion", {"ProfileOnion": profile, "onion": onion}); cwtchPlatform.invokeMethod("PeerWithOnion", {"ProfileOnion": profile, "onion": onion});
} }
@override
void AttemptReconnectionServer(String profile, String onion) {
cwtchPlatform.invokeMethod("QueueJoinServer", {"ProfileOnion": profile, "onion": onion});
}
@override
void DisconnectFromPeer(String profile, String onion) {
cwtchPlatform.invokeMethod("DisconnectFromPeer", {"ProfileOnion": profile, "onion": onion});
}
@override
void DisconnectFromServer(String profile, String onion) {
cwtchPlatform.invokeMethod("DisconnectFromServer", {"ProfileOnion": profile, "onion": onion});
}
@override @override
Future<String> SearchConversations(String profile, String pattern) async { Future<String> SearchConversations(String profile, String pattern) async {
return await cwtchPlatform.invokeMethod("SearchConversations", {"ProfileOnion": profile, "pattern": pattern}); return await cwtchPlatform.invokeMethod("SearchConversations", {"ProfileOnion": profile, "pattern": pattern});
} }
@override
void ConfigureConnections(String profile, bool listen, bool peers, bool servers) {
cwtchPlatform.invokeMethod("ConfigureConnections", {"ProfileOnion": profile, "listen": listen, "peers": peers, "servers": servers});
}
} }

View File

@ -644,4 +644,8 @@ class MaterialLocalizationLu extends MaterialLocalizations {
// TODO: implement scrimOnTapHint // TODO: implement scrimOnTapHint
throw UnimplementedError(); throw UnimplementedError();
} }
@override
// TODO: implement scanTextButtonLabel
String get scanTextButtonLabel => throw UnimplementedError();
} }

View File

@ -1,6 +1,9 @@
{ {
"@@locale": "cy", "@@locale": "cy",
"@@last_modified": "2023-08-21T19:40:19+02:00", "@@last_modified": "2023-09-13T18:51:59+02:00",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",
"deleteServerConfirmBtn": "Mewn gwirionedd dileu gweinydd", "deleteServerConfirmBtn": "Mewn gwirionedd dileu gweinydd",
"cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.", "cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.",
"groupsOnThisServerLabel": "Grwpiau rydw i'n eu cynnal ar y gweinydd hwn", "groupsOnThisServerLabel": "Grwpiau rydw i'n eu cynnal ar y gweinydd hwn",

View File

@ -1,6 +1,9 @@
{ {
"@@locale": "da", "@@locale": "da",
"@@last_modified": "2023-08-21T19:40:19+02:00", "@@last_modified": "2023-09-13T18:51:59+02:00",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",
"deleteServerConfirmBtn": "Ja fjern server", "deleteServerConfirmBtn": "Ja fjern server",
"cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.", "cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.",
"groupsOnThisServerLabel": "Grupper som jeg er vært for på denne server", "groupsOnThisServerLabel": "Grupper som jeg er vært for på denne server",

View File

@ -1,6 +1,9 @@
{ {
"@@locale": "de", "@@locale": "de",
"@@last_modified": "2023-08-21T19:40:19+02:00", "@@last_modified": "2023-09-13T18:51:59+02:00",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",
"deleteServerConfirmBtn": "Server wirklich löschen", "deleteServerConfirmBtn": "Server wirklich löschen",
"cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.", "cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.",
"groupsOnThisServerLabel": "Gruppen, in denen ich bin, werden auf diesem Server gehostet", "groupsOnThisServerLabel": "Gruppen, in denen ich bin, werden auf diesem Server gehostet",

View File

@ -1,6 +1,9 @@
{ {
"@@locale": "el", "@@locale": "el",
"@@last_modified": "2023-08-21T19:40:19+02:00", "@@last_modified": "2023-09-13T18:51:59+02:00",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",
"deleteServerConfirmBtn": "Really Delete Server?", "deleteServerConfirmBtn": "Really Delete Server?",
"cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.", "cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.",
"groupsOnThisServerLabel": "Known Groups on this Cwtch Server", "groupsOnThisServerLabel": "Known Groups on this Cwtch Server",

View File

@ -1,6 +1,9 @@
{ {
"@@locale": "en", "@@locale": "en",
"@@last_modified": "2023-08-21T19:40:19+02:00", "@@last_modified": "2023-09-13T18:51:59+02:00",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",
"deleteServerConfirmBtn": "Really Delete Server?", "deleteServerConfirmBtn": "Really Delete Server?",
"cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.", "cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.",
"groupsOnThisServerLabel": "Known Groups on this Cwtch Server", "groupsOnThisServerLabel": "Known Groups on this Cwtch Server",

View File

@ -1,6 +1,9 @@
{ {
"@@locale": "es", "@@locale": "es",
"@@last_modified": "2023-08-21T19:40:19+02:00", "@@last_modified": "2023-09-13T18:51:59+02:00",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",
"deleteServerConfirmBtn": "Realmente eliminar el servidor", "deleteServerConfirmBtn": "Realmente eliminar el servidor",
"cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.", "cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.",
"groupsOnThisServerLabel": "Grupos alojados en este servidor en los que estoy", "groupsOnThisServerLabel": "Grupos alojados en este servidor en los que estoy",

View File

@ -1,6 +1,9 @@
{ {
"@@locale": "fr", "@@locale": "fr",
"@@last_modified": "2023-08-21T19:40:19+02:00", "@@last_modified": "2023-09-13T18:51:59+02:00",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",
"deleteServerConfirmBtn": "Supprimer vraiment le serveur", "deleteServerConfirmBtn": "Supprimer vraiment le serveur",
"cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.", "cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.",
"groupsOnThisServerLabel": "Les groupes dont je fais partie sont hébergés sur ce serveur", "groupsOnThisServerLabel": "Les groupes dont je fais partie sont hébergés sur ce serveur",

View File

@ -1,6 +1,9 @@
{ {
"@@locale": "it", "@@locale": "it",
"@@last_modified": "2023-08-21T19:40:19+02:00", "@@last_modified": "2023-09-13T18:51:59+02:00",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",
"deleteServerConfirmBtn": "Elimina davvero il server", "deleteServerConfirmBtn": "Elimina davvero il server",
"cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.", "cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.",
"groupsOnThisServerLabel": "Gruppi di cui sono parte su questo server", "groupsOnThisServerLabel": "Gruppi di cui sono parte su questo server",

View File

@ -1,6 +1,9 @@
{ {
"@@locale": "ja", "@@locale": "ja",
"@@last_modified": "2023-08-21T19:40:19+02:00", "@@last_modified": "2023-09-13T18:51:59+02:00",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",
"deleteServerConfirmBtn": "Really Delete Server?", "deleteServerConfirmBtn": "Really Delete Server?",
"cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.", "cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.",
"groupsOnThisServerLabel": "Known Groups on this Cwtch Server", "groupsOnThisServerLabel": "Known Groups on this Cwtch Server",

View File

@ -1,6 +1,9 @@
{ {
"@@locale": "ko", "@@locale": "ko",
"@@last_modified": "2023-08-21T19:40:19+02:00", "@@last_modified": "2023-09-13T18:51:59+02:00",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",
"deleteServerConfirmBtn": "Really Delete Server?", "deleteServerConfirmBtn": "Really Delete Server?",
"cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.", "cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.",
"groupsOnThisServerLabel": "Known Groups on this Cwtch Server", "groupsOnThisServerLabel": "Known Groups on this Cwtch Server",

View File

@ -1,6 +1,9 @@
{ {
"@@locale": "lb", "@@locale": "lb",
"@@last_modified": "2023-08-21T19:40:19+02:00", "@@last_modified": "2023-09-13T18:51:59+02:00",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",
"deleteServerConfirmBtn": "Really Delete Server?", "deleteServerConfirmBtn": "Really Delete Server?",
"cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.", "cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.",
"groupsOnThisServerLabel": "Known Groups on this Cwtch Server", "groupsOnThisServerLabel": "Known Groups on this Cwtch Server",

View File

@ -1,6 +1,9 @@
{ {
"@@locale": "nl", "@@locale": "nl",
"@@last_modified": "2023-08-21T19:40:19+02:00", "@@last_modified": "2023-09-13T18:51:59+02:00",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",
"deleteServerConfirmBtn": "Server echt verwijderen", "deleteServerConfirmBtn": "Server echt verwijderen",
"cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.", "cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.",
"groupsOnThisServerLabel": "Groepen waarin ik zit gehost op deze server", "groupsOnThisServerLabel": "Groepen waarin ik zit gehost op deze server",

View File

@ -1,6 +1,9 @@
{ {
"@@locale": "no", "@@locale": "no",
"@@last_modified": "2023-08-21T19:40:19+02:00", "@@last_modified": "2023-09-13T18:51:59+02:00",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",
"deleteServerConfirmBtn": "Slette tjener", "deleteServerConfirmBtn": "Slette tjener",
"cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.", "cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.",
"groupsOnThisServerLabel": "Grupper jeg er vert for på denne tjeneren", "groupsOnThisServerLabel": "Grupper jeg er vert for på denne tjeneren",

View File

@ -1,6 +1,9 @@
{ {
"@@locale": "pl", "@@locale": "pl",
"@@last_modified": "2023-08-21T19:40:19+02:00", "@@last_modified": "2023-09-13T18:51:59+02:00",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",
"deleteServerConfirmBtn": "Usuń", "deleteServerConfirmBtn": "Usuń",
"cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.", "cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.",
"groupsOnThisServerLabel": "Grupy na tym serwerze, których jesteś członkiem", "groupsOnThisServerLabel": "Grupy na tym serwerze, których jesteś członkiem",

View File

@ -1,6 +1,9 @@
{ {
"@@locale": "pt", "@@locale": "pt",
"@@last_modified": "2023-08-21T19:40:19+02:00", "@@last_modified": "2023-09-13T18:51:59+02:00",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",
"deleteServerConfirmBtn": "Really Delete Server?", "deleteServerConfirmBtn": "Really Delete Server?",
"cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.", "cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.",
"groupsOnThisServerLabel": "Known Groups on this Cwtch Server", "groupsOnThisServerLabel": "Known Groups on this Cwtch Server",

View File

@ -1,6 +1,9 @@
{ {
"@@locale": "pt_BR", "@@locale": "pt_BR",
"@@last_modified": "2023-08-21T19:40:19+02:00", "@@last_modified": "2023-09-13T18:51:59+02:00",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",
"deleteServerConfirmBtn": "Realmente excluir servidor", "deleteServerConfirmBtn": "Realmente excluir servidor",
"cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.", "cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.",
"groupsOnThisServerLabel": "Grupos nos quais estou hospedado neste servidor", "groupsOnThisServerLabel": "Grupos nos quais estou hospedado neste servidor",

View File

@ -1,6 +1,9 @@
{ {
"@@locale": "ro", "@@locale": "ro",
"@@last_modified": "2023-08-21T19:40:19+02:00", "@@last_modified": "2023-09-13T18:51:59+02:00",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",
"deleteServerConfirmBtn": "Sigur doriți sa ștergeți serverul", "deleteServerConfirmBtn": "Sigur doriți sa ștergeți serverul",
"cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.", "cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.",
"groupsOnThisServerLabel": "Grupurile în care mă aflu care sunt găzduite pe acest server", "groupsOnThisServerLabel": "Grupurile în care mă aflu care sunt găzduite pe acest server",

View File

@ -1,6 +1,9 @@
{ {
"@@locale": "ru", "@@locale": "ru",
"@@last_modified": "2023-08-21T19:40:19+02:00", "@@last_modified": "2023-09-13T18:51:59+02:00",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",
"deleteServerConfirmBtn": "Вы точно хотите удалить сервер?", "deleteServerConfirmBtn": "Вы точно хотите удалить сервер?",
"cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.", "cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.",
"groupsOnThisServerLabel": "Группы, в которых я нахожусь, размещены на этом сервере", "groupsOnThisServerLabel": "Группы, в которых я нахожусь, размещены на этом сервере",

View File

@ -1,6 +1,9 @@
{ {
"@@locale": "sk", "@@locale": "sk",
"@@last_modified": "2023-08-21T19:40:19+02:00", "@@last_modified": "2023-09-13T18:51:59+02:00",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",
"deleteServerConfirmBtn": "Vážne vymazať server?", "deleteServerConfirmBtn": "Vážne vymazať server?",
"cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.", "cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.",
"groupsOnThisServerLabel": "Skupiny ktorých som členom a sú hostované na tomto servery", "groupsOnThisServerLabel": "Skupiny ktorých som členom a sú hostované na tomto servery",

View File

@ -1,6 +1,9 @@
{ {
"@@locale": "sv", "@@locale": "sv",
"@@last_modified": "2023-08-21T19:40:19+02:00", "@@last_modified": "2023-09-13T18:51:59+02:00",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",
"deleteServerConfirmBtn": "Bekräfta borttagning av servern", "deleteServerConfirmBtn": "Bekräfta borttagning av servern",
"cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.", "cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.",
"groupsOnThisServerLabel": "Grupper jag är med i på den här servern", "groupsOnThisServerLabel": "Grupper jag är med i på den här servern",

View File

@ -1,6 +1,9 @@
{ {
"@@locale": "sw", "@@locale": "sw",
"@@last_modified": "2023-08-21T19:40:19+02:00", "@@last_modified": "2023-09-13T18:51:59+02:00",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",
"deleteServerConfirmBtn": "Futa kabisa seva", "deleteServerConfirmBtn": "Futa kabisa seva",
"cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.", "cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.",
"groupsOnThisServerLabel": "Vikundi nilivyopangishwa kwenye seva hii", "groupsOnThisServerLabel": "Vikundi nilivyopangishwa kwenye seva hii",

View File

@ -1,6 +1,9 @@
{ {
"@@locale": "tr", "@@locale": "tr",
"@@last_modified": "2023-08-21T19:40:19+02:00", "@@last_modified": "2023-09-13T18:51:59+02:00",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",
"deleteServerConfirmBtn": "Sunucuyu gerçekten sil", "deleteServerConfirmBtn": "Sunucuyu gerçekten sil",
"cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.", "cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.",
"groupsOnThisServerLabel": "Bu sunucuda içinde bulunduğum gruplar", "groupsOnThisServerLabel": "Bu sunucuda içinde bulunduğum gruplar",

View File

@ -1,6 +1,9 @@
{ {
"@@locale": "uk", "@@locale": "uk",
"@@last_modified": "2023-08-21T19:40:19+02:00", "@@last_modified": "2023-09-13T18:51:59+02:00",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",
"deleteServerConfirmBtn": "Really Delete Server?", "deleteServerConfirmBtn": "Really Delete Server?",
"cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.", "cannotDeleteServerIfActiveGroups": "There are active groups associated with this Cwtch Server. Please delete them prior to deleting this Cwtch Server entry.",
"groupsOnThisServerLabel": "Known Groups on this Cwtch Server", "groupsOnThisServerLabel": "Known Groups on this Cwtch Server",

View File

@ -70,6 +70,9 @@ class ContactInfoState extends ChangeNotifier {
var _hoveredIndex = -1; var _hoveredIndex = -1;
var _pendingScroll = -1; var _pendingScroll = -1;
DateTime _lastRetryTime = DateTime.now();
DateTime loaded = DateTime.now();
ContactInfoState( ContactInfoState(
this.profileOnion, this.profileOnion,
this.identifier, this.identifier,
@ -124,6 +127,12 @@ class ContactInfoState extends ChangeNotifier {
MessageDraft get messageDraft => this._messageDraft; MessageDraft get messageDraft => this._messageDraft;
DateTime get lastRetryTime => this._lastRetryTime;
set lastRetryTime(DateTime lastRetryTime) {
this._lastRetryTime = lastRetryTime;
notifyListeners();
}
set antispamTickets(int antispamTickets) { set antispamTickets(int antispamTickets) {
this._antispamTickets = antispamTickets; this._antispamTickets = antispamTickets;
notifyListeners(); notifyListeners();
@ -422,6 +431,9 @@ class ContactInfoState extends ChangeNotifier {
return theme.portraitOnlineAwayColor; return theme.portraitOnlineAwayColor;
case ProfileStatusMenu.busy: case ProfileStatusMenu.busy:
return theme.portraitOnlineBusyColor; return theme.portraitOnlineBusyColor;
default:
// noop not a valid status...
break;
} }
} }
return theme.portraitOfflineBorderColor; return theme.portraitOfflineBorderColor;
@ -453,6 +465,8 @@ class ContactInfoState extends ChangeNotifier {
return AppLocalizations.of(context)!.availabilityStatusAway; return AppLocalizations.of(context)!.availabilityStatusAway;
case ProfileStatusMenu.busy: case ProfileStatusMenu.busy:
return AppLocalizations.of(context)!.availabilityStatusBusy; return AppLocalizations.of(context)!.availabilityStatusBusy;
default:
throw UnimplementedError("not a valid status");
} }
} }
} }

View File

@ -4,8 +4,10 @@ import 'package:cwtch/config.dart';
import 'package:cwtch/models/remoteserver.dart'; import 'package:cwtch/models/remoteserver.dart';
import 'package:cwtch/models/search.dart'; import 'package:cwtch/models/search.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:provider/provider.dart';
import 'package:scrollable_positioned_list/scrollable_positioned_list.dart'; import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';
import '../main.dart';
import '../themes/opaque.dart'; import '../themes/opaque.dart';
import '../views/contactsview.dart'; import '../views/contactsview.dart';
import 'contact.dart'; import 'contact.dart';
@ -33,6 +35,7 @@ class ProfileInfoState extends ChangeNotifier {
bool _autostart = true; bool _autostart = true;
bool _enabled = false; bool _enabled = false;
bool _appearOffline = false;
ProfileInfoState({ ProfileInfoState({
required this.onion, required this.onion,
@ -45,6 +48,7 @@ class ProfileInfoState extends ChangeNotifier {
online = false, online = false,
autostart = true, autostart = true,
encrypted = true, encrypted = true,
appearOffline = false,
String, String,
}) { }) {
this._nickname = nickname; this._nickname = nickname;
@ -57,6 +61,7 @@ class ProfileInfoState extends ChangeNotifier {
if (autostart) { if (autostart) {
this._enabled = true; this._enabled = true;
} }
this._appearOffline = appearOffline;
this._encrypted = encrypted; this._encrypted = encrypted;
_contacts.connectServers(this._servers); _contacts.connectServers(this._servers);
@ -175,12 +180,17 @@ class ProfileInfoState extends ChangeNotifier {
} }
bool get autostart => this._autostart; bool get autostart => this._autostart;
set autostart(bool newVal) { set autostart(bool newVal) {
this._autostart = newVal; this._autostart = newVal;
notifyListeners(); notifyListeners();
} }
bool get appearOffline => this._appearOffline;
set appearOffline(bool newVal) {
this._appearOffline = newVal;
notifyListeners();
}
String get defaultImagePath => this._defaultImagePath; String get defaultImagePath => this._defaultImagePath;
set defaultImagePath(String newVal) { set defaultImagePath(String newVal) {
@ -464,6 +474,21 @@ class ProfileInfoState extends ChangeNotifier {
return theme.portraitOnlineAwayColor; return theme.portraitOnlineAwayColor;
case ProfileStatusMenu.busy: case ProfileStatusMenu.busy:
return theme.portraitOnlineBusyColor; return theme.portraitOnlineBusyColor;
default:
throw UnimplementedError("not a valid status");
} }
} }
// during deactivation it is possible that the event bus is cleaned up prior to statuses being updated
// this method nicely cleans up our current state so that the UI functions as expected.
// FIXME: Cwtch should be sending these events prior to shutting down the engine...
void deactivatePeerEngine(BuildContext context) {
Provider.of<FlwtchState>(context, listen: false).cwtch.DeactivatePeerEngine(onion);
this.contactList.contacts.forEach((element) {
element.status = "Disconnected";
});
this.serverList.servers.forEach((element) {
element.status = "Disconnected";
});
}
} }

View File

@ -10,7 +10,7 @@ class ProfileListState extends ChangeNotifier {
List<ProfileInfoState> _profiles = []; List<ProfileInfoState> _profiles = [];
int get num => _profiles.length; int get num => _profiles.length;
void add(String onion, String name, String picture, String defaultPicture, String contactsJson, String serverJson, bool online, bool autostart, bool encrypted) { void add(String onion, String name, String picture, String defaultPicture, String contactsJson, String serverJson, bool online, bool autostart, bool encrypted, bool appearOffline) {
var idx = _profiles.indexWhere((element) => element.onion == onion); var idx = _profiles.indexWhere((element) => element.onion == onion);
if (idx == -1) { if (idx == -1) {
_profiles.add(ProfileInfoState( _profiles.add(ProfileInfoState(
@ -22,7 +22,8 @@ class ProfileListState extends ChangeNotifier {
serversJson: serverJson, serversJson: serverJson,
online: online, online: online,
autostart: autostart, autostart: autostart,
encrypted: encrypted)); encrypted: encrypted,
appearOffline: appearOffline));
} else { } else {
_profiles[idx].updateFrom(onion, name, picture, contactsJson, serverJson, online); _profiles[idx].updateFrom(onion, name, picture, contactsJson, serverJson, online);
} }

View File

@ -192,7 +192,7 @@ ThemeData mkThemeData(Settings opaque) {
), ),
), ),
scrollbarTheme: ScrollbarThemeData(isAlwaysShown: false, thumbColor: MaterialStateProperty.all(opaque.current().scrollbarDefaultColor)), scrollbarTheme: ScrollbarThemeData(thumbVisibility: MaterialStateProperty.all(false), thumbColor: MaterialStateProperty.all(opaque.current().scrollbarDefaultColor)),
tabBarTheme: TabBarTheme( tabBarTheme: TabBarTheme(
labelColor: opaque.current().mainTextColor, labelColor: opaque.current().mainTextColor,
unselectedLabelColor: opaque.current().mainTextColor, unselectedLabelColor: opaque.current().mainTextColor,

View File

@ -234,11 +234,14 @@ class _AddEditProfileViewState extends State<AddEditProfileView> {
subtitle: Text(AppLocalizations.of(context)!.profileEnabledDescription), subtitle: Text(AppLocalizations.of(context)!.profileEnabledDescription),
value: Provider.of<ProfileInfoState>(context).enabled, value: Provider.of<ProfileInfoState>(context).enabled,
onChanged: (bool value) { onChanged: (bool value) {
Provider.of<ProfileInfoState>(context).enabled = value; Provider.of<ProfileInfoState>(context, listen: false).enabled = value;
if (value) { if (value) {
Provider.of<FlwtchState>(context, listen: false).cwtch.ActivatePeerEngine(Provider.of<ProfileInfoState>(context).onion); Provider.of<FlwtchState>(context, listen: false).cwtch.ActivatePeerEngine(Provider.of<ProfileInfoState>(context, listen: false).onion);
if (Provider.of<ProfileInfoState>(context, listen: false).appearOffline == false) {
Provider.of<FlwtchState>(context, listen: false).cwtch.ConfigureConnections(Provider.of<ProfileInfoState>(context, listen: false).onion, true, true, true);
}
} else { } else {
Provider.of<FlwtchState>(context, listen: false).cwtch.DeactivatePeerEngine(Provider.of<ProfileInfoState>(context).onion); Provider.of<ProfileInfoState>(context, listen: false).deactivatePeerEngine(context);
} }
}, },
activeTrackColor: Provider.of<Settings>(context).theme.defaultButtonColor, activeTrackColor: Provider.of<Settings>(context).theme.defaultButtonColor,
@ -252,12 +255,35 @@ class _AddEditProfileViewState extends State<AddEditProfileView> {
subtitle: Text(AppLocalizations.of(context)!.profileAutostartDescription), subtitle: Text(AppLocalizations.of(context)!.profileAutostartDescription),
value: Provider.of<ProfileInfoState>(context).autostart, value: Provider.of<ProfileInfoState>(context).autostart,
onChanged: (bool value) { onChanged: (bool value) {
Provider.of<ProfileInfoState>(context).autostart = value; Provider.of<ProfileInfoState>(context, listen: false).autostart = value;
if (!Provider.of<ProfileInfoState>(context).onion.isEmpty) { if (!Provider.of<ProfileInfoState>(context, listen: false).onion.isEmpty) {
Provider.of<FlwtchState>(context, listen: false) Provider.of<FlwtchState>(context, listen: false)
.cwtch .cwtch
.SetProfileAttribute(Provider.of<ProfileInfoState>(context).onion, "profile.autostart", value ? "true" : "false"); .SetProfileAttribute(Provider.of<ProfileInfoState>(context, listen: false).onion, "profile.autostart", value ? "true" : "false");
}
},
activeTrackColor: Provider.of<Settings>(context).theme.defaultButtonColor,
inactiveTrackColor: Provider.of<Settings>(context).theme.defaultButtonDisabledColor,
secondary: Icon(CwtchIcons.favorite_24dp, color: Provider.of<Settings>(context).current().mainTextColor),
),
// Auto start
SwitchListTile(
title: Text(AppLocalizations.of(context)!.profileAppearOffline, style: TextStyle(color: Provider.of<Settings>(context).current().mainTextColor)),
subtitle: Text(AppLocalizations.of(context)!.profileAppearOfflineDescription),
value: Provider.of<ProfileInfoState>(context).appearOffline,
onChanged: (bool value) {
Provider.of<ProfileInfoState>(context, listen: false).appearOffline = value;
var onion = Provider.of<ProfileInfoState>(context, listen: false).onion;
if (!onion.isEmpty) {
Provider.of<FlwtchState>(context, listen: false).cwtch.SetProfileAttribute(onion, "profile.appear-offline", value ? "true" : "false");
// if the profile is already enabled, then cycle the peer engine...
if (value == true && Provider.of<ProfileInfoState>(context, listen: false).enabled) {
Provider.of<ProfileInfoState>(context, listen: false).deactivatePeerEngine(context);
Provider.of<FlwtchState>(context, listen: false).cwtch.ActivatePeerEngine(onion);
Provider.of<FlwtchState>(context, listen: false).cwtch.ConfigureConnections(onion, false, false, false);
}
} }
}, },
activeTrackColor: Provider.of<Settings>(context).theme.defaultButtonColor, activeTrackColor: Provider.of<Settings>(context).theme.defaultButtonColor,

View File

@ -25,11 +25,12 @@ import 'addcontactview.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:qr_flutter/qr_flutter.dart'; import 'package:qr_flutter/qr_flutter.dart';
import 'addeditprofileview.dart';
import 'messageview.dart'; import 'messageview.dart';
enum ShareMenu { copyCode, qrcode } enum ShareMenu { copyCode, qrcode }
enum ProfileStatusMenu { available, away, busy } enum ProfileStatusMenu { available, away, busy, appearOffline, editProfile }
class ContactsView extends StatefulWidget { class ContactsView extends StatefulWidget {
const ContactsView({Key? key}) : super(key: key); const ContactsView({Key? key}) : super(key: key);
@ -154,17 +155,17 @@ class _ContactsViewState extends State<ContactsView> {
) )
]), ]),
title: Row(children: [ title: Row(children: [
ProfileImage(
imagePath: Provider.of<Settings>(context).isExperimentEnabled(ImagePreviewsExperiment)
? Provider.of<ProfileInfoState>(context).imagePath
: Provider.of<ProfileInfoState>(context).defaultImagePath,
diameter: 42,
border: Provider.of<ProfileInfoState>(context).getBorderColor(Provider.of<Settings>(context).theme),
badgeTextColor: Colors.red,
badgeColor: Colors.red,
),
PopupMenuButton<ProfileStatusMenu>( PopupMenuButton<ProfileStatusMenu>(
icon: Icon(Icons.online_prediction), icon: ProfileImage(
imagePath: Provider.of<Settings>(context).isExperimentEnabled(ImagePreviewsExperiment)
? Provider.of<ProfileInfoState>(context).imagePath
: Provider.of<ProfileInfoState>(context).defaultImagePath,
diameter: 42,
border: Provider.of<ProfileInfoState>(context).getBorderColor(Provider.of<Settings>(context).theme),
badgeTextColor: Colors.red,
badgeColor: Colors.red,
),
iconSize: 42,
tooltip: AppLocalizations.of(context)!.availabilityStatusTooltip, tooltip: AppLocalizations.of(context)!.availabilityStatusTooltip,
splashRadius: Material.defaultSplashRadius / 2, splashRadius: Material.defaultSplashRadius / 2,
onSelected: (ProfileStatusMenu item) { onSelected: (ProfileStatusMenu item) {
@ -179,6 +180,26 @@ class _ContactsViewState extends State<ContactsView> {
case ProfileStatusMenu.busy: case ProfileStatusMenu.busy:
Provider.of<FlwtchState>(context, listen: false).cwtch.SetProfileAttribute(onion, "profile.profile-status", "busy"); Provider.of<FlwtchState>(context, listen: false).cwtch.SetProfileAttribute(onion, "profile.profile-status", "busy");
break; break;
case ProfileStatusMenu.appearOffline:
Provider.of<ProfileInfoState>(context, listen: false).deactivatePeerEngine(context);
Provider.of<FlwtchState>(context, listen: false).cwtch.ActivatePeerEngine(onion);
Provider.of<FlwtchState>(context, listen: false).cwtch.ConfigureConnections(onion, false, false, false);
break;
case ProfileStatusMenu.editProfile:
Navigator.of(context).push(
PageRouteBuilder(
pageBuilder: (bcontext, a1, a2) {
return MultiProvider(
providers: [
ChangeNotifierProvider.value(value: Provider.of<ProfileInfoState>(context, listen: false)),
],
builder: (context, widget) => AddEditProfileView(key: Key('addprofile')),
);
},
transitionsBuilder: (c, anim, a2, child) => FadeTransition(opacity: anim, child: child),
transitionDuration: Duration(milliseconds: 200),
),
);
} }
}, },
itemBuilder: (BuildContext context) => <PopupMenuEntry<ProfileStatusMenu>>[ itemBuilder: (BuildContext context) => <PopupMenuEntry<ProfileStatusMenu>>[
@ -194,6 +215,15 @@ class _ContactsViewState extends State<ContactsView> {
value: ProfileStatusMenu.busy, value: ProfileStatusMenu.busy,
child: Text(AppLocalizations.of(context)!.availabilityStatusBusy!, style: Provider.of<Settings>(context, listen: false).scaleFonts(defaultTextButtonStyle)), child: Text(AppLocalizations.of(context)!.availabilityStatusBusy!, style: Provider.of<Settings>(context, listen: false).scaleFonts(defaultTextButtonStyle)),
), ),
PopupMenuItem<ProfileStatusMenu>(
value: ProfileStatusMenu.appearOffline,
child: Text(AppLocalizations.of(context)!.profileAppearOffline!, style: Provider.of<Settings>(context, listen: false).scaleFonts(defaultTextButtonStyle)),
),
PopupMenuDivider(),
PopupMenuItem<ProfileStatusMenu>(
value: ProfileStatusMenu.editProfile,
child: Text(AppLocalizations.of(context)!.editProfile!, style: Provider.of<Settings>(context, listen: false).scaleFonts(defaultTextButtonStyle)),
),
], ],
), ),
SizedBox( SizedBox(
@ -349,7 +379,10 @@ class _ContactsViewState extends State<ContactsView> {
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
semanticChildCount: tilesSearchResult.length, semanticChildCount: tilesSearchResult.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return tilesSearchResult.elementAt(index); if (tilesSearchResult.length > index) {
return tilesSearchResult.elementAt(index);
}
return Container();
}, },
separatorBuilder: (BuildContext context, int index) { separatorBuilder: (BuildContext context, int index) {
return Divider(height: 1); return Divider(height: 1);

View File

@ -106,6 +106,26 @@ class _MessageViewState extends State<MessageView> {
splashRadius: Material.defaultSplashRadius / 2, icon: Icon(CwtchIcons.manage_files), tooltip: AppLocalizations.of(context)!.manageSharedFiles, onPressed: _pushFileSharingSettings)); splashRadius: Material.defaultSplashRadius / 2, icon: Icon(CwtchIcons.manage_files), tooltip: AppLocalizations.of(context)!.manageSharedFiles, onPressed: _pushFileSharingSettings));
} }
if (Provider.of<ContactInfoState>(context, listen: false).isOnline()) {
appBarButtons.add(IconButton(
splashRadius: Material.defaultSplashRadius / 2,
icon: Icon(Icons.speaker_notes_off),
tooltip: AppLocalizations.of(context)!.contactDisconnect,
onPressed: () {
if (Provider.of<ContactInfoState>(context, listen: false).isGroup) {
Provider.of<FlwtchState>(context, listen: false)
.cwtch
.DisconnectFromServer(Provider.of<ProfileInfoState>(context, listen: false).onion, Provider.of<ContactInfoState>(context, listen: false).server!);
} else {
Provider.of<FlwtchState>(context, listen: false)
.cwtch
.DisconnectFromPeer(Provider.of<ProfileInfoState>(context, listen: false).onion, Provider.of<ContactInfoState>(context, listen: false).onion);
}
// reset the disconnect button to allow for immediate connection...
Provider.of<ContactInfoState>(context, listen: false).lastRetryTime = DateTime.now().subtract(Duration(minutes: 2));
}));
}
var profile = Provider.of<ContactInfoState>(context, listen: false).profileOnion; var profile = Provider.of<ContactInfoState>(context, listen: false).profileOnion;
var conversation = Provider.of<ContactInfoState>(context, listen: false).identifier; var conversation = Provider.of<ContactInfoState>(context, listen: false).identifier;

View File

@ -47,21 +47,39 @@ class _MessageListState extends State<MessageList> {
// With the message cache in place this is no longer necessary // With the message cache in place this is no longer necessary
bool loadMessages = true; bool loadMessages = true;
var reconnectButton = Visibility( // if it's been more than 2 minutes since we last clicked the button let users click the button again
visible: isP2P, // OR if users have never clicked the button AND they appear offline, then they can click the button
child: Padding( // NOTE: all these listeners are false...this is not ideal, but if they were true we would end up rebuilding the message view every tick (which would kill performance)
padding: EdgeInsets.all(2), // any significant changes in state e.g. peer offline or button clicks will trigger a rebuild anyway
child: Tooltip( bool canReconnect = DateTime.now().difference(Provider.of<ContactInfoState>(context, listen: false).lastRetryTime).abs() > Duration(seconds: 60) ||
Provider.of<ProfileInfoState>(context, listen: false).appearOffline &&
(Provider.of<ContactInfoState>(context, listen: false).lastRetryTime == Provider.of<ContactInfoState>(context, listen: false).loaded);
var reconnectButton = Padding(
padding: EdgeInsets.all(2),
child: canReconnect
? Tooltip(
message: AppLocalizations.of(context)!.retryConnectionTooltip, message: AppLocalizations.of(context)!.retryConnectionTooltip,
child: ElevatedButton( child: ElevatedButton(
style: ButtonStyle(padding: MaterialStateProperty.all(EdgeInsets.all(20))), style: ButtonStyle(padding: MaterialStateProperty.all(EdgeInsets.all(20))),
child: Text(AppLocalizations.of(context)!.retryConnection), child: Text(AppLocalizations.of(context)!.retryConnection),
onPressed: () { onPressed: () {
Provider.of<FlwtchState>(context, listen: false) if (Provider.of<ContactInfoState>(context, listen: false).isGroup) {
.cwtch Provider.of<FlwtchState>(context, listen: false)
.AttemptReconnection(Provider.of<ProfileInfoState>(context, listen: false).onion, Provider.of<ContactInfoState>(context, listen: false).onion); .cwtch
.AttemptReconnectionServer(Provider.of<ProfileInfoState>(context, listen: false).onion, Provider.of<ContactInfoState>(context, listen: false).server!);
} else {
Provider.of<FlwtchState>(context, listen: false)
.cwtch
.AttemptReconnection(Provider.of<ProfileInfoState>(context, listen: false).onion, Provider.of<ContactInfoState>(context, listen: false).onion);
}
Provider.of<ContactInfoState>(context, listen: false).lastRetryTime = DateTime.now();
setState(() {
// force update of this view...otherwise the button won't be removed fast enough...
});
}, },
)))); ))
: CircularProgressIndicator(color: Provider.of<Settings>(context).theme.defaultButtonTextColor));
return RepaintBoundary( return RepaintBoundary(
child: Container( child: Container(

View File

@ -157,10 +157,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: collection name: collection
sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.17.1" version: "1.17.2"
connectivity_plus: connectivity_plus:
dependency: "direct main" dependency: "direct main"
description: description:
@ -415,10 +415,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: intl name: intl
sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6 sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.18.0" version: "0.18.1"
io: io:
dependency: transitive dependency: transitive
description: description:
@ -455,18 +455,18 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: matcher name: matcher
sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.12.15" version: "0.12.16"
material_color_utilities: material_color_utilities:
dependency: transitive dependency: transitive
description: description:
name: material_color_utilities name: material_color_utilities
sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.2.0" version: "0.5.0"
meta: meta:
dependency: transitive dependency: transitive
description: description:
@ -716,10 +716,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: source_span name: source_span
sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.9.1" version: "1.10.0"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
@ -772,10 +772,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.5.1" version: "0.6.0"
timezone: timezone:
dependency: transitive dependency: transitive
description: description:
@ -884,10 +884,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: vm_service name: vm_service
sha256: f6deed8ed625c52864792459709183da231ebf66ff0cf09e69b573227c377efe sha256: c620a6f783fa22436da68e42db7ebbf18b8c44b9a46ab911f666ff09ffd9153f
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "11.3.0" version: "11.7.1"
watcher: watcher:
dependency: transitive dependency: transitive
description: description:
@ -896,6 +896,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.1.0" version: "1.1.0"
web:
dependency: transitive
description:
name: web
sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
url: "https://pub.dev"
source: hosted
version: "0.1.4-beta"
web_socket_channel: web_socket_channel:
dependency: transitive dependency: transitive
description: description:
@ -961,5 +969,5 @@ packages:
source: hosted source: hosted
version: "3.1.2" version: "3.1.2"
sdks: sdks:
dart: ">=3.0.0 <4.0.0" dart: ">=3.1.0-185.0.dev <4.0.0"
flutter: ">=3.7.0" flutter: ">=3.7.0"