Add group prefix
This commit is contained in:
parent
c686c8ce0e
commit
8b3101c7e3
6 changed files with 30 additions and 7 deletions
16
lib/utils/room_name_calculator.dart
Normal file
16
lib/utils/room_name_calculator.dart
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import 'package:famedlysdk/famedlysdk.dart';
|
||||
|
||||
class RoomNameCalculator {
|
||||
final Room room;
|
||||
|
||||
const RoomNameCalculator(this.room);
|
||||
|
||||
String get name {
|
||||
if (room.name.isEmpty &&
|
||||
room.canonicalAlias.isEmpty &&
|
||||
!room.isDirectChat) {
|
||||
return "Group with ${room.displayname}";
|
||||
}
|
||||
return room.displayname;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue