/** * remove group from the list * @param groupId */ public void removeAtMeGroup(String groupId){ if(atMeGroupList.contains(groupId)){ atMeGroupList.remove(groupId); EasePreferenceManager.getInstance().setAtMeGroups(atMeGroupList); } }
private EaseAtMessageHelper(){ atMeGroupList = EasePreferenceManager.getInstance().getAtMeGroups(); if(atMeGroupList == null) atMeGroupList = new HashSet<String>(); }
private EaseAtMessageHelper(){ atMeGroupList = EasePreferenceManager.getInstance().getAtMeGroups(); if(atMeGroupList == null) atMeGroupList = new HashSet<String>(); }
/** * remove group from the list * @param groupId */ public void removeAtMeGroup(String groupId){ if(atMeGroupList.contains(groupId)){ atMeGroupList.remove(groupId); EasePreferenceManager.getInstance().setAtMeGroups(atMeGroupList); } }
private EaseAtMessageHelper(){ atMeGroupList = EasePreferenceManager.getInstance().getAtMeGroups(); if(atMeGroupList == null) atMeGroupList = new HashSet<String>(); }
/** * remove group from the list * @param groupId */ public void removeAtMeGroup(String groupId){ if(atMeGroupList.contains(groupId)){ atMeGroupList.remove(groupId); EasePreferenceManager.getInstance().setAtMeGroups(atMeGroupList); } }
private EaseAtMessageHelper(){ atMeGroupList = EasePreferenceManager.getInstance().getAtMeGroups(); if(atMeGroupList == null) atMeGroupList = new HashSet<String>(); }
/** * remove group from the list * @param groupId */ public void removeAtMeGroup(String groupId){ if(atMeGroupList.contains(groupId)){ atMeGroupList.remove(groupId); EasePreferenceManager.getInstance().setAtMeGroups(atMeGroupList); } }
EasePreferenceManager.getInstance().setAtMeGroups(atMeGroupList);
EasePreferenceManager.getInstance().setAtMeGroups(atMeGroupList);
EasePreferenceManager.getInstance().setAtMeGroups(atMeGroupList);
/** * parse the message, get and save group id if I was mentioned(@) * @param messages */ public void parseMessages(List<EMMessage> messages) { int size = atMeGroupList.size(); EMMessage[] msgs = messages.toArray(new EMMessage[]{}); for(EMMessage msg : msgs){ if(msg.getChatType() == ChatType.GroupChat){ String groupId = msg.getTo(); String usernameStr = msg.getStringAttribute(EaseConstant.MESSAGE_ATTR_AT_MSG, null); if(usernameStr != null){ String[] usernames = usernameStr.split(","); for(String username : usernames){ if(EMClient.getInstance().getCurrentUser().equals(username)){ if(!atMeGroupList.contains(groupId)){ atMeGroupList.add(groupId); break; } } } if(atMeGroupList.size() != size){ EasePreferenceManager.getInstance().setAtMeGroups(atMeGroupList); } } } } }