Optimized getDisplayName

This commit is contained in:
Pierre 2017-12-31 12:16:11 +01:00
parent 95844e8ba2
commit eee570993a
2 changed files with 8 additions and 2 deletions

2
.idea/misc.xml generated
View File

@ -55,7 +55,7 @@
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">

View File

@ -117,9 +117,15 @@ public class ConversationsListHelper {
//Get the list of members of the conversation
ArrayList<Integer> members = infos.getMembers();
//Get the ID of the three first members
ArrayList<Integer> membersToGet = new ArrayList<>();
for(int ID : members){
membersToGet.add(ID);
}
//Get information about the users
ArrayMap<Integer, UserInfo> users =
new GetUsersHelper(mContext, dbHelper).getMultiple(members);
new GetUsersHelper(mContext, dbHelper).getMultiple(membersToGet);
if(users == null)
return ""; //No name by default