Upgrade Cwtch, Add Per-Profile Event Log
continuous-integration/drone/pr Build is pending
Details
continuous-integration/drone/pr Build is pending
Details
This commit is contained in:
parent
2ab8cecac6
commit
05946c57fa
|
@ -1 +1 @@
|
|||
2023-09-26-13-15-v0.0.10
|
||||
2024-01-03-17-55-v0.0.10-3-g7c04233
|
|
@ -75,6 +75,8 @@ class ContactInfoState extends ChangeNotifier {
|
|||
DateTime _lastRetryTime = DateTime.now();
|
||||
DateTime loaded = DateTime.now();
|
||||
|
||||
List<ContactEvent> contactEvents = List.empty(growable: true);
|
||||
|
||||
ContactInfoState(
|
||||
this.profileOnion,
|
||||
this.identifier,
|
||||
|
@ -198,6 +200,7 @@ class ContactInfoState extends ChangeNotifier {
|
|||
|
||||
set status(String newVal) {
|
||||
this._status = newVal;
|
||||
this.contactEvents.add(ContactEvent("Update Peer Status Received: $newVal"));
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
|
@ -486,3 +489,11 @@ class ContactInfoState extends ChangeNotifier {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
class ContactEvent {
|
||||
String summary;
|
||||
late DateTime timestamp;
|
||||
ContactEvent(this.summary) {
|
||||
this.timestamp = DateTime.now();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -125,6 +125,7 @@ class _MessageViewState extends State<MessageView> {
|
|||
}
|
||||
// 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).contactEvents.add(ContactEvent("Disconnect from Peer"));
|
||||
}));
|
||||
}
|
||||
|
||||
|
|
|
@ -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(
|
||||
trackVisibility: true,
|
||||
controller: peerSettingsScrollController,
|
||||
|
@ -319,8 +326,11 @@ class _PeerSettingsViewState extends State<PeerSettingsView> {
|
|||
style: settings.scaleFonts(defaultTextButtonStyle.copyWith(decoration: TextDecoration.underline)),
|
||||
),
|
||||
))
|
||||
])
|
||||
])
|
||||
]),
|
||||
]),
|
||||
Column(
|
||||
children: evWidgets,
|
||||
)
|
||||
])))));
|
||||
});
|
||||
});
|
||||
|
|
|
@ -75,6 +75,7 @@ class _MessageListState extends State<MessageList> {
|
|||
.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).contactEvents.add(ContactEvent("Actively Retried Connection"));
|
||||
setState(() {
|
||||
// force update of this view...otherwise the button won't be removed fast enough...
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue