Skip to main content

Remove chatroom attributes in batches. Removals synchronize automatically to all chatroom members and are returned through the chatroom attribute-change event.

API Definition

/**
* remove chatroom attributes
*
* @param chatroomId chatroom ID
* @param keys List of attribute keys to remove. A key not set by the current user cannot be removed.
* @param callback Completion callback.
* JErrorCode.NONE indicates that all attributes were removed successfully.
* Other codes indicate that one or more keys could not be removed. Every failed key is returned with its error code; see JErrorCode for the corresponding definition.
*/
void removeAttributes(String chatroomId, List<String> keys, IChatroomAttributesUpdateCallback callback);

Example

List<String> keys = new ArrayList<>();
keys.add("Key1");
JIM.getInstance().getChatroomManager().removeAttributes("chatroomId1", keys, new IChatroomManager.IChatroomAttributesUpdateCallback() {
@Override
public void onComplete(int errorCode, Map<String, Integer> failedKeys) {

}
});