NIMSDK-AOS  10.5.0
MemberChangeAttachment.java
浏览该文件的文档.
1 package com.netease.nimlib.sdk.team.model;
2 
4 import com.netease.nimlib.util.JSONHelper;
5 
6 import org.json.JSONArray;
7 import org.json.JSONObject;
8 
9 import java.util.ArrayList;
10 
32 
33  public static final String TAG_ACCOUNTS = "ids";
34  public static final String TAG_ACCOUNT = "id";
35 
39  private ArrayList<String> targets;
40 
41  public ArrayList<String> getTargets() {
42  return targets;
43  }
44 
45  @Override
46  public void parse(JSONObject json) {
47  super.parse(json);
48 
49  if (json.has(TAG_ACCOUNTS)) {
50  JSONArray array = JSONHelper.getJSONArray(json, TAG_ACCOUNTS);
51  targets = new ArrayList<>(array.length());
52  for (int i = 0; i < array.length(); ++i) {
53  targets.add(JSONHelper.getString(array, i));
54  }
55  } else if (json.has(TAG_ACCOUNT)) {
56  targets = new ArrayList<>(1);
57  targets.add(JSONHelper.getString(json, TAG_ACCOUNT));
58  }
59  }
60 }
群成员变动的通知消息实体。包括群成员变化和管理权限变化。 所有类型的变动,操作者均为消息的fromAccount...