2020-01-19 14:07:42 +00:00
|
|
|
import 'package:famedlysdk/famedlysdk.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
extension LocalizedRoomDisplayname on Room {
|
|
|
|
String getLocalizedDisplayname(BuildContext context) {
|
|
|
|
if ((this.name?.isEmpty ?? true) &&
|
|
|
|
(this.canonicalAlias?.isEmpty ?? true) &&
|
2020-01-19 15:56:13 +00:00
|
|
|
!this.isDirectChat &&
|
|
|
|
this.mHeroes.isNotEmpty) {
|
2020-01-19 14:07:42 +00:00
|
|
|
return "Group with ${this.displayname}";
|
|
|
|
}
|
|
|
|
return this.displayname;
|
|
|
|
}
|
|
|
|
}
|