fluffychat/lib/utils/client_presence_extension.dart

11 lines
328 B
Dart
Raw Normal View History

import 'package:famedlysdk/famedlysdk.dart';
extension ClientPresenceExtension on Client {
2020-06-18 13:39:24 +02:00
static final Map<String, Profile> presencesCache = {};
Future<Profile> requestProfileCached(String senderId) async {
presencesCache[senderId] ??= await getProfileFromUserId(senderId);
return presencesCache[senderId];
}
}