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, maxLines: 1,
softWrap: false, softWrap: false,
) )
: FutureBuilder(
key: ValueKey(
'${lastEvent?.eventId}_${lastEvent?.type}',
),
// #Pangea // #Pangea
: FutureBuilder<String>(
future: room.lastEvent != null future: room.lastEvent != null
? GetChatListItemSubtitle().getSubtitle( ? GetChatListItemSubtitle().getSubtitle(
L10n.of(context)!, L10n.of(context)!,
@ -248,18 +251,20 @@ class ChatListItem extends StatelessWidget {
MatrixState.pangeaController, MatrixState.pangeaController,
) )
: Future.value(L10n.of(context)!.emptyChat), : Future.value(L10n.of(context)!.emptyChat),
builder: (context, snapshot) { // future: needLastEventSender
// Pangea# // ? lastEvent.calcLocalizedBody(
return Text( // MatrixLocals(L10n.of(context)!),
room.membership == Membership.invite // hideReply: true,
? isDirectChat // hideEdit: true,
? L10n.of(context)!.invitePrivateChat // plaintextBody: true,
: L10n.of(context)!.inviteGroupChat // removeMarkdown: true,
// #Pangea // withSenderNamePrefix: !isDirectChat ||
: snapshot.data ?? // directChatMatrixId !=
// room.lastEvent?.senderId,
// )
// : null,
// Pangea# // Pangea#
room.lastEvent initialData: lastEvent?.calcLocalizedBodyFallback(
?.calcLocalizedBodyFallback(
MatrixLocals(L10n.of(context)!), MatrixLocals(L10n.of(context)!),
hideReply: true, hideReply: true,
hideEdit: true, hideEdit: true,
@ -268,7 +273,13 @@ class ChatListItem extends StatelessWidget {
withSenderNamePrefix: !isDirectChat || withSenderNamePrefix: !isDirectChat ||
directChatMatrixId != directChatMatrixId !=
room.lastEvent?.senderId, 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, L10n.of(context)!.emptyChat,
softWrap: false, softWrap: false,
maxLines: 1, maxLines: 1,
@ -282,8 +293,7 @@ class ChatListItem extends StatelessWidget {
? TextDecoration.lineThrough ? TextDecoration.lineThrough
: null, : null,
), ),
); ),
},
), ),
), ),
const SizedBox(width: 8), const SizedBox(width: 8),

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

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

Loading…
Cancel
Save