feat: Implement new status feature

This commit is contained in:
Christian Pauly 2020-10-03 15:53:08 +02:00
commit c5d84c22ca
10 changed files with 329 additions and 245 deletions

View file

@ -1,10 +1,7 @@
import 'package:famedlysdk/famedlysdk.dart';
extension ClientPresenceExtension on Client {
static final Map<String, Profile> presencesCache = {};
Future<Profile> requestProfileCached(String senderId) async {
presencesCache[senderId] ??= await getProfileFromUserId(senderId);
return presencesCache[senderId];
}
List<Presence> get statuses => presences.values
.where((p) => p.presence.statusMsg?.isNotEmpty ?? false)
.toList();
}