Don't consider drafts for the up-to-date check on changes

This is based on the following two Gerrit core changes:
I36c1e2f56127a7e5a11769bf36daf586e32d8bcf
Ie66138180f3df65c82624905ecdab915992b381b

With those changes, draft and stars are not any more part of the
change's state and existence of draft comments doesn't have any effect
on changes staleness check.

This change is based on Saša's equivalent fix on the high-availability
plugin I88eadaa4.

Change-Id: I9644fbdce5104d1a2a9f84a53fce085f0f80d4de
(cherry picked from commit 3ad0638ded6acb5c2fe9232b31879f80261caaf8)
diff --git a/src/main/java/com/googlesource/gerrit/plugins/multisite/index/ChangeCheckerImpl.java b/src/main/java/com/googlesource/gerrit/plugins/multisite/index/ChangeCheckerImpl.java
index f3fa2e3..57c7cd1 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/multisite/index/ChangeCheckerImpl.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/multisite/index/ChangeCheckerImpl.java
@@ -15,9 +15,7 @@
 package com.googlesource.gerrit.plugins.multisite.index;
 
 import com.google.gerrit.entities.Change;
-import com.google.gerrit.entities.HumanComment;
 import com.google.gerrit.exceptions.StorageException;
-import com.google.gerrit.server.DraftCommentsReader;
 import com.google.gerrit.server.change.ChangeFinder;
 import com.google.gerrit.server.config.GerritInstanceId;
 import com.google.gerrit.server.config.GerritServerConfig;
@@ -45,12 +43,10 @@
 public class ChangeCheckerImpl implements ChangeChecker {
   private static final Logger log = LoggerFactory.getLogger(ChangeCheckerImpl.class);
   private final GitRepositoryManager gitRepoMgr;
-  private final DraftCommentsReader draftCommentsReader;
   private final OneOffRequestContext oneOffReqCtx;
   private final String changeId;
   private final ChangeFinder changeFinder;
   private final String instanceId;
-  private final boolean enableDraftCommentEvents;
   private Optional<Long> computedChangeTs = Optional.empty();
   private Optional<ChangeNotes> changeNotes = Optional.empty();
 
@@ -67,7 +63,6 @@
   @Inject
   public ChangeCheckerImpl(
       GitRepositoryManager gitRepoMgr,
-      DraftCommentsReader draftCommentsReader,
       ChangeFinder changeFinder,
       OneOffRequestContext oneOffReqCtx,
       @GerritInstanceId String instanceId,
@@ -75,12 +70,9 @@
       @Assisted String changeId) {
     this.changeFinder = changeFinder;
     this.gitRepoMgr = gitRepoMgr;
-    this.draftCommentsReader = draftCommentsReader;
     this.oneOffReqCtx = oneOffReqCtx;
     this.changeId = changeId;
     this.instanceId = instanceId;
-    this.enableDraftCommentEvents =
-        config.getBoolean("event", "stream-events", "enableDraftCommentEvents", false);
   }
 
   @Override
@@ -198,23 +190,12 @@
   }
 
   private Optional<Long> computeLastChangeTs() {
-    return getChangeNotes().map(this::getTsFromChangeAndDraftComments);
+    return getChangeNotes().map(this::getTsFromChange);
   }
 
-  private long getTsFromChangeAndDraftComments(ChangeNotes notes) {
+  private long getTsFromChange(ChangeNotes notes) {
     Change change = notes.getChange();
     Timestamp changeTs = Timestamp.from(change.getLastUpdatedOn());
-    if (enableDraftCommentEvents) {
-      try {
-        for (HumanComment comment :
-            draftCommentsReader.getDraftsByChangeForAllAuthors(changeNotes.get())) {
-          Timestamp commentTs = comment.writtenOn;
-          changeTs = commentTs.after(changeTs) ? commentTs : changeTs;
-        }
-      } catch (StorageException e) {
-        log.warn("Unable to access draft comments for change {}", change, e);
-      }
-    }
     return changeTs.getTime() / 1000;
   }
 }