mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-05-25 15:32:12 +00:00
Merge pull request #406 from twonlyapp/dev
Some checks failed
Publish on Github / build_and_publish (push) Has been cancelled
Some checks failed
Publish on Github / build_and_publish (push) Has been cancelled
- Fix: Issue with push notifications on Android
This commit is contained in:
commit
3e49e293f4
8 changed files with 51 additions and 5 deletions
|
|
@ -1,5 +1,9 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 0.2.10
|
||||||
|
|
||||||
|
- Fix: Issue with push notifications on Android
|
||||||
|
|
||||||
## 0.2.9
|
## 0.2.9
|
||||||
|
|
||||||
- Improved: Make contact avatars clickable
|
- Improved: Make contact avatars clickable
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,11 @@ class _AppMainWidgetState extends State<AppMainWidget> {
|
||||||
Future<void> initAsync() async {
|
Future<void> initAsync() async {
|
||||||
Log.info('AppWidgetState: initAsync started');
|
Log.info('AppWidgetState: initAsync started');
|
||||||
if (userService.isUserCreated) {
|
if (userService.isUserCreated) {
|
||||||
unawaited(FirebaseMessaging.instance.requestPermission());
|
try {
|
||||||
|
unawaited(FirebaseMessaging.instance.requestPermission());
|
||||||
|
} catch (e) {
|
||||||
|
Log.error(e);
|
||||||
|
}
|
||||||
if (_isTwonlyLocked) {
|
if (_isTwonlyLocked) {
|
||||||
// do not change in case twonly was already unlocked at some point
|
// do not change in case twonly was already unlocked at some point
|
||||||
_isTwonlyLocked = userService.currentUser.screenLockEnabled;
|
_isTwonlyLocked = userService.currentUser.screenLockEnabled;
|
||||||
|
|
|
||||||
|
|
@ -9,18 +9,24 @@ class AppEnvironment {
|
||||||
static late final String cacheDir;
|
static late final String cacheDir;
|
||||||
static late final String supportDir;
|
static late final String supportDir;
|
||||||
|
|
||||||
|
static bool _isInitialized = false;
|
||||||
|
|
||||||
// will be loaded in the main_camera_controller.dart
|
// will be loaded in the main_camera_controller.dart
|
||||||
static List<CameraDescription> cameras = [];
|
static List<CameraDescription> cameras = [];
|
||||||
|
|
||||||
static Future<void> init() async {
|
static Future<void> init() async {
|
||||||
|
if (_isInitialized) return;
|
||||||
cacheDir = (await getApplicationCacheDirectory()).path;
|
cacheDir = (await getApplicationCacheDirectory()).path;
|
||||||
supportDir = (await getApplicationSupportDirectory()).path;
|
supportDir = (await getApplicationSupportDirectory()).path;
|
||||||
Log.init();
|
Log.init();
|
||||||
|
_isInitialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void initTesting() {
|
static void initTesting() {
|
||||||
|
if (_isInitialized) return;
|
||||||
cacheDir = '/tmp/twonly_cache';
|
cacheDir = '/tmp/twonly_cache';
|
||||||
supportDir = '/tmp/twonly_support';
|
supportDir = '/tmp/twonly_support';
|
||||||
|
_isInitialized = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit 781626f66c5f992ffad861abb7b4937f82319392
|
Subproject commit fccd366e119671b96730cb09d8bb8aa1057bd1c5
|
||||||
|
|
@ -100,9 +100,9 @@ Future<void> incFlameCounter(
|
||||||
final contacts = await twonlyDB.groupsDao.getGroupContact(
|
final contacts = await twonlyDB.groupsDao.getGroupContact(
|
||||||
group.groupId,
|
group.groupId,
|
||||||
);
|
);
|
||||||
if (contacts.length == 1) {
|
for (final contact in contacts) {
|
||||||
await twonlyDB.contactsDao.updateContact(
|
await twonlyDB.contactsDao.updateContact(
|
||||||
contacts.first.userId,
|
contact.userId,
|
||||||
ContactsCompanion(
|
ContactsCompanion(
|
||||||
mediaReceivedCounter: Value(
|
mediaReceivedCounter: Value(
|
||||||
contacts.first.mediaReceivedCounter + (received ? 1 : 0),
|
contacts.first.mediaReceivedCounter + (received ? 1 : 0),
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ description: "twonly, a privacy-friendly way to connect with friends through sec
|
||||||
|
|
||||||
publish_to: 'none'
|
publish_to: 'none'
|
||||||
|
|
||||||
version: 0.2.9+118
|
version: 0.2.10+119
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.11.0
|
sdk: ^3.11.0
|
||||||
|
|
|
||||||
32
rust/src/key_manager.rs
Normal file
32
rust/src/key_manager.rs
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
struct TwonlyIdentity {}
|
||||||
|
|
||||||
|
struct NostrIdentity {}
|
||||||
|
|
||||||
|
struct KeyManager {
|
||||||
|
main_key: [u8; 32],
|
||||||
|
}
|
||||||
|
|
||||||
|
impl KeyManager {
|
||||||
|
fn try_from_keychain() -> KeyManager {
|
||||||
|
todo!();
|
||||||
|
}
|
||||||
|
|
||||||
|
fn create_new() {
|
||||||
|
// generates main_key
|
||||||
|
|
||||||
|
// generates signal identity
|
||||||
|
// generates nostr identity
|
||||||
|
}
|
||||||
|
|
||||||
|
fn get_signal_identity() {}
|
||||||
|
|
||||||
|
fn recover_from_trusted_friends() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
fn generate_backup_key() {}
|
||||||
|
|
||||||
|
fn recover_from_backup() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue