mirror of
https://gitlab.com/comunic/comunicmobile
synced 2025-06-19 00:05:16 +00:00
Start conversation upgrade
This commit is contained in:
@ -10,16 +10,16 @@ import 'package:flutter/material.dart';
|
||||
|
||||
/// Open a private conversation with a given [userID]
|
||||
Future<bool> openPrivateConversation(BuildContext context, int userID) async {
|
||||
final convID = await ConversationsHelper().getPrivate(userID);
|
||||
try {
|
||||
final convID = await ConversationsHelper().getPrivate(userID);
|
||||
|
||||
if (convID == null) {
|
||||
// Open the conversation
|
||||
MainController.of(context).openConversation(convID);
|
||||
|
||||
return true;
|
||||
} catch (e, s) {
|
||||
print("Failed to find private conversation! $e => $s");
|
||||
showSimpleSnack(context, tr("Could not find a private conversation!"));
|
||||
return false;
|
||||
}
|
||||
|
||||
// Open the conversation
|
||||
MainController.of(context).openConversation(convID);
|
||||
|
||||
// Success
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user