diff --git a/lib/components/list_items/chat_list_item.dart b/lib/components/list_items/chat_list_item.dart index a6d314b..e95e109 100644 --- a/lib/components/list_items/chat_list_item.dart +++ b/lib/components/list_items/chat_list_item.dart @@ -235,7 +235,9 @@ class ChatListItem extends StatelessWidget { : Text( room.lastEvent?.getLocalizedBody( L10n.of(context), - withSenderNamePrefix: !room.isDirectChat, + withSenderNamePrefix: !room.isDirectChat || + room.lastEvent.senderId == + room.client.userID, hideReply: true, ) ?? '', diff --git a/lib/components/list_items/state_message.dart b/lib/components/list_items/state_message.dart index e4df027..f079d1b 100644 --- a/lib/components/list_items/state_message.dart +++ b/lib/components/list_items/state_message.dart @@ -13,20 +13,22 @@ class StateMessage extends StatelessWidget { padding: const EdgeInsets.only( left: 8.0, right: 8.0, - bottom: 16.0, + bottom: 8.0, ), - child: Container( - alignment: Alignment.center, - decoration: BoxDecoration( - color: Theme.of(context).backgroundColor.withOpacity(0.66), - borderRadius: BorderRadius.circular(7), - ), - child: Text( - event.getLocalizedBody(L10n.of(context)), - textAlign: TextAlign.center, - style: TextStyle( - color: Theme.of(context).textTheme.bodyText2.color, - decoration: event.redacted ? TextDecoration.lineThrough : null, + child: Center( + child: Container( + padding: const EdgeInsets.all(4), + decoration: BoxDecoration( + color: Theme.of(context).backgroundColor.withOpacity(0.8), + borderRadius: BorderRadius.circular(7), + ), + child: Text( + event.getLocalizedBody(L10n.of(context)), + textAlign: TextAlign.center, + style: TextStyle( + color: Theme.of(context).textTheme.bodyText2.color, + decoration: event.redacted ? TextDecoration.lineThrough : null, + ), ), ), ), diff --git a/lib/utils/matrix_file_extension.dart b/lib/utils/matrix_file_extension.dart index d6bf725..2f1dc44 100644 --- a/lib/utils/matrix_file_extension.dart +++ b/lib/utils/matrix_file_extension.dart @@ -24,8 +24,11 @@ extension MatrixFileExtension on MatrixFile { element.click(); element.remove(); } else { - var tempDir = await getTemporaryDirectory(); - final file = File(tempDir.path + '/' + name.split('/').last); + final downloadsDir = Platform.isAndroid + ? (await getExternalStorageDirectory()) + : (await getApplicationDocumentsDirectory()); + + final file = File(downloadsDir.path + '/' + name.split('/').last); file.writeAsBytesSync(bytes); await OpenFile.open(file.path); } diff --git a/lib/views/chat.dart b/lib/views/chat.dart index 0ec89f7..f87fc35 100644 --- a/lib/views/chat.dart +++ b/lib/views/chat.dart @@ -629,12 +629,24 @@ class _ChatState extends State<_Chat> { client.userID ? Alignment.topRight : Alignment.topLeft, - child: Text( - seenByText, - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: TextStyle( - color: Theme.of(context).primaryColor, + child: Container( + padding: + EdgeInsets.symmetric(horizontal: 4), + decoration: BoxDecoration( + color: Theme.of(context) + .scaffoldBackgroundColor + .withOpacity(0.8), + borderRadius: + BorderRadius.circular(4), + ), + child: Text( + seenByText, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + color: + Theme.of(context).primaryColor, + ), ), ), padding: EdgeInsets.only( diff --git a/pubspec.lock b/pubspec.lock index 31a2163..c31f690 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -180,8 +180,8 @@ packages: dependency: "direct main" description: path: "." - ref: "0ff971faa99ca946acf116a51fc31ef7fe87a745" - resolved-ref: "0ff971faa99ca946acf116a51fc31ef7fe87a745" + ref: "5019ebfeb56f0789ab4cc8d27ccda663156b5d68" + resolved-ref: "5019ebfeb56f0789ab4cc8d27ccda663156b5d68" url: "https://gitlab.com/famedly/famedlysdk.git" source: git version: "0.0.1" diff --git a/pubspec.yaml b/pubspec.yaml index e730947..a434183 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -27,7 +27,7 @@ dependencies: famedlysdk: git: url: https://gitlab.com/famedly/famedlysdk.git - ref: 0ff971faa99ca946acf116a51fc31ef7fe87a745 + ref: 5019ebfeb56f0789ab4cc8d27ccda663156b5d68 localstorage: ^3.0.1+4 memoryfilepicker: ^0.1.3