presence representation
This commit is contained in:
parent
80dc7321da
commit
e99521c3f0
3 changed files with 10 additions and 10 deletions
|
|
@ -1,13 +1,10 @@
|
|||
import 'package:famedlysdk/famedlysdk.dart';
|
||||
import 'package:fluffychat/i18n/i18n.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'date_time_extension.dart';
|
||||
|
||||
extension PresenceExtension on Presence {
|
||||
bool get isStatus =>
|
||||
(statusMsg?.isNotEmpty ?? false) || this.displayname != null;
|
||||
|
||||
String getLocalizedStatusMessage(BuildContext context) {
|
||||
if (!isStatus) return '';
|
||||
if (statusMsg?.isNotEmpty ?? false) {
|
||||
return statusMsg;
|
||||
}
|
||||
|
|
@ -15,9 +12,6 @@ extension PresenceExtension on Presence {
|
|||
return I18n.of(context)
|
||||
.changedTheDisplaynameTo(sender.localpart, displayname);
|
||||
}
|
||||
if (avatarUrl != null) {
|
||||
return I18n.of(context).changedTheProfileAvatar(sender.localpart);
|
||||
}
|
||||
return null;
|
||||
return I18n.of(context).lastActiveAgo(time.localizedTimeShort(context));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue