mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-24 04:59:26 +01:00
a980217779
Took 21 minutes
16 lines
513 B
Dart
16 lines
513 B
Dart
import 'package:famedlysdk/famedlysdk.dart';
|
|
import 'package:fluffychat/i18n/i18n.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
extension LocalizedRoomDisplayname on Room {
|
|
String getLocalizedDisplayname(BuildContext context) {
|
|
if ((this.name?.isEmpty ?? true) &&
|
|
(this.canonicalAlias?.isEmpty ?? true) &&
|
|
!this.isDirectChat &&
|
|
(this.mHeroes != null && this.mHeroes.isNotEmpty)) {
|
|
return I18n.of(context).groupWith(this.displayname);
|
|
}
|
|
return this.displayname;
|
|
}
|
|
}
|