Merge pull request 'Stub Notifications for Group Messages Linux' (#6) from notifications into trunk

Reviewed-on: cwtch.im/cwtch-ui#6
This commit is contained in:
Dan Ballard 2021-06-25 10:05:11 -07:00
commit 7c369fc7e0
10 changed files with 44 additions and 20 deletions

View File

@ -1 +1 @@
v1.0.0-5-g2bf1adb-2021-06-25-05-26
v1.0.0-7-g520d35a-2021-06-25-16-34

View File

@ -1,28 +1,39 @@
# Cwtch UI
A Flutter based Cwtch UI
A Flutter based [Cwtch](https://cwtch.im) UI.
This README covers build instructions, for information on Cwtch itself please go to [https://cwtch.im](https://cwtch.im)
## Getting Started
click the play button in android studio
First you will need a valid [flutter sdk installation](https://flutter.dev/docs/get-started/install)
and run `flutter pub get` to fetch dependencies.
### Linux
You will probably want to disable Analytics on the Flutter Tool: `flutter config --no-analytics`
- libCwtch-go: required to be on the link path (linux/cwtch.destktop demonstrates with `env LD_LIBRARY_PATH=./lib/` on the front of the comman)
- fetch-libcwtch-go.sh will fetch a prebuilt version
- or compile from source from libcwtch-go with `make linux`
- `tor` should be in the PATH
### Building on Linux (for Linux)
### Windows
- run `fetch-libcwtch-go.sh`libCwtch-go to fetch a prebuild version of `libCwtch-go.so` go to `./linux`. Include `./linux` in `LD_LIBRARY_PATH`
- run `fetch-tor.sh` and/or ensure that `tor` is in `$PATH`
- run `flutter run -d linux`
- run `fetch-libcwtch-go.ps1` to get `libCwtch.dll` which is required to run
### Building on Windows (for Windows)
- run `fetch-libcwtch-go.ps1` to fetch a prebuild version of `libCwtch.dll`
- run `fetch-tor-win.ps1` to fetch Tor for windows
- run `flutter run -d windows`
#### Issues
### Building on Linux/Windows (for Android)
- Flutter engine has a [known bug](https://github.com/flutter/flutter/issues/75675) around the Right Shift key being sticky. We have implemented the mostly work around, but until it is fixed, right shift occasionally acts permenent. If this happens, just tap left shift and it will reset
- Follow the steps above to fetch `libCwtch-go` and `tor` (these will fetch Android versions of these binaries also)
- run `flutter run` with an Android phone connect via USB (or some other valid debug mode)
## l10n
#### Known Platform Issues
- **Windows**: Flutter engine has a [known bug](https://github.com/flutter/flutter/issues/75675) around the Right Shift key being sticky.
We have implemented a partial workaround, if this happens, tap left shift and it will reset.
## l10n Instructions
### Adding a new string

View File

@ -131,6 +131,7 @@ class CwtchNotifier {
}
profileCN.getProfile(data["ProfileOnion"])?.contactList.getContact(data["GroupID"])!.totalMessages++;
profileCN.getProfile(data["ProfileOnion"])?.contactList.updateLastMessageTime(data["GroupID"], DateTime.now());
notificationManager.notify("New Message From Group!");
} else {
// from me (already displayed - do not update counter)
var idx = data["Signature"];

View File

@ -1,6 +1,8 @@
{
"@@locale": "de",
"@@last_modified": "2021-06-24T23:32:06+02:00",
"@@last_modified": "2021-06-25T18:57:59+02:00",
"notificationNewMessageFromGroup": "New message in a group!",
"notificationNewMessageFromPeer": "New message from a contact!",
"tooltipHidePassword": "Hide Password",
"tooltipShowPassword": "Show Password",
"serverNotSynced": "Syncing New Messages (This can take some time)...",

View File

@ -1,6 +1,8 @@
{
"@@locale": "en",
"@@last_modified": "2021-06-24T23:32:06+02:00",
"@@last_modified": "2021-06-25T18:57:59+02:00",
"notificationNewMessageFromGroup": "New message in a group!",
"notificationNewMessageFromPeer": "New message from a contact!",
"tooltipHidePassword": "Hide Password",
"tooltipShowPassword": "Show Password",
"serverNotSynced": "Syncing New Messages (This can take some time)...",

View File

@ -1,6 +1,8 @@
{
"@@locale": "es",
"@@last_modified": "2021-06-24T23:32:06+02:00",
"@@last_modified": "2021-06-25T18:57:59+02:00",
"notificationNewMessageFromGroup": "New message in a group!",
"notificationNewMessageFromPeer": "New message from a contact!",
"tooltipHidePassword": "Hide Password",
"tooltipShowPassword": "Show Password",
"serverNotSynced": "Fuera de sincronización con el servidor",

View File

@ -1,6 +1,8 @@
{
"@@locale": "fr",
"@@last_modified": "2021-06-24T23:32:06+02:00",
"@@last_modified": "2021-06-25T18:57:59+02:00",
"notificationNewMessageFromGroup": "New message in a group!",
"notificationNewMessageFromPeer": "New message from a contact!",
"tooltipHidePassword": "Hide Password",
"tooltipShowPassword": "Show Password",
"serverNotSynced": "Syncing New Messages (This can take some time)...",

View File

@ -1,6 +1,8 @@
{
"@@locale": "it",
"@@last_modified": "2021-06-24T23:32:06+02:00",
"@@last_modified": "2021-06-25T18:57:59+02:00",
"notificationNewMessageFromGroup": "New message in a group!",
"notificationNewMessageFromPeer": "New message from a contact!",
"tooltipHidePassword": "Hide Password",
"tooltipShowPassword": "Show Password",
"serverNotSynced": "Non sincronizzato",

View File

@ -1,6 +1,8 @@
{
"@@locale": "pt",
"@@last_modified": "2021-06-24T23:32:06+02:00",
"@@last_modified": "2021-06-25T18:57:59+02:00",
"notificationNewMessageFromGroup": "New message in a group!",
"notificationNewMessageFromPeer": "New message from a contact!",
"tooltipHidePassword": "Hide Password",
"tooltipShowPassword": "Show Password",
"serverNotSynced": "Syncing New Messages (This can take some time)...",

View File

@ -20,6 +20,6 @@ class LinuxNotificationsManager implements NotificationsManager {
LinuxNotificationsManager() {}
Future<void> notify(String message) async {
var icon_path = Uri.file(path.join(path.current, "cwtch.png"));
client.notify('New Message from Peer!', appName: "cwtch", appIcon: icon_path.toString(), replacesId: this.previous_id).then((Notification value) => previous_id = value.id);
client.notify(message, appName: "cwtch", appIcon: icon_path.toString(), replacesId: this.previous_id).then((Notification value) => previous_id = value.id);
}
}