From eee570993a3e683f2521b98dc852d1587d24b2a3 Mon Sep 17 00:00:00 2001 From: Pierre Date: Sun, 31 Dec 2017 12:16:11 +0100 Subject: [PATCH] Optimized getDisplayName --- .idea/misc.xml | 2 +- .../data/conversations/ConversationsListHelper.java | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 503aca7..33952c6 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -55,7 +55,7 @@ - + diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/conversations/ConversationsListHelper.java b/app/src/main/java/org/communiquons/android/comunic/client/data/conversations/ConversationsListHelper.java index 169e3c4..ef7a604 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/conversations/ConversationsListHelper.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/conversations/ConversationsListHelper.java @@ -117,9 +117,15 @@ public class ConversationsListHelper { //Get the list of members of the conversation ArrayList members = infos.getMembers(); + //Get the ID of the three first members + ArrayList membersToGet = new ArrayList<>(); + for(int ID : members){ + membersToGet.add(ID); + } + //Get information about the users ArrayMap users = - new GetUsersHelper(mContext, dbHelper).getMultiple(members); + new GetUsersHelper(mContext, dbHelper).getMultiple(membersToGet); if(users == null) return ""; //No name by default