diff --git a/.idea/misc.xml b/.idea/misc.xml index 33952c6..503aca7 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 adf7e49..169e3c4 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 @@ -9,6 +9,7 @@ import android.util.Log; import org.communiquons.android.comunic.client.api.APIRequest; import org.communiquons.android.comunic.client.api.APIRequestParameters; import org.communiquons.android.comunic.client.api.APIResponse; +import org.communiquons.android.comunic.client.data.Account.AccountUtils; import org.communiquons.android.comunic.client.data.DatabaseHelper; import org.communiquons.android.comunic.client.data.UsersInfo.GetUsersHelper; import org.communiquons.android.comunic.client.data.UsersInfo.UserInfo; @@ -127,6 +128,11 @@ public class ConversationsListHelper { int count = 0; for(Integer id : users.keySet()){ + + //Do not display current user name + if(id == new AccountUtils(mContext).get_current_user_id()) + continue; + if(users.get(id) != null){ if(count > 0) diff --git a/app/src/main/java/org/communiquons/android/comunic/client/fragments/ConversationsListFragment.java b/app/src/main/java/org/communiquons/android/comunic/client/fragments/ConversationsListFragment.java index 548723e..4fe29cc 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/fragments/ConversationsListFragment.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/fragments/ConversationsListFragment.java @@ -18,6 +18,7 @@ import android.widget.Toast; import org.communiquons.android.comunic.client.MainActivity; import org.communiquons.android.comunic.client.R; +import org.communiquons.android.comunic.client.data.Account.AccountUtils; import org.communiquons.android.comunic.client.data.DatabaseHelper; import org.communiquons.android.comunic.client.data.UsersInfo.GetUsersHelper; import org.communiquons.android.comunic.client.data.UsersInfo.UserInfo; @@ -204,12 +205,20 @@ public class ConversationsListFragment extends Fragment implements AdapterView.O int count = 0; for(int userID : conv.getMembers()){ + //Do not display current user name + if(userID == new AccountUtils(getActivity()).get_current_user_id()) + continue; + if(usersInfo.containsKey(userID)){ UserInfo userInfo = usersInfo.get(userID); + if(count > 0){ + conversationName += ", "; + } + if(userInfo != null){ - conversationName += userInfo.getFullName() + ", "; + conversationName += userInfo.getFullName(); count++; }