diff --git a/src/main/java/fr/unix_experience/owncloud_sms/adapters/ContactListAdapter.java b/src/main/java/fr/unix_experience/owncloud_sms/adapters/ContactListAdapter.java
index d22ab9b..05d20c6 100644
--- a/src/main/java/fr/unix_experience/owncloud_sms/adapters/ContactListAdapter.java
+++ b/src/main/java/fr/unix_experience/owncloud_sms/adapters/ContactListAdapter.java
@@ -37,7 +37,7 @@ public class ContactListAdapter extends ArrayAdapter {
if (element != null) {
final TextView label = (TextView) v.findViewById(_fieldId);
if (label != null) {
- label.setText(element + " >");
+ label.setText(element);
label.setOnClickListener(new OnClickListener() {
@Override
public void onClick(final View v) {
diff --git a/src/main/java/fr/unix_experience/owncloud_sms/engine/ASyncContactLoad.java b/src/main/java/fr/unix_experience/owncloud_sms/engine/ASyncContactLoad.java
index 9640812..bfa8257 100644
--- a/src/main/java/fr/unix_experience/owncloud_sms/engine/ASyncContactLoad.java
+++ b/src/main/java/fr/unix_experience/owncloud_sms/engine/ASyncContactLoad.java
@@ -1,17 +1,18 @@
package fr.unix_experience.owncloud_sms.engine;
-import java.util.ArrayList;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
import android.accounts.Account;
import android.accounts.AccountManager;
import android.content.Context;
import android.net.Uri;
import android.os.AsyncTask;
-import android.util.Log;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+
+import java.util.ArrayList;
+import java.util.Collections;
+
+import fr.unix_experience.owncloud_sms.R;
import fr.unix_experience.owncloud_sms.adapters.ContactListAdapter;
import fr.unix_experience.owncloud_sms.exceptions.OCSyncException;
@@ -51,24 +52,23 @@ public interface ASyncContactLoad {
try {
if (_client.getServerAPIVersion() < 2) {
- // @TODO: handle error
+ _objects.add(_context.getString(R.string.err_proto_v2));
return false;
}
JSONArray phoneNumbers = _client.getServerPhoneNumbers();
- Log.d(TAG, phoneNumbers.toString());
for (int i = 0; i < phoneNumbers.length(); i++) {
String phone = phoneNumbers.getString(i);
_objects.add(phone);
}
+ // Sort phone numbers
+ Collections.sort(_objects);
} catch (JSONException e) {
- // @TODO: handle error
- e.printStackTrace();
+ _objects.add(_context.getString(R.string.err_fetch_phonelist));
return false;
} catch (final OCSyncException e) {
- // @TODO: handle error
- e.printStackTrace();
+ _objects.add(_context.getString(e.getErrorId()));
return false;
}
return true;
diff --git a/src/main/res/values-en/strings.xml b/src/main/res/values-en/strings.xml
index 004e077..7c4206f 100644
--- a/src/main/res/values-en/strings.xml
+++ b/src/main/res/values-en/strings.xml
@@ -158,5 +158,7 @@ Contributors and issue\'s reporters
Error #16: No data connection available
Error #17: malformed account. Please reconfigure it
Error #18: OcSMS app is not installed or ownCloud awaiting for an upgrade
+ Invalid phonelist received from server.
+ Server doesn\'t support this feature. Ensure server version is at least 1.6.
diff --git a/src/main/res/values-fr/strings.xml b/src/main/res/values-fr/strings.xml
index 461d2e9..b178a25 100644
--- a/src/main/res/values-fr/strings.xml
+++ b/src/main/res/values-fr/strings.xml
@@ -118,4 +118,6 @@ Les contributeurs et rapporteurs de bugs
Erreur #16: Aucune connexion data disponible
Error #17: Compte mal configuré. Merci de bien vouloir le reconfigurer.
Error #18: L\'application OcSMS n\'est pas installée ou ownCloud attend d\'être mis à niveau.
+ La liste de numéros reçue depuis le serveur est invalide.
+ Le serveur ne supporte pas cette fonctionnalité. Assurez vous que le serveur est au moins en version 1.6.
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index 8e0a45d..1867b4b 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -168,6 +168,8 @@ Contributors and issue\'s reporters
Error #16: No data connection available
Error #17: malformed account. Please reconfigure it
Error #18: OcSMS app is not installed or ownCloud awaiting for an upgrade
+ Invalid phonelist received from server.
+ Server doesn\'t support this feature. Ensure server version is at least 1.6.
MainActivity
Section 1