mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-19 10:39:26 +01:00
24 lines
778 B
Dart
24 lines
778 B
Dart
import 'package:famedlysdk/famedlysdk.dart';
|
|
import 'package:fluffychat/l10n/l10n.dart';
|
|
import 'package:flutter/widgets.dart';
|
|
|
|
import 'date_time_extension.dart';
|
|
|
|
extension RoomStatusExtension on Room {
|
|
Presence get directChatPresence => client.presences[directChatMatrixID];
|
|
|
|
String getLocalizedStatus(BuildContext context) {
|
|
if (isDirectChat) {
|
|
if (directChatPresence != null) {
|
|
if (directChatPresence.currentlyActive == true) {
|
|
return L10n.of(context).currentlyActive;
|
|
}
|
|
return L10n.of(context)
|
|
.lastActiveAgo(directChatPresence.time.localizedTimeShort(context));
|
|
}
|
|
return L10n.of(context).lastSeenLongTimeAgo;
|
|
}
|
|
return L10n.of(context).countParticipants(mJoinedMemberCount.toString());
|
|
}
|
|
}
|