|
|
@@ -447,7 +447,7 @@ public class ContactsActivity extends OABaseActivity implements ContactsAdapter.
|
|
|
StringBuilder builder = new StringBuilder();
|
|
|
int i = 0;
|
|
|
for (ContactsModel u : models) {
|
|
|
- if (u.getType() == 3) {
|
|
|
+ if (u.getType() == 3||u.getType()==2) {
|
|
|
if (i == models.size() - 1) {
|
|
|
builder.append(u.getPhone());
|
|
|
} else {
|
|
|
@@ -493,16 +493,15 @@ public class ContactsActivity extends OABaseActivity implements ContactsAdapter.
|
|
|
|
|
|
if (!ListUtils.isEmpty(array)) {
|
|
|
JSONObject o = null;
|
|
|
-// for (ContactsModel model:models){
|
|
|
-// model.setType(3);
|
|
|
-// }
|
|
|
+ for (int j = 0; j < models.size(); j++) {
|
|
|
+ ContactsModel model = models.get(j);
|
|
|
for (int i = 0; i < array.size(); i++) {
|
|
|
o = array.getJSONObject(i);
|
|
|
String telephone = OACheckUtil.getJson2Text(o, "telephone");
|
|
|
String isfriend = OACheckUtil.getJson2Text(o, "isfriend");
|
|
|
int _id = OACheckUtil.getJsonIntager(o, "_id");
|
|
|
- for (int j = 0; j < models.size(); j++) {
|
|
|
- ContactsModel model = models.get(j);
|
|
|
+
|
|
|
+
|
|
|
if (model.getPhone().equals(telephone)) {
|
|
|
if (isfriend.equals("0")) {
|
|
|
model.setType(2);//非好友
|
|
|
@@ -513,6 +512,13 @@ public class ContactsActivity extends OABaseActivity implements ContactsAdapter.
|
|
|
model.setImid(String.valueOf(_id));
|
|
|
contactsDao.update(model,"0");
|
|
|
}
|
|
|
+ break;
|
|
|
+ }else{
|
|
|
+ if (model.getType()==2){
|
|
|
+ model.setType(3);//通讯录
|
|
|
+ model.setImid(model.getImid());
|
|
|
+ contactsDao.update(model,model.getImid());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|