mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-12-28 11:58:23 +01:00
Show OP badge on restored comment (#1016)
This commit is contained in:
parent
9fad6fc961
commit
3c492d2626
@ -987,8 +987,15 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void editComment(String commentAuthor, String commentContentMarkdown, int position) {
|
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).setAuthor(commentAuthor);
|
||||||
|
}
|
||||||
|
|
||||||
|
mVisibleComments.get(position).setSubmittedByAuthor(isSubmitter);
|
||||||
|
|
||||||
mVisibleComments.get(position).setCommentMarkdown(commentContentMarkdown);
|
mVisibleComments.get(position).setCommentMarkdown(commentContentMarkdown);
|
||||||
if (mIsSingleCommentThreadMode) {
|
if (mIsSingleCommentThreadMode) {
|
||||||
|
@ -233,6 +233,10 @@ public class Comment implements Parcelable {
|
|||||||
return isSubmitter;
|
return isSubmitter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setSubmittedByAuthor(boolean isSubmittedByAuthor) {
|
||||||
|
this.isSubmitter = isSubmittedByAuthor;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isModerator() {
|
public boolean isModerator() {
|
||||||
return distinguished != null && distinguished.equals("moderator");
|
return distinguished != null && distinguished.equals("moderator");
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ public class FetchRemovedComment {
|
|||||||
comment.getLinkId(),
|
comment.getLinkId(),
|
||||||
3000,
|
3000,
|
||||||
"asc",
|
"asc",
|
||||||
"id,author,body",
|
"id,author,body,is_submitter",
|
||||||
after,
|
after,
|
||||||
after + 43200, // 12 Hours later
|
after + 43200, // 12 Hours later
|
||||||
"*").execute();
|
"*").execute();
|
||||||
@ -107,6 +107,7 @@ public class FetchRemovedComment {
|
|||||||
String id = result.getString(JSONUtils.ID_KEY);
|
String id = result.getString(JSONUtils.ID_KEY);
|
||||||
String author = result.getString(JSONUtils.AUTHOR_KEY);
|
String author = result.getString(JSONUtils.AUTHOR_KEY);
|
||||||
String body = Utils.modifyMarkdown(result.optString(JSONUtils.BODY_KEY).trim());
|
String body = Utils.modifyMarkdown(result.optString(JSONUtils.BODY_KEY).trim());
|
||||||
|
boolean isSubmitter = result.getBoolean(JSONUtils.IS_SUBMITTER_KEY);
|
||||||
|
|
||||||
if (id.equals(comment.getId()) &&
|
if (id.equals(comment.getId()) &&
|
||||||
(!author.equals(comment.getAuthor()) ||
|
(!author.equals(comment.getAuthor()) ||
|
||||||
@ -115,6 +116,7 @@ public class FetchRemovedComment {
|
|||||||
comment.setAuthor(author);
|
comment.setAuthor(author);
|
||||||
comment.setCommentMarkdown(body);
|
comment.setCommentMarkdown(body);
|
||||||
comment.setCommentRawText(body);
|
comment.setCommentRawText(body);
|
||||||
|
comment.setSubmittedByAuthor(isSubmitter);
|
||||||
return comment;
|
return comment;
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
|
@ -55,11 +55,13 @@ public class FetchRemovedCommentReveddit {
|
|||||||
String id = result.getString(JSONUtils.ID_KEY);
|
String id = result.getString(JSONUtils.ID_KEY);
|
||||||
String author = result.getString(JSONUtils.AUTHOR_KEY);
|
String author = result.getString(JSONUtils.AUTHOR_KEY);
|
||||||
String body = Utils.modifyMarkdown(result.optString(JSONUtils.BODY_KEY).trim());
|
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()))) {
|
if (id.equals(comment.getId()) && (!author.equals(comment.getAuthor()) || !body.equals(comment.getCommentRawText()))) {
|
||||||
comment.setAuthor(author);
|
comment.setAuthor(author);
|
||||||
comment.setCommentMarkdown(body);
|
comment.setCommentMarkdown(body);
|
||||||
comment.setCommentRawText(body);
|
comment.setCommentRawText(body);
|
||||||
|
comment.setSubmittedByAuthor(isSubmitter);
|
||||||
return comment;
|
return comment;
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
Reference in New Issue
Block a user