NIMSDK-AOS  9.16.3
ChatRoomRoomMemberInAttachment.java
浏览该文件的文档.
1 package com.netease.nimlib.sdk.chatroom.model;
2 
3 import com.netease.nimlib.util.JSONHelper;
4 
5 import org.json.JSONObject;
6 
12 
13  private static final String TAG_MUTED = "muted";
14  private static final String TAG_TEMP_MUTED = "tempMuted";
15  private static final String TAG_MUTE_TEMP_TIME_LENGTH = "muteTtl";
16 
17  private int muted;
18 
19  private int tempMuted;
20 
21  private long muteTtl;
25  public boolean isMuted() {
26  return muted == 1;
27  }
28 
32  public boolean isTempMuted() {
33  return tempMuted == 1;
34  }
35 
39  public long getTempMutedTime() {
40  return muteTtl;
41  }
42 
43  @Override
44  public void parse(JSONObject json) {
45  super.parse(json);
46  if (json.has(TAG_MUTED)) {
47  muted = JSONHelper.getInt(json, TAG_MUTED);
48  }
49 
50  if (json.has(TAG_TEMP_MUTED)) {
51  tempMuted = JSONHelper.getInt(json, TAG_TEMP_MUTED);
52  }
53 
54  if (json.has(TAG_MUTE_TEMP_TIME_LENGTH)) {
55  muteTtl = JSONHelper.getLong(json, TAG_MUTE_TEMP_TIME_LENGTH);
56  }
57  }
58 }
boolean isMuted()
是否是禁言状态,1:是,缺省或0表示非禁言状态;