1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-06-19 00:05:16 +00:00

Display user location & email address on about tab

This commit is contained in:
2021-04-17 08:47:05 +02:00
parent 5fd74f9047
commit bdbdc2c790
3 changed files with 33 additions and 5 deletions

View File

@ -27,7 +27,6 @@ class GetUserAdvancedUserError extends Error {
}
class UsersHelper {
/// Download information about some given users ID
///
/// Return the list of users information in case of success, null in case of
@ -96,8 +95,7 @@ class UsersHelper {
{bool forceDownload = false}) async {
final list = await getUsersInfo(users.toList());
if (list == null)
throw Exception("Failed to get the list of users!");
if (list == null) throw Exception("Failed to get the list of users!");
return list;
}
@ -113,8 +111,10 @@ class UsersHelper {
// Check cache
for (int userID in users) {
if (!forceDownload && await UsersListSerialisationHelper().any((u) => u.id == userID))
list.add(await UsersListSerialisationHelper().first((u) => u.id == userID));
if (!forceDownload &&
await UsersListSerialisationHelper().any((u) => u.id == userID))
list.add(
await UsersListSerialisationHelper().first((u) => u.id == userID));
else
toDownload.add(userID);
}
@ -165,6 +165,7 @@ class UsersHelper {
virtualDirectory:
data["virtualDirectory"] == "" ? null : data["virtualDirectory"],
accountImageURL: data["accountImage"],
emailAddress: data["email_address"],
customEmojies: _parseCustomEmojies(data["customEmojis"]),
publicNote: data["publicNote"],
canPostTexts: data["can_post_texts"],
@ -172,6 +173,7 @@ class UsersHelper {
numberFriends: data["number_friends"],
accountCreationTime: data["account_creation_time"],
personalWebsite: data["personnalWebsite"],
location: data["location"],
likes: data["pageLikes"],
userLike: data["user_like_page"],
);