@Override
    public boolean isVisible(SourceContact actionSource) {
      if (!(actionSource instanceof ChatRoomSourceContact)) return false;

      if (name.equals("autojoin") || name.equals("autojoin_pressed")) {
        ChatRoomSourceContact contact = (ChatRoomSourceContact) actionSource;
        ChatRoomWrapper room =
            MUCActivator.getMUCService().findChatRoomWrapperFromSourceContact(contact);
        if (name.equals("autojoin")) return !room.isAutojoin();

        if (name.equals("autojoin_pressed")) return room.isAutojoin();
      }
      return true;
    }
    @Override
    public boolean isVisible(SourceContact actionSource) {
      if (actionSource instanceof ChatRoomSourceContact) {
        if (name.equals("leave")) {
          return actionsEnabledCheckers[3].check(actionSource);
        } else if (name.equals("join")) {
          return actionsEnabledCheckers[1].check(actionSource);
        } else {
          ChatRoomSourceContact contact = (ChatRoomSourceContact) actionSource;
          ChatRoomWrapper room =
              MUCActivator.getMUCService().findChatRoomWrapperFromSourceContact(contact);
          if (room == null) return false;

          if (name.equals("autojoin")) return room.isAutojoin();
          else if (name.equals("autojoin_pressed")) return !room.isAutojoin();
        }
      }
      return false;
    }
 @Override
 public boolean isSelected(SourceContact contact) {
   ChatRoomWrapper chatRoomWrapper =
       MUCActivator.getMUCService().findChatRoomWrapperFromSourceContact(contact);
   return chatRoomWrapper.isAutojoin();
 }