diff options
Diffstat (limited to 'app/src')
4 files changed, 17 insertions, 2 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java index 2c5deded..5836dacd 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java @@ -987,8 +987,15 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi } public void editComment(String commentAuthor, String commentContentMarkdown, int position) { - if (commentAuthor != null) + editComment(commentAuthor, mVisibleComments.get(position).isSubmitter(), commentContentMarkdown, position); + } + + public void editComment(String commentAuthor, boolean isSubmitter, String commentContentMarkdown, int position) { + if (commentAuthor != null) { mVisibleComments.get(position).setAuthor(commentAuthor); + } + + mVisibleComments.get(position).setSubmittedByAuthor(isSubmitter); mVisibleComments.get(position).setCommentMarkdown(commentContentMarkdown); if (mIsSingleCommentThreadMode) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/comment/Comment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/comment/Comment.java index 2ac6ba70..15b1b68d 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/comment/Comment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/comment/Comment.java @@ -233,6 +233,10 @@ public class Comment implements Parcelable { return isSubmitter; } + public void setSubmittedByAuthor(boolean isSubmittedByAuthor) { + this.isSubmitter = isSubmittedByAuthor; + } + public boolean isModerator() { return distinguished != null && distinguished.equals("moderator"); } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/comment/FetchRemovedComment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/comment/FetchRemovedComment.java index 8dc4b84b..39b8e2b5 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/comment/FetchRemovedComment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/comment/FetchRemovedComment.java @@ -56,7 +56,7 @@ public class FetchRemovedComment { comment.getLinkId(), 3000, "asc", - "id,author,body", + "id,author,body,is_submitter", after, after + 43200, // 12 Hours later "*").execute(); @@ -107,6 +107,7 @@ public class FetchRemovedComment { String id = result.getString(JSONUtils.ID_KEY); String author = result.getString(JSONUtils.AUTHOR_KEY); String body = Utils.modifyMarkdown(result.optString(JSONUtils.BODY_KEY).trim()); + boolean isSubmitter = result.getBoolean(JSONUtils.IS_SUBMITTER_KEY); if (id.equals(comment.getId()) && (!author.equals(comment.getAuthor()) || @@ -115,6 +116,7 @@ public class FetchRemovedComment { comment.setAuthor(author); comment.setCommentMarkdown(body); comment.setCommentRawText(body); + comment.setSubmittedByAuthor(isSubmitter); return comment; } else { return null; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/comment/FetchRemovedCommentReveddit.java b/app/src/main/java/ml/docilealligator/infinityforreddit/comment/FetchRemovedCommentReveddit.java index 36894561..ab9c9c5a 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/comment/FetchRemovedCommentReveddit.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/comment/FetchRemovedCommentReveddit.java @@ -55,11 +55,13 @@ public class FetchRemovedCommentReveddit { String id = result.getString(JSONUtils.ID_KEY); String author = result.getString(JSONUtils.AUTHOR_KEY); String body = Utils.modifyMarkdown(result.optString(JSONUtils.BODY_KEY).trim()); + boolean isSubmitter = result.getBoolean(JSONUtils.IS_SUBMITTER_KEY); if (id.equals(comment.getId()) && (!author.equals(comment.getAuthor()) || !body.equals(comment.getCommentRawText()))) { comment.setAuthor(author); comment.setCommentMarkdown(body); comment.setCommentRawText(body); + comment.setSubmittedByAuthor(isSubmitter); return comment; } else { return null; |