FurryChat/lib/utils/room_name_calculator.dart

17 lines
361 B
Dart
Raw Normal View History

2020-01-08 19:43:30 +00:00
import 'package:famedlysdk/famedlysdk.dart';
class RoomNameCalculator {
final Room room;
const RoomNameCalculator(this.room);
String get name {
2020-01-17 08:21:12 +00:00
if ((room.name?.isEmpty ?? true) &&
(room.canonicalAlias?.isEmpty ?? true) &&
2020-01-08 19:43:30 +00:00
!room.isDirectChat) {
return "Group with ${room.displayname}";
}
return room.displayname;
}
}