Merge branch 'trunk' into fixinstsys
continuous-integration/drone/pr Build is pending
Details
continuous-integration/drone/pr Build is pending
Details
This commit is contained in:
commit
0f749d6b90
|
@ -1 +1 @@
|
||||||
2023-04-05-19-46-v0.0.3-13-gb7a4bc2
|
2023-04-20-15-37-v0.0.3-20-gb2a43b9
|
|
@ -442,7 +442,7 @@ class MainActivity: FlutterActivity() {
|
||||||
val profile: String = call.argument("ProfileOnion") ?: ""
|
val profile: String = call.argument("ProfileOnion") ?: ""
|
||||||
val conversation: Int = call.argument("conversation") ?: 0
|
val conversation: Int = call.argument("conversation") ?: 0
|
||||||
val fileKey: String = call.argument("fileKey") ?: ""
|
val fileKey: String = call.argument("fileKey") ?: ""
|
||||||
Cwtch.verifyOrResumeDownload(profile, conversation.toLong(), fileKey)
|
Cwtch.verifyOrResumeDownloadDefaultLimit(profile, conversation.toLong(), fileKey)
|
||||||
}
|
}
|
||||||
"UpdateSettings" -> {
|
"UpdateSettings" -> {
|
||||||
val json: String = call.argument("json") ?: ""
|
val json: String = call.argument("json") ?: ""
|
||||||
|
|
|
@ -379,8 +379,8 @@ class CwtchNotifier {
|
||||||
});
|
});
|
||||||
profileCN.getProfile(data["ProfileOnion"])?.contactList.resort();
|
profileCN.getProfile(data["ProfileOnion"])?.contactList.resort();
|
||||||
break;
|
break;
|
||||||
case "NewRetValMessageFromPeer":
|
case "UpdatedConversationAttribute":
|
||||||
if (data["Path"] == "profile.name" && data["Exists"] == "true") {
|
if (data["Path"] == "profile.name") {
|
||||||
if (data["Data"].toString().trim().length > 0) {
|
if (data["Data"].toString().trim().length > 0) {
|
||||||
// Update locally on the UI...
|
// Update locally on the UI...
|
||||||
if (profileCN.getProfile(data["ProfileOnion"])?.contactList.findContact(data["RemotePeer"]) != null) {
|
if (profileCN.getProfile(data["ProfileOnion"])?.contactList.findContact(data["RemotePeer"]) != null) {
|
||||||
|
@ -388,37 +388,31 @@ class CwtchNotifier {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (data['Path'] == "profile.custom-profile-image") {
|
} else if (data['Path'] == "profile.custom-profile-image") {
|
||||||
if (data["Exists"] == "true") {
|
EnvironmentConfig.debugLog("received ret val of custom profile image: $data");
|
||||||
EnvironmentConfig.debugLog("received ret val of custom profile image: $data");
|
String fileKey = data['Data'];
|
||||||
String fileKey = data['Data'];
|
var contact = profileCN.getProfile(data["ProfileOnion"])?.contactList.findContact(data["RemotePeer"]);
|
||||||
var contact = profileCN.getProfile(data["ProfileOnion"])?.contactList.findContact(data["RemotePeer"]);
|
if (contact != null) {
|
||||||
if (contact != null) {
|
profileCN.getProfile(data["ProfileOnion"])?.waitForDownloadComplete(contact.identifier, fileKey);
|
||||||
profileCN.getProfile(data["ProfileOnion"])?.waitForDownloadComplete(contact.identifier, fileKey);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else if (data['Path'] == "profile.profile-attribute-1" || data['Path'] == "profile.profile-attribute-2" || data['Path'] == "profile.profile-attribute-3") {
|
} else if (data['Path'] == "profile.profile-attribute-1" || data['Path'] == "profile.profile-attribute-2" || data['Path'] == "profile.profile-attribute-3") {
|
||||||
if (data["Exists"] == "true") {
|
var contact = profileCN.getProfile(data["ProfileOnion"])?.contactList.findContact(data["RemotePeer"]);
|
||||||
var contact = profileCN.getProfile(data["ProfileOnion"])?.contactList.findContact(data["RemotePeer"]);
|
if (contact != null) {
|
||||||
if (contact != null) {
|
switch (data['Path']) {
|
||||||
switch (data['Path']) {
|
case "profile.profile-attribute-1":
|
||||||
case "profile.profile-attribute-1":
|
contact.setAttribute(0, data["Data"]);
|
||||||
contact.setAttribute(0, data["Data"]);
|
break;
|
||||||
break;
|
case "profile.profile-attribute-2":
|
||||||
case "profile.profile-attribute-2":
|
contact.setAttribute(1, data["Data"]);
|
||||||
contact.setAttribute(1, data["Data"]);
|
break;
|
||||||
break;
|
case "profile.profile-attribute-3":
|
||||||
case "profile.profile-attribute-3":
|
contact.setAttribute(2, data["Data"]);
|
||||||
contact.setAttribute(2, data["Data"]);
|
break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (data['Path'] == "profile.profile-status") {
|
} else if (data['Path'] == "profile.profile-status") {
|
||||||
if (data["Exists"] == "true") {
|
var contact = profileCN.getProfile(data["ProfileOnion"])?.contactList.findContact(data["RemotePeer"]);
|
||||||
var contact = profileCN.getProfile(data["ProfileOnion"])?.contactList.findContact(data["RemotePeer"]);
|
if (contact != null) {
|
||||||
if (contact != null) {
|
contact.setAvailabilityStatus(data['Data']);
|
||||||
contact.setAvailabilityStatus(data['Data']);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
EnvironmentConfig.debugLog("unhandled ret val event: ${data['Path']}");
|
EnvironmentConfig.debugLog("unhandled ret val event: ${data['Path']}");
|
||||||
|
|
|
@ -498,7 +498,7 @@ class CwtchFfi implements Cwtch {
|
||||||
@override
|
@override
|
||||||
// ignore: non_constant_identifier_names
|
// ignore: non_constant_identifier_names
|
||||||
void VerifyOrResumeDownload(String profileOnion, int contactHandle, String filekey) {
|
void VerifyOrResumeDownload(String profileOnion, int contactHandle, String filekey) {
|
||||||
var fn = library.lookup<NativeFunction<void_from_string_int_string_function>>("c_VerifyOrResumeDownload");
|
var fn = library.lookup<NativeFunction<void_from_string_int_string_function>>("c_VerifyOrResumeDownloadDefaultLimit");
|
||||||
// ignore: non_constant_identifier_names
|
// ignore: non_constant_identifier_names
|
||||||
final VerifyOrResumeDownload = fn.asFunction<VoidFromStringIntStringFn>();
|
final VerifyOrResumeDownload = fn.asFunction<VoidFromStringIntStringFn>();
|
||||||
final u1 = profileOnion.toNativeUtf8();
|
final u1 = profileOnion.toNativeUtf8();
|
||||||
|
|
|
@ -131,7 +131,7 @@ class FlwtchState extends State<Flwtch> with WindowListener {
|
||||||
key: Key('app'),
|
key: Key('app'),
|
||||||
navigatorKey: navKey,
|
navigatorKey: navKey,
|
||||||
locale: settings.locale,
|
locale: settings.locale,
|
||||||
showPerformanceOverlay: false,
|
showPerformanceOverlay: settings.profileMode,
|
||||||
localizationsDelegates: <LocalizationsDelegate<dynamic>>[
|
localizationsDelegates: <LocalizationsDelegate<dynamic>>[
|
||||||
AppLocalizations.delegate,
|
AppLocalizations.delegate,
|
||||||
MaterialLocalizationDelegate(),
|
MaterialLocalizationDelegate(),
|
||||||
|
|
|
@ -12,8 +12,6 @@ class AppState extends ChangeNotifier {
|
||||||
String? _selectedProfile;
|
String? _selectedProfile;
|
||||||
int? _selectedConversation;
|
int? _selectedConversation;
|
||||||
int _initialScrollIndex = 0;
|
int _initialScrollIndex = 0;
|
||||||
int _hoveredIndex = -1;
|
|
||||||
int? _selectedIndex;
|
|
||||||
bool _unreadMessagesBelow = false;
|
bool _unreadMessagesBelow = false;
|
||||||
bool _disableFilePicker = false;
|
bool _disableFilePicker = false;
|
||||||
bool _focus = true;
|
bool _focus = true;
|
||||||
|
@ -59,14 +57,6 @@ class AppState extends ChangeNotifier {
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Never use this for message lookup - can be a non-indexed value
|
|
||||||
// e.g. -1
|
|
||||||
int get hoveredIndex => _hoveredIndex;
|
|
||||||
set hoveredIndex(int newVal) {
|
|
||||||
this._hoveredIndex = newVal;
|
|
||||||
notifyListeners();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool get unreadMessagesBelow => _unreadMessagesBelow;
|
bool get unreadMessagesBelow => _unreadMessagesBelow;
|
||||||
set unreadMessagesBelow(bool newVal) {
|
set unreadMessagesBelow(bool newVal) {
|
||||||
this._unreadMessagesBelow = newVal;
|
this._unreadMessagesBelow = newVal;
|
||||||
|
|
|
@ -39,6 +39,7 @@ class ContactInfoState extends ChangeNotifier {
|
||||||
final int identifier;
|
final int identifier;
|
||||||
final String onion;
|
final String onion;
|
||||||
late String _nickname;
|
late String _nickname;
|
||||||
|
late String _localNickname;
|
||||||
|
|
||||||
late ConversationNotificationPolicy _notificationPolicy;
|
late ConversationNotificationPolicy _notificationPolicy;
|
||||||
|
|
||||||
|
@ -66,11 +67,14 @@ class ContactInfoState extends ChangeNotifier {
|
||||||
String? _acnCircuit;
|
String? _acnCircuit;
|
||||||
MessageDraft _messageDraft = MessageDraft.empty();
|
MessageDraft _messageDraft = MessageDraft.empty();
|
||||||
|
|
||||||
|
var _hoveredIndex = -1;
|
||||||
|
|
||||||
ContactInfoState(
|
ContactInfoState(
|
||||||
this.profileOnion,
|
this.profileOnion,
|
||||||
this.identifier,
|
this.identifier,
|
||||||
this.onion, {
|
this.onion, {
|
||||||
nickname = "",
|
nickname = "",
|
||||||
|
localNickname = "",
|
||||||
isGroup = false,
|
isGroup = false,
|
||||||
accepted = false,
|
accepted = false,
|
||||||
blocked = false,
|
blocked = false,
|
||||||
|
@ -87,6 +91,7 @@ class ContactInfoState extends ChangeNotifier {
|
||||||
pinned = false,
|
pinned = false,
|
||||||
}) {
|
}) {
|
||||||
this._nickname = nickname;
|
this._nickname = nickname;
|
||||||
|
this._localNickname = localNickname;
|
||||||
this._isGroup = isGroup;
|
this._isGroup = isGroup;
|
||||||
this._accepted = accepted;
|
this._accepted = accepted;
|
||||||
this._blocked = blocked;
|
this._blocked = blocked;
|
||||||
|
@ -105,7 +110,13 @@ class ContactInfoState extends ChangeNotifier {
|
||||||
keys = Map<String, GlobalKey<MessageRowState>>();
|
keys = Map<String, GlobalKey<MessageRowState>>();
|
||||||
}
|
}
|
||||||
|
|
||||||
String get nickname => this._nickname;
|
String get nickname {
|
||||||
|
if (this._localNickname != "") {
|
||||||
|
return this._localNickname;
|
||||||
|
}
|
||||||
|
return this._nickname;
|
||||||
|
}
|
||||||
|
|
||||||
String get savePeerHistory => this._savePeerHistory;
|
String get savePeerHistory => this._savePeerHistory;
|
||||||
|
|
||||||
String? get acnCircuit => this._acnCircuit;
|
String? get acnCircuit => this._acnCircuit;
|
||||||
|
@ -144,6 +155,11 @@ class ContactInfoState extends ChangeNotifier {
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
set localNickname(String newVal) {
|
||||||
|
this._localNickname = newVal;
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
bool get isGroup => this._isGroup;
|
bool get isGroup => this._isGroup;
|
||||||
|
|
||||||
set isGroup(bool newVal) {
|
set isGroup(bool newVal) {
|
||||||
|
@ -402,7 +418,15 @@ class ContactInfoState extends ChangeNotifier {
|
||||||
}
|
}
|
||||||
|
|
||||||
String augmentedNickname(BuildContext context) {
|
String augmentedNickname(BuildContext context) {
|
||||||
return this.nickname + (this.availabilityStatus == ProfileStatusMenu.available ? "" : " (" +this.statusString(context) + ")");
|
return this.nickname + (this.availabilityStatus == ProfileStatusMenu.available ? "" : " (" + this.statusString(context) + ")");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Never use this for message lookup - can be a non-indexed value
|
||||||
|
// e.g. -1
|
||||||
|
int get hoveredIndex => _hoveredIndex;
|
||||||
|
set hoveredIndex(int newVal) {
|
||||||
|
this._hoveredIndex = newVal;
|
||||||
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
String statusString(BuildContext context) {
|
String statusString(BuildContext context) {
|
||||||
|
|
|
@ -8,12 +8,17 @@ class FileDownloadProgress {
|
||||||
DateTime? timeStart;
|
DateTime? timeStart;
|
||||||
DateTime? timeEnd;
|
DateTime? timeEnd;
|
||||||
DateTime? requested;
|
DateTime? requested;
|
||||||
|
DateTime lastUpdate = DateTime.now();
|
||||||
|
|
||||||
FileDownloadProgress(this.chunksTotal, this.timeStart);
|
FileDownloadProgress(this.chunksTotal, this.timeStart);
|
||||||
|
|
||||||
double progress() {
|
double progress() {
|
||||||
return 1.0 * chunksDownloaded / chunksTotal;
|
return 1.0 * chunksDownloaded / chunksTotal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void markUpdate() {
|
||||||
|
lastUpdate = DateTime.now();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String prettyBytes(int bytes) {
|
String prettyBytes(int bytes) {
|
||||||
|
|
|
@ -33,11 +33,9 @@ class FileMessage extends Message {
|
||||||
int fileSize = shareObj['s'] as int;
|
int fileSize = shareObj['s'] as int;
|
||||||
String fileKey = rootHash + "." + nonce;
|
String fileKey = rootHash + "." + nonce;
|
||||||
|
|
||||||
// if (metadata.attributes["file-downloaded"] == "true") {
|
if (!Provider.of<ProfileInfoState>(context, listen: false).downloadKnown(fileKey)) {
|
||||||
// if (!Provider.of<ProfileInfoState>(context).downloadKnown(fileKey)) {
|
Provider.of<FlwtchState>(context, listen: false).cwtch.CheckDownloadStatus(Provider.of<ProfileInfoState>(context, listen: false).onion, fileKey);
|
||||||
Provider.of<FlwtchState>(context, listen: false).cwtch.CheckDownloadStatus(Provider.of<ProfileInfoState>(context, listen: false).onion, fileKey);
|
}
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
if (!validHash(rootHash, nonce)) {
|
if (!validHash(rootHash, nonce)) {
|
||||||
return MessageRow(MalformedBubble(), index);
|
return MessageRow(MalformedBubble(), index);
|
||||||
|
|
|
@ -67,6 +67,7 @@ class ProfileInfoState extends ChangeNotifier {
|
||||||
this._unreadMessages += contact["numUnread"] as int;
|
this._unreadMessages += contact["numUnread"] as int;
|
||||||
return ContactInfoState(this.onion, contact["identifier"], contact["onion"],
|
return ContactInfoState(this.onion, contact["identifier"], contact["onion"],
|
||||||
nickname: contact["name"],
|
nickname: contact["name"],
|
||||||
|
localNickname: contact["localname"],
|
||||||
status: contact["status"],
|
status: contact["status"],
|
||||||
imagePath: contact["picture"],
|
imagePath: contact["picture"],
|
||||||
defaultImagePath: contact["isGroup"] ? contact["picture"] : contact["defaultPicture"],
|
defaultImagePath: contact["isGroup"] ? contact["picture"] : contact["defaultPicture"],
|
||||||
|
@ -268,6 +269,7 @@ class ProfileInfoState extends ChangeNotifier {
|
||||||
}
|
}
|
||||||
this._downloads[fileKey]!.chunksDownloaded = progress;
|
this._downloads[fileKey]!.chunksDownloaded = progress;
|
||||||
this._downloads[fileKey]!.chunksTotal = numChunks;
|
this._downloads[fileKey]!.chunksTotal = numChunks;
|
||||||
|
this._downloads[fileKey]!.markUpdate();
|
||||||
}
|
}
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
@ -277,6 +279,7 @@ class ProfileInfoState extends ChangeNotifier {
|
||||||
this._downloads[fileKey] = FileDownloadProgress(1, DateTime.now());
|
this._downloads[fileKey] = FileDownloadProgress(1, DateTime.now());
|
||||||
}
|
}
|
||||||
this._downloads[fileKey]!.gotManifest = true;
|
this._downloads[fileKey]!.gotManifest = true;
|
||||||
|
this._downloads[fileKey]!.markUpdate();
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -301,6 +304,7 @@ class ProfileInfoState extends ChangeNotifier {
|
||||||
this._downloads[fileKey]!.timeEnd = DateTime.now();
|
this._downloads[fileKey]!.timeEnd = DateTime.now();
|
||||||
this._downloads[fileKey]!.downloadedTo = finalPath;
|
this._downloads[fileKey]!.downloadedTo = finalPath;
|
||||||
this._downloads[fileKey]!.complete = true;
|
this._downloads[fileKey]!.complete = true;
|
||||||
|
this._downloads[fileKey]!.markUpdate();
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -333,9 +337,13 @@ class ProfileInfoState extends ChangeNotifier {
|
||||||
this._downloads[fileKey]!.interrupted = true;
|
this._downloads[fileKey]!.interrupted = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (DateTime.now().difference(this._downloads[fileKey]!.lastUpdate) > Duration(minutes: 1)) {
|
||||||
|
this._downloads[fileKey]!.requested = null;
|
||||||
|
this._downloads[fileKey]!.interrupted = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -343,6 +351,7 @@ class ProfileInfoState extends ChangeNotifier {
|
||||||
if (this._downloads.containsKey(fileKey)) {
|
if (this._downloads.containsKey(fileKey)) {
|
||||||
this._downloads[fileKey]!.interrupted = false;
|
this._downloads[fileKey]!.interrupted = false;
|
||||||
this._downloads[fileKey]!.requested = DateTime.now();
|
this._downloads[fileKey]!.requested = DateTime.now();
|
||||||
|
this._downloads[fileKey]!.markUpdate();
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,6 +69,15 @@ class Settings extends ChangeNotifier {
|
||||||
|
|
||||||
String get torCacheDir => _torCacheDir;
|
String get torCacheDir => _torCacheDir;
|
||||||
|
|
||||||
|
// Whether to show the profiling interface, not saved
|
||||||
|
bool _profileMode = false;
|
||||||
|
|
||||||
|
bool get profileMode => _profileMode;
|
||||||
|
set profileMode(bool newval) {
|
||||||
|
this._profileMode = newval;
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
set useSemanticDebugger(bool newval) {
|
set useSemanticDebugger(bool newval) {
|
||||||
this._useSemanticDebugger = newval;
|
this._useSemanticDebugger = newval;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
|
|
@ -50,7 +50,7 @@ void selectConversation(BuildContext context, int handle) {
|
||||||
// triggers update in Double/TripleColumnView
|
// triggers update in Double/TripleColumnView
|
||||||
Provider.of<AppState>(context, listen: false).initialScrollIndex = unread;
|
Provider.of<AppState>(context, listen: false).initialScrollIndex = unread;
|
||||||
Provider.of<AppState>(context, listen: false).selectedConversation = handle;
|
Provider.of<AppState>(context, listen: false).selectedConversation = handle;
|
||||||
Provider.of<AppState>(context, listen: false).hoveredIndex = -1;
|
Provider.of<ContactInfoState>(context, listen: false).hoveredIndex = -1;
|
||||||
// if in singlepane mode, push to the stack
|
// if in singlepane mode, push to the stack
|
||||||
var isLandscape = Provider.of<AppState>(context, listen: false).isLandscape(context);
|
var isLandscape = Provider.of<AppState>(context, listen: false).isLandscape(context);
|
||||||
if (Provider.of<Settings>(context, listen: false).uiColumns(isLandscape).length == 1) _pushMessageView(context, handle);
|
if (Provider.of<Settings>(context, listen: false).uiColumns(isLandscape).length == 1) _pushMessageView(context, handle);
|
||||||
|
@ -164,15 +164,21 @@ class _ContactsViewState extends State<ContactsView> {
|
||||||
itemBuilder: (BuildContext context) => <PopupMenuEntry<ProfileStatusMenu>>[
|
itemBuilder: (BuildContext context) => <PopupMenuEntry<ProfileStatusMenu>>[
|
||||||
PopupMenuItem<ProfileStatusMenu>(
|
PopupMenuItem<ProfileStatusMenu>(
|
||||||
value: ProfileStatusMenu.available,
|
value: ProfileStatusMenu.available,
|
||||||
child: Text(AppLocalizations.of(context)!.availabilityStatusAvailable!,),
|
child: Text(
|
||||||
|
AppLocalizations.of(context)!.availabilityStatusAvailable!,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
PopupMenuItem<ProfileStatusMenu>(
|
PopupMenuItem<ProfileStatusMenu>(
|
||||||
value: ProfileStatusMenu.away,
|
value: ProfileStatusMenu.away,
|
||||||
child: Text(AppLocalizations.of(context)!.availabilityStatusAway!,),
|
child: Text(
|
||||||
|
AppLocalizations.of(context)!.availabilityStatusAway!,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
PopupMenuItem<ProfileStatusMenu>(
|
PopupMenuItem<ProfileStatusMenu>(
|
||||||
value: ProfileStatusMenu.busy,
|
value: ProfileStatusMenu.busy,
|
||||||
child: Text(AppLocalizations.of(context)!.availabilityStatusBusy!,),
|
child: Text(
|
||||||
|
AppLocalizations.of(context)!.availabilityStatusBusy!,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
@ -545,6 +545,24 @@ class _GlobalSettingsViewState extends State<GlobalSettingsView> {
|
||||||
child: SelectableText(AppLocalizations.of(context)!.versionBuilddate.replaceAll("%1", EnvironmentConfig.BUILD_VER).replaceAll("%2", EnvironmentConfig.BUILD_DATE)),
|
child: SelectableText(AppLocalizations.of(context)!.versionBuilddate.replaceAll("%1", EnvironmentConfig.BUILD_VER).replaceAll("%2", EnvironmentConfig.BUILD_DATE)),
|
||||||
)
|
)
|
||||||
]),
|
]),
|
||||||
|
SwitchListTile(
|
||||||
|
// TODO: Translate, Remove, OR Hide Prior to Release
|
||||||
|
title: Text("Show Performance Overlay", style: TextStyle(color: settings.current().mainTextColor)),
|
||||||
|
subtitle: Text("Display an overlay graph of render time."),
|
||||||
|
value: settings.profileMode,
|
||||||
|
onChanged: (bool value) {
|
||||||
|
setState(() {
|
||||||
|
if (value) {
|
||||||
|
settings.profileMode = value;
|
||||||
|
} else {
|
||||||
|
settings.profileMode = value;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
activeTrackColor: settings.theme.defaultButtonActiveColor,
|
||||||
|
inactiveTrackColor: settings.theme.defaultButtonDisabledColor,
|
||||||
|
secondary: Icon(Icons.bar_chart, color: settings.current().mainTextColor),
|
||||||
|
),
|
||||||
Visibility(
|
Visibility(
|
||||||
visible: EnvironmentConfig.BUILD_VER == dev_version && !Platform.isAndroid,
|
visible: EnvironmentConfig.BUILD_VER == dev_version && !Platform.isAndroid,
|
||||||
child: SwitchListTile(
|
child: SwitchListTile(
|
||||||
|
|
|
@ -17,11 +17,9 @@ import 'package:cwtch/models/profile.dart';
|
||||||
import 'package:cwtch/third_party/linkify/flutter_linkify.dart';
|
import 'package:cwtch/third_party/linkify/flutter_linkify.dart';
|
||||||
import 'package:cwtch/widgets/malformedbubble.dart';
|
import 'package:cwtch/widgets/malformedbubble.dart';
|
||||||
import 'package:cwtch/widgets/messageloadingbubble.dart';
|
import 'package:cwtch/widgets/messageloadingbubble.dart';
|
||||||
import 'package:cwtch/widgets/messagerow.dart';
|
|
||||||
import 'package:cwtch/widgets/profileimage.dart';
|
import 'package:cwtch/widgets/profileimage.dart';
|
||||||
import 'package:cwtch/controllers/filesharing.dart' as filesharing;
|
import 'package:cwtch/controllers/filesharing.dart' as filesharing;
|
||||||
import 'package:cwtch/widgets/staticmessagebubble.dart';
|
import 'package:cwtch/widgets/staticmessagebubble.dart';
|
||||||
import 'package:file_picker/file_picker.dart';
|
|
||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
@ -230,11 +228,12 @@ class _MessageViewState extends State<MessageView> {
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 42,
|
height: 42,
|
||||||
clipBehavior: Clip.hardEdge,
|
clipBehavior: Clip.hardEdge,
|
||||||
decoration: BoxDecoration(),
|
decoration: BoxDecoration(),
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment: Alignment.centerLeft, child: Text(
|
alignment: Alignment.centerLeft,
|
||||||
|
child: Text(
|
||||||
Provider.of<ContactInfoState>(context).augmentedNickname(context),
|
Provider.of<ContactInfoState>(context).augmentedNickname(context),
|
||||||
overflow: TextOverflow.clip,
|
overflow: TextOverflow.clip,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
|
|
|
@ -113,15 +113,24 @@ class _PeerSettingsViewState extends State<PeerSettingsView> {
|
||||||
child: Column(children: [
|
child: Column(children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.all(1),
|
padding: EdgeInsets.all(1),
|
||||||
child: SelectableText(Provider.of<ContactInfoState>(context, listen: false).attributes[0] ?? "", textAlign: TextAlign.center,),
|
child: SelectableText(
|
||||||
|
Provider.of<ContactInfoState>(context, listen: false).attributes[0] ?? "",
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.all(1),
|
padding: EdgeInsets.all(1),
|
||||||
child: SelectableText(Provider.of<ContactInfoState>(context, listen: false).attributes[1] ?? "", textAlign: TextAlign.center,),
|
child: SelectableText(
|
||||||
|
Provider.of<ContactInfoState>(context, listen: false).attributes[1] ?? "",
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.all(1),
|
padding: EdgeInsets.all(1),
|
||||||
child: SelectableText(Provider.of<ContactInfoState>(context, listen: false).attributes[2] ?? "", textAlign: TextAlign.center,),
|
child: SelectableText(
|
||||||
|
Provider.of<ContactInfoState>(context, listen: false).attributes[2] ?? "",
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
]))
|
]))
|
||||||
]),
|
]),
|
||||||
|
@ -137,7 +146,7 @@ class _PeerSettingsViewState extends State<PeerSettingsView> {
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
var profileOnion = Provider.of<ContactInfoState>(context, listen: false).profileOnion;
|
var profileOnion = 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;
|
||||||
Provider.of<ContactInfoState>(context, listen: false).nickname = ctrlrNick.text;
|
Provider.of<ContactInfoState>(context, listen: false).localNickname = ctrlrNick.text;
|
||||||
Provider.of<FlwtchState>(context, listen: false).cwtch.SetConversationAttribute(profileOnion, conversation, "profile.name", ctrlrNick.text);
|
Provider.of<FlwtchState>(context, listen: false).cwtch.SetConversationAttribute(profileOnion, conversation, "profile.name", ctrlrNick.text);
|
||||||
final snackBar = SnackBar(content: Text(AppLocalizations.of(context)!.nickChangeSuccess));
|
final snackBar = SnackBar(content: Text(AppLocalizations.of(context)!.nickChangeSuccess));
|
||||||
ScaffoldMessenger.of(context).showSnackBar(snackBar);
|
ScaffoldMessenger.of(context).showSnackBar(snackBar);
|
||||||
|
|
|
@ -165,7 +165,7 @@ class FileBubbleState extends State<FileBubble> {
|
||||||
wdgDecorations = Text('\u202F');
|
wdgDecorations = Text('\u202F');
|
||||||
} else if (downloadComplete && path != null) {
|
} else if (downloadComplete && path != null) {
|
||||||
// in this case, whatever marked download.complete would have also set the path
|
// in this case, whatever marked download.complete would have also set the path
|
||||||
if (Provider.of<Settings>(context).shouldPreview(path)) {
|
if (myFile != null && Provider.of<Settings>(context).shouldPreview(path)) {
|
||||||
isPreview = true;
|
isPreview = true;
|
||||||
wdgDecorations = Center(
|
wdgDecorations = Center(
|
||||||
widthFactor: 1.0,
|
widthFactor: 1.0,
|
||||||
|
@ -196,6 +196,7 @@ class FileBubbleState extends State<FileBubble> {
|
||||||
// so we probably have to request an info lookup
|
// so we probably have to request an info lookup
|
||||||
if (!downloadInterrupted) {
|
if (!downloadInterrupted) {
|
||||||
wdgDecorations = Text(AppLocalizations.of(context)!.fileCheckingStatus + '...' + '\u202F');
|
wdgDecorations = Text(AppLocalizations.of(context)!.fileCheckingStatus + '...' + '\u202F');
|
||||||
|
// We should have already requested this...
|
||||||
} else {
|
} else {
|
||||||
var path = Provider.of<ProfileInfoState>(context).downloadFinalPath(widget.fileKey()) ?? "";
|
var path = Provider.of<ProfileInfoState>(context).downloadFinalPath(widget.fileKey()) ?? "";
|
||||||
wdgDecorations = Visibility(
|
wdgDecorations = Visibility(
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import 'package:cwtch/config.dart';
|
||||||
import 'package:cwtch/models/appstate.dart';
|
import 'package:cwtch/models/appstate.dart';
|
||||||
import 'package:cwtch/models/contact.dart';
|
import 'package:cwtch/models/contact.dart';
|
||||||
import 'package:cwtch/models/message.dart';
|
import 'package:cwtch/models/message.dart';
|
||||||
|
|
|
@ -81,7 +81,7 @@ class MessageRowState extends State<MessageRow> with SingleTickerProviderStateMi
|
||||||
Widget wdgReply = Platform.isAndroid
|
Widget wdgReply = Platform.isAndroid
|
||||||
? SizedBox.shrink()
|
? SizedBox.shrink()
|
||||||
: Visibility(
|
: Visibility(
|
||||||
visible: EnvironmentConfig.TEST_MODE || Provider.of<AppState>(context).hoveredIndex == Provider.of<MessageMetadata>(context).messageID,
|
visible: EnvironmentConfig.TEST_MODE || Provider.of<ContactInfoState>(context).hoveredIndex == Provider.of<MessageMetadata>(context).messageID,
|
||||||
maintainSize: true,
|
maintainSize: true,
|
||||||
maintainAnimation: true,
|
maintainAnimation: true,
|
||||||
maintainState: true,
|
maintainState: true,
|
||||||
|
@ -106,7 +106,7 @@ class MessageRowState extends State<MessageRow> with SingleTickerProviderStateMi
|
||||||
Widget wdgSeeReplies = Platform.isAndroid
|
Widget wdgSeeReplies = Platform.isAndroid
|
||||||
? SizedBox.shrink()
|
? SizedBox.shrink()
|
||||||
: Visibility(
|
: Visibility(
|
||||||
visible: EnvironmentConfig.TEST_MODE || Provider.of<AppState>(context).hoveredIndex == Provider.of<MessageMetadata>(context).messageID,
|
visible: EnvironmentConfig.TEST_MODE || Provider.of<ContactInfoState>(context).hoveredIndex == Provider.of<MessageMetadata>(context).messageID,
|
||||||
maintainSize: true,
|
maintainSize: true,
|
||||||
maintainAnimation: true,
|
maintainAnimation: true,
|
||||||
maintainState: true,
|
maintainState: true,
|
||||||
|
@ -128,8 +128,8 @@ class MessageRowState extends State<MessageRow> with SingleTickerProviderStateMi
|
||||||
: Visibility(
|
: Visibility(
|
||||||
visible: Provider.of<FlwtchState>(context, listen: false).cwtch.IsBlodeuweddSupported() &&
|
visible: Provider.of<FlwtchState>(context, listen: false).cwtch.IsBlodeuweddSupported() &&
|
||||||
Provider.of<Settings>(context).isExperimentEnabled(BlodeuweddExperiment) &&
|
Provider.of<Settings>(context).isExperimentEnabled(BlodeuweddExperiment) &&
|
||||||
(EnvironmentConfig.TEST_MODE || Provider.of<AppState>(context).hoveredIndex == Provider.of<MessageMetadata>(context).messageID),
|
(EnvironmentConfig.TEST_MODE || Provider.of<ContactInfoState>(context).hoveredIndex == Provider.of<MessageMetadata>(context).messageID),
|
||||||
maintainSize: false,
|
maintainSize: true,
|
||||||
maintainAnimation: true,
|
maintainAnimation: true,
|
||||||
maintainState: true,
|
maintainState: true,
|
||||||
maintainInteractivity: false,
|
maintainInteractivity: false,
|
||||||
|
@ -245,16 +245,12 @@ class MessageRowState extends State<MessageRow> with SingleTickerProviderStateMi
|
||||||
var mr = MouseRegion(
|
var mr = MouseRegion(
|
||||||
// For desktop...
|
// For desktop...
|
||||||
onHover: (event) {
|
onHover: (event) {
|
||||||
if (Provider.of<AppState>(context, listen: false).hoveredIndex != Provider.of<MessageMetadata>(context, listen: false).messageID) {
|
if (Provider.of<ContactInfoState>(context, listen: false).hoveredIndex != Provider.of<MessageMetadata>(context, listen: false).messageID) {
|
||||||
setState(() {
|
Provider.of<ContactInfoState>(context, listen: false).hoveredIndex = Provider.of<MessageMetadata>(context, listen: false).messageID;
|
||||||
Provider.of<AppState>(context, listen: false).hoveredIndex = Provider.of<MessageMetadata>(context, listen: false).messageID;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onExit: (event) {
|
onExit: (event) {
|
||||||
// setState(() {
|
Provider.of<ContactInfoState>(context, listen: false).hoveredIndex = -1;
|
||||||
// Provider.of<AppState>(context, listen: false).hoveredIndex = -1;
|
|
||||||
//});
|
|
||||||
},
|
},
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onPanUpdate: (details) {
|
onPanUpdate: (details) {
|
||||||
|
@ -270,12 +266,16 @@ class MessageRowState extends State<MessageRow> with SingleTickerProviderStateMi
|
||||||
},
|
},
|
||||||
onPanEnd: (details) {
|
onPanEnd: (details) {
|
||||||
_runAnimation(details.velocity.pixelsPerSecond, size);
|
_runAnimation(details.velocity.pixelsPerSecond, size);
|
||||||
Provider.of<ContactInfoState>(context, listen: false).messageDraft.quotedReference = Provider.of<MessageMetadata>(context, listen: false).messageID;
|
if (Platform.isAndroid) {
|
||||||
Provider.of<ContactInfoState>(context, listen: false).notifyMessageDraftUpdate();
|
Provider.of<ContactInfoState>(context, listen: false).messageDraft.quotedReference = Provider.of<MessageMetadata>(context, listen: false).messageID;
|
||||||
setState(() {});
|
Provider.of<ContactInfoState>(context, listen: false).notifyMessageDraftUpdate();
|
||||||
|
setState(() {});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onLongPress: () async {
|
onLongPress: () async {
|
||||||
modalShowReplies(context, AppLocalizations.of(context)!.headingReplies, AppLocalizations.of(context)!.messageNoReplies, settings, pis, cis, borderColor, cache, messageID);
|
if (Platform.isAndroid) {
|
||||||
|
modalShowReplies(context, AppLocalizations.of(context)!.headingReplies, AppLocalizations.of(context)!.messageNoReplies, settings, pis, cis, borderColor, cache, messageID);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.all(2),
|
padding: EdgeInsets.all(2),
|
||||||
|
|
Loading…
Reference in New Issue