package chat.rocket.android.layouthelper.chatroom.roomlist;

import android.support.annotation.NonNull;

import chat.rocket.core.models.RoomSidebar;
import java.util.List;
import chat.rocket.core.models.Room;

public class DirectMessageRoomListHeader implements RoomListHeader {

  private final String title;
  private final ClickListener clickListener;

  public DirectMessageRoomListHeader(String title, ClickListener clickListener) {
    this.title = title;
    this.clickListener = clickListener;
  }

  @Override
  public String getTitle() {
    return title;
  }

  @Override
  public boolean owns(RoomSidebar roomSidebar) {
    return roomSidebar.getType().equals(Room.TYPE_DIRECT_MESSAGE);
  }

  @Override
  public boolean shouldShow(@NonNull List<RoomSidebar> roomSidebarList) {
    return true;
  }

  @Override
  public ClickListener getClickListener() {
    return clickListener;
  }
}

@@ -791,18 +791,258 @@
     
-return tru
+for (RoomSidebar roomSidebar: roomSidebarList) %7B%0A      if (roomSidebar.getType().equals(Room.TYPE_DIRECT_MESSAGE)%0A              && !roomSidebar.isAlert()%0A              && !roomSidebar.isFavorite()) %7B%0A        return true;%0A      %7D%0A    %7D%0A    return fals
 e;%0A 
@@ -1131,10 +1131,9 @@
 er;%0A  %7D%0A
+
 %7D
-%0A

Update DirectMessageRoomListHeader.java