Upgrade Cwtch, Add Per-Profile Event Log
continuous-integration/drone/pr Build is pending Details

This commit is contained in:
Sarah Jamie Lewis 2024-01-03 10:18:16 -08:00
parent 2ab8cecac6
commit 05946c57fa
5 changed files with 26 additions and 3 deletions

View File

@ -1 +1 @@
2023-09-26-13-15-v0.0.10 2024-01-03-17-55-v0.0.10-3-g7c04233

View File

@ -75,6 +75,8 @@ class ContactInfoState extends ChangeNotifier {
DateTime _lastRetryTime = DateTime.now(); DateTime _lastRetryTime = DateTime.now();
DateTime loaded = DateTime.now(); DateTime loaded = DateTime.now();
List<ContactEvent> contactEvents = List.empty(growable: true);
ContactInfoState( ContactInfoState(
this.profileOnion, this.profileOnion,
this.identifier, this.identifier,
@ -198,6 +200,7 @@ class ContactInfoState extends ChangeNotifier {
set status(String newVal) { set status(String newVal) {
this._status = newVal; this._status = newVal;
this.contactEvents.add(ContactEvent("Update Peer Status Received: $newVal"));
notifyListeners(); notifyListeners();
} }
@ -486,3 +489,11 @@ class ContactInfoState extends ChangeNotifier {
} }
} }
} }
class ContactEvent {
String summary;
late DateTime timestamp;
ContactEvent(this.summary) {
this.timestamp = DateTime.now();
}
}

View File

@ -125,6 +125,7 @@ class _MessageViewState extends State<MessageView> {
} }
// reset the disconnect button to allow for immediate connection... // reset the disconnect button to allow for immediate connection...
Provider.of<ContactInfoState>(context, listen: false).lastRetryTime = DateTime.now().subtract(Duration(minutes: 2)); Provider.of<ContactInfoState>(context, listen: false).lastRetryTime = DateTime.now().subtract(Duration(minutes: 2));
Provider.of<ContactInfoState>(context, listen: false).contactEvents.add(ContactEvent("Disconnect from Peer"));
})); }));
} }

View File

@ -84,6 +84,13 @@ class _PeerSettingsViewState extends State<PeerSettingsView> {
} }
} }
List<Widget> evWidgets = Provider.of<ContactInfoState>(context, listen: false).contactEvents.map((ev) {
return ListTile(
title: Text(ev.summary, style: Provider.of<Settings>(context).scaleFonts(defaultTextStyle)),
subtitle: Text(ev.timestamp.toLocal().toIso8601String(), style: Provider.of<Settings>(context).scaleFonts(defaultTextStyle)),
);
}).toList();
return Scrollbar( return Scrollbar(
trackVisibility: true, trackVisibility: true,
controller: peerSettingsScrollController, controller: peerSettingsScrollController,
@ -319,8 +326,11 @@ class _PeerSettingsViewState extends State<PeerSettingsView> {
style: settings.scaleFonts(defaultTextButtonStyle.copyWith(decoration: TextDecoration.underline)), style: settings.scaleFonts(defaultTextButtonStyle.copyWith(decoration: TextDecoration.underline)),
), ),
)) ))
]) ]),
]) ]),
Column(
children: evWidgets,
)
]))))); ])))));
}); });
}); });

View File

@ -75,6 +75,7 @@ class _MessageListState extends State<MessageList> {
.AttemptReconnection(Provider.of<ProfileInfoState>(context, listen: false).onion, Provider.of<ContactInfoState>(context, listen: false).onion); .AttemptReconnection(Provider.of<ProfileInfoState>(context, listen: false).onion, Provider.of<ContactInfoState>(context, listen: false).onion);
} }
Provider.of<ContactInfoState>(context, listen: false).lastRetryTime = DateTime.now(); Provider.of<ContactInfoState>(context, listen: false).lastRetryTime = DateTime.now();
Provider.of<ContactInfoState>(context, listen: false).contactEvents.add(ContactEvent("Actively Retried Connection"));
setState(() { setState(() {
// force update of this view...otherwise the button won't be removed fast enough... // force update of this view...otherwise the button won't be removed fast enough...
}); });