feat: Display read receipts for every event
This commit is contained in:
parent
193d68a525
commit
6cb7775c93
3 changed files with 8 additions and 16 deletions
|
|
@ -8,7 +8,6 @@ import 'package:fluffychat/config/themes.dart';
|
||||||
import 'package:fluffychat/l10n/l10n.dart';
|
import 'package:fluffychat/l10n/l10n.dart';
|
||||||
import 'package:fluffychat/pages/chat/chat.dart';
|
import 'package:fluffychat/pages/chat/chat.dart';
|
||||||
import 'package:fluffychat/pages/chat/events/message.dart';
|
import 'package:fluffychat/pages/chat/events/message.dart';
|
||||||
import 'package:fluffychat/pages/chat/seen_by_row.dart';
|
|
||||||
import 'package:fluffychat/pages/chat/typing_indicators.dart';
|
import 'package:fluffychat/pages/chat/typing_indicators.dart';
|
||||||
import 'package:fluffychat/utils/account_config.dart';
|
import 'package:fluffychat/utils/account_config.dart';
|
||||||
import 'package:fluffychat/utils/matrix_sdk_extensions/filtered_timeline_extension.dart';
|
import 'package:fluffychat/utils/matrix_sdk_extensions/filtered_timeline_extension.dart';
|
||||||
|
|
@ -77,13 +76,7 @@ class ChatEventList extends StatelessWidget {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return Column(
|
return TypingIndicators(controller);
|
||||||
mainAxisSize: .min,
|
|
||||||
children: [
|
|
||||||
SeenByRow(timeline: timeline, event: events.first),
|
|
||||||
TypingIndicators(controller),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request history button or progress indicator:
|
// Request history button or progress indicator:
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import 'package:swipe_to_action/swipe_to_action.dart';
|
||||||
import 'package:fluffychat/config/setting_keys.dart';
|
import 'package:fluffychat/config/setting_keys.dart';
|
||||||
import 'package:fluffychat/config/themes.dart';
|
import 'package:fluffychat/config/themes.dart';
|
||||||
import 'package:fluffychat/l10n/l10n.dart';
|
import 'package:fluffychat/l10n/l10n.dart';
|
||||||
|
import 'package:fluffychat/pages/chat/seen_by_row.dart';
|
||||||
import 'package:fluffychat/utils/adaptive_bottom_sheet.dart';
|
import 'package:fluffychat/utils/adaptive_bottom_sheet.dart';
|
||||||
import 'package:fluffychat/utils/date_time_extension.dart';
|
import 'package:fluffychat/utils/date_time_extension.dart';
|
||||||
import 'package:fluffychat/utils/file_description.dart';
|
import 'package:fluffychat/utils/file_description.dart';
|
||||||
|
|
@ -196,7 +197,7 @@ class Message extends StatelessWidget {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
final showReceiptsRow = event.hasAggregatedEvents(
|
final hasReactions = event.hasAggregatedEvents(
|
||||||
timeline,
|
timeline,
|
||||||
RelationshipTypes.reaction,
|
RelationshipTypes.reaction,
|
||||||
);
|
);
|
||||||
|
|
@ -841,11 +842,12 @@ class Message extends StatelessWidget {
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
||||||
AnimatedSize(
|
AnimatedSize(
|
||||||
duration: FluffyThemes.animationDuration,
|
duration: FluffyThemes.animationDuration,
|
||||||
curve: FluffyThemes.animationCurve,
|
curve: FluffyThemes.animationCurve,
|
||||||
alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomCenter,
|
||||||
child: !showReceiptsRow
|
child: !hasReactions
|
||||||
? const SizedBox.shrink()
|
? const SizedBox.shrink()
|
||||||
: Padding(
|
: Padding(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
|
|
@ -856,6 +858,7 @@ class Message extends StatelessWidget {
|
||||||
child: MessageReactions(event, timeline),
|
child: MessageReactions(event, timeline),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
SeenByRow(timeline: timeline, event: event),
|
||||||
if (enterThread != null)
|
if (enterThread != null)
|
||||||
AnimatedSize(
|
AnimatedSize(
|
||||||
duration: FluffyThemes.animationDuration,
|
duration: FluffyThemes.animationDuration,
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:matrix/matrix.dart';
|
import 'package:matrix/matrix.dart';
|
||||||
|
|
||||||
import 'package:fluffychat/config/themes.dart';
|
import 'package:fluffychat/config/themes.dart';
|
||||||
import 'package:fluffychat/utils/room_status_extension.dart';
|
|
||||||
import 'package:fluffychat/widgets/avatar.dart';
|
import 'package:fluffychat/widgets/avatar.dart';
|
||||||
import 'package:fluffychat/widgets/matrix.dart';
|
import 'package:fluffychat/widgets/matrix.dart';
|
||||||
|
|
||||||
|
|
@ -26,10 +25,7 @@ class SeenByRow extends StatelessWidget {
|
||||||
false,
|
false,
|
||||||
),
|
),
|
||||||
builder: (context, asyncSnapshot) {
|
builder: (context, asyncSnapshot) {
|
||||||
final seenByUsers = timeline.room.getSeenByUsers(
|
final seenByUsers = event.receipts.map((r) => r.user).toList();
|
||||||
timeline,
|
|
||||||
eventId: event.eventId,
|
|
||||||
);
|
|
||||||
return Container(
|
return Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
|
|
@ -48,7 +44,7 @@ class SeenByRow extends StatelessWidget {
|
||||||
Matrix.of(context).client.userID
|
Matrix.of(context).client.userID
|
||||||
? Alignment.topRight
|
? Alignment.topRight
|
||||||
: Alignment.topLeft,
|
: Alignment.topLeft,
|
||||||
padding: const EdgeInsets.only(left: 8, right: 8, bottom: 4),
|
padding: const EdgeInsets.only(bottom: 4, top: 1),
|
||||||
child: Wrap(
|
child: Wrap(
|
||||||
spacing: 4,
|
spacing: 4,
|
||||||
children: [
|
children: [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue