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,17 +39,19 @@ 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(
arguments: status.senderId), onSelected: (_) => AdaptivePageLayout.of(context)
itemBuilder: (_) => [ .pushNamed('/settings/ignore',
PopupMenuItem( arguments: status.senderId),
child: Text(L10n.of(context).ignore), itemBuilder: (_) => [
value: 'ignore', PopupMenuItem(
), child: Text(L10n.of(context).ignore),
], value: 'ignore',
), ),
],
),
), ),
isImage isImage
? CachedNetworkImage( ? CachedNetworkImage(
@ -85,20 +87,24 @@ class StatusListTile extends StatelessWidget {
children: [ children: [
IconButton( IconButton(
icon: Icon(CupertinoIcons.chat_bubble), icon: Icon(CupertinoIcons.chat_bubble),
onPressed: () async { onPressed:
final result = await showFutureLoadingDialog( Matrix.of(context).client.userID == status.senderId
context: context, ? null
future: () => User( : () async {
status.senderId, final result = await showFutureLoadingDialog(
room: context: context,
Room(id: '', client: Matrix.of(context).client), future: () => User(
).startDirectChat(), status.senderId,
); room: Room(
if (result.error == null) { id: '',
await AdaptivePageLayout.of(context) client: Matrix.of(context).client),
.pushNamed('/rooms/${result.result}'); ).startDirectChat(),
} );
}, if (result.error == null) {
await AdaptivePageLayout.of(context)
.pushNamed('/rooms/${result.result}');
}
},
), ),
IconButton( IconButton(
icon: Icon(Icons.ios_share), icon: Icon(Icons.ios_share),