fix: Start chat with yourself from status

This commit is contained in:
Christian Pauly 2021-02-02 16:48:48 +01:00
parent 08f24d7e28
commit f3b3584f73

View File

@ -39,9 +39,11 @@ class StatusListTile extends StatelessWidget {
), ),
subtitle: Text(status.dateTime.localizedTime(context), subtitle: Text(status.dateTime.localizedTime(context),
style: TextStyle(fontSize: 14)), style: TextStyle(fontSize: 14)),
trailing: PopupMenuButton( trailing: Matrix.of(context).client.userID == status.senderId
onSelected: (_) => AdaptivePageLayout.of(context).pushNamed( ? null
'/settings/ignore', : PopupMenuButton(
onSelected: (_) => AdaptivePageLayout.of(context)
.pushNamed('/settings/ignore',
arguments: status.senderId), arguments: status.senderId),
itemBuilder: (_) => [ itemBuilder: (_) => [
PopupMenuItem( PopupMenuItem(
@ -85,13 +87,17 @@ class StatusListTile extends StatelessWidget {
children: [ children: [
IconButton( IconButton(
icon: Icon(CupertinoIcons.chat_bubble), icon: Icon(CupertinoIcons.chat_bubble),
onPressed: () async { onPressed:
Matrix.of(context).client.userID == status.senderId
? null
: () async {
final result = await showFutureLoadingDialog( final result = await showFutureLoadingDialog(
context: context, context: context,
future: () => User( future: () => User(
status.senderId, status.senderId,
room: room: Room(
Room(id: '', client: Matrix.of(context).client), id: '',
client: Matrix.of(context).client),
).startDirectChat(), ).startDirectChat(),
); );
if (result.error == null) { if (result.error == null) {