fluffychat merge - resolve conflicts

pull/1384/head
ggurdin 1 year ago
commit deb2e655d6
No known key found for this signature in database
GPG Key ID: A01CB41737CBB478

@ -239,8 +239,11 @@ class ChatListItem extends StatelessWidget {
maxLines: 1,
softWrap: false,
)
// #Pangea
: FutureBuilder<String>(
: FutureBuilder(
key: ValueKey(
'${lastEvent?.eventId}_${lastEvent?.type}',
),
// #Pangea
future: room.lastEvent != null
? GetChatListItemSubtitle().getSubtitle(
L10n.of(context)!,
@ -248,42 +251,49 @@ class ChatListItem extends StatelessWidget {
MatrixState.pangeaController,
)
: Future.value(L10n.of(context)!.emptyChat),
builder: (context, snapshot) {
// Pangea#
return Text(
room.membership == Membership.invite
? isDirectChat
? L10n.of(context)!.invitePrivateChat
: L10n.of(context)!.inviteGroupChat
// #Pangea
: snapshot.data ??
// Pangea#
room.lastEvent
?.calcLocalizedBodyFallback(
MatrixLocals(L10n.of(context)!),
hideReply: true,
hideEdit: true,
plaintextBody: true,
removeMarkdown: true,
withSenderNamePrefix: !isDirectChat ||
directChatMatrixId !=
room.lastEvent?.senderId,
) ??
L10n.of(context)!.emptyChat,
softWrap: false,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontWeight: unread || room.hasNewMessages
? FontWeight.bold
: null,
color: theme.colorScheme.onSurfaceVariant,
decoration: room.lastEvent?.redacted == true
? TextDecoration.lineThrough
: null,
),
);
},
// future: needLastEventSender
// ? lastEvent.calcLocalizedBody(
// MatrixLocals(L10n.of(context)!),
// hideReply: true,
// hideEdit: true,
// plaintextBody: true,
// removeMarkdown: true,
// withSenderNamePrefix: !isDirectChat ||
// directChatMatrixId !=
// room.lastEvent?.senderId,
// )
// : null,
// Pangea#
initialData: lastEvent?.calcLocalizedBodyFallback(
MatrixLocals(L10n.of(context)!),
hideReply: true,
hideEdit: true,
plaintextBody: true,
removeMarkdown: true,
withSenderNamePrefix: !isDirectChat ||
directChatMatrixId !=
room.lastEvent?.senderId,
),
builder: (context, snapshot) => Text(
room.membership == Membership.invite
? isDirectChat
? L10n.of(context)!.invitePrivateChat
: L10n.of(context)!.inviteGroupChat
: snapshot.data ??
L10n.of(context)!.emptyChat,
softWrap: false,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontWeight: unread || room.hasNewMessages
? FontWeight.bold
: null,
color: theme.colorScheme.onSurfaceVariant,
decoration: room.lastEvent?.redacted == true
? TextDecoration.lineThrough
: null,
),
),
),
),
const SizedBox(width: 8),

@ -34,14 +34,8 @@ extension DateTimeExtension on DateTime {
}
/// Returns a simple time String.
/// TODO: Add localization
String localizedTimeOfDay(BuildContext context) {
if (MediaQuery.of(context).alwaysUse24HourFormat) {
return '${_z(hour)}:${_z(minute)}';
} else {
return '${_z(hour % 12 == 0 ? 12 : hour % 12)}:${_z(minute)} ${hour > 11 ? "pm" : "am"}';
}
}
String localizedTimeOfDay(BuildContext context) =>
DateFormat.Hm(L10n.of(context)!.localeName).format(this);
/// Returns [localizedTimeOfDay()] if the ChatTime is today, the name of the week
/// day if the ChatTime is this week and a date string else.
@ -91,6 +85,4 @@ extension DateTimeExtension on DateTime {
localizedTimeOfDay(context),
);
}
static String _z(int i) => i < 10 ? '0${i.toString()}' : i.toString();
}

@ -70,10 +70,13 @@ dependencies:
keyboard_shortcuts: ^0.1.4
latlong2: ^0.9.1
linkify: ^5.0.0
# #Pangea
matrix:
git:
url: https://github.com/pangeachat/matrix-dart-sdk.git # repo
ref: main # branch
# matrix: ^0.29.13
# Pangea#
native_imaging: ^0.1.1
package_info_plus: ^6.0.0
pasteboard: ^0.2.0

Loading…
Cancel
Save