2 Commits

Author SHA1 Message Date
Bazsalanszky
241f082806 Translated using Weblate (Hungarian)
Currently translated at 82.7% (1094 of 1322 strings)

Translation: Eternity/App
Translate-URL: https://translate.codeberg.org/projects/infinity-for-lemmy/app/hu/
2024-07-22 10:07:25 +00:00
Bazsalanszky
56e05a2e84 Add indication for removed/deleted comments
It is now visible, if a comment is deleted by the creator or if it was removed by a moderator or admin.

Closes #249
2024-07-22 12:07:13 +02:00
5 changed files with 38 additions and 3 deletions

View File

@@ -443,9 +443,15 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
((CommentBaseViewHolder) holder).bottomConstraintLayout.getLayoutParams().height = LinearLayout.LayoutParams.WRAP_CONTENT;
((CommentBaseViewHolder) holder).topScoreTextView.setVisibility(View.GONE);
}
String text = comment.getCommentMarkdown();
if (comment.isRemoved()) {
text = "*"+mActivity.getString(R.string.removed_by_moderator)+"*";
} else if (comment.isDeleted()) {
text = "*"+mActivity.getString(R.string.deleted_by_creator)+"*";
}
((CommentBaseViewHolder) holder).mMarkwonAdapter.setMarkdown(mCommentMarkwon, comment.getCommentMarkdown());
((CommentBaseViewHolder) holder).mMarkwonAdapter.setMarkdown(mCommentMarkwon,text);
// noinspection NotifyDataSetChanged
((CommentBaseViewHolder) holder).mMarkwonAdapter.notifyDataSetChanged();
if (mHideDownvotes) {

View File

@@ -51,6 +51,7 @@ public class Comment implements Parcelable {
private boolean collapsed;
private boolean isDeleted;
private boolean isRemoved;
private boolean hasReply;
private boolean saved;
private boolean isExpanded;
@@ -69,7 +70,7 @@ public class Comment implements Parcelable {
long commentTimeMillis, String commentMarkdown, String commentRawText,
String linkId, String communityName, String communityQualifiedName, Integer parentId, int downvotes, int upvotes,
int voteType, boolean isSubmitter, String distinguished, String permalink,
int depth, boolean collapsed, boolean hasReply, boolean saved, boolean deleted, long edited, String[] path) {
int depth, boolean collapsed, boolean hasReply, boolean saved, boolean deleted,boolean removed, long edited, String[] path) {
this.id = id;
this.postId = postId;
this.author = author;
@@ -92,6 +93,7 @@ public class Comment implements Parcelable {
this.hasReply = hasReply;
this.saved = saved;
this.isDeleted = deleted;
this.isRemoved = removed;
this.isExpanded = false;
this.hasExpandedBefore = false;
this.editedTimeMillis = edited;
@@ -140,6 +142,8 @@ public class Comment implements Parcelable {
hasReply = in.readByte() != 0;
isExpanded = in.readByte() != 0;
hasExpandedBefore = in.readByte() != 0;
isDeleted = in.readByte() != 0;
isRemoved = in.readByte() != 0;
children = new ArrayList<>();
in.readTypedList(children, Comment.CREATOR);
moreChildrenIds = new ArrayList<>();
@@ -451,6 +455,8 @@ public class Comment implements Parcelable {
parcel.writeByte((byte) (hasReply ? 1 : 0));
parcel.writeByte((byte) (isExpanded ? 1 : 0));
parcel.writeByte((byte) (hasExpandedBefore ? 1 : 0));
parcel.writeByte((byte) (isDeleted ? 1 : 0));
parcel.writeByte((byte) (isRemoved ? 1 : 0));
parcel.writeTypedList(children);
List<String> childrenIds = new ArrayList<>();
if (moreChildrenIds != null) {
@@ -492,4 +498,16 @@ public class Comment implements Parcelable {
public BasicUserInfo getAuthor() {
return author;
}
public boolean isRemoved() {
return isRemoved;
}
public boolean isDeleted() {
return isDeleted;
}
public String getDistinguished() {
return distinguished;
}
}

View File

@@ -357,11 +357,12 @@ public class ParseComment {
boolean hasReply = countsObj.getInt("child_count") > 0;
boolean saved = jsonObject.getBoolean("saved");
boolean deleted = commentObj.getBoolean("deleted");
boolean removed = commentObj.getBoolean("removed");
long edited = 0;
BasicUserInfo authorInfo = new BasicUserInfo(creatorObj.getInt("id"), author, authorQualifiedName, creatorObj.optString("avatar", ""), creatorObj.optString("display_name", author));
Comment comment = new Comment(id, postID, authorInfo, linkAuthor, commentTimeMillis,
commentMarkdown, commentRawText, linkId, communityName, communityQualifiedName, parentId,
downvotes, upvotes, voteType, isSubmitter, distinguished, permalink, depth, collapsed, hasReply, saved, deleted, edited, path);
downvotes, upvotes, voteType, isSubmitter, distinguished, permalink, depth, collapsed, hasReply, saved, deleted,removed, edited, path);
int child_count = countsObj.getInt("child_count");
comment.setChildCount(child_count);
comment.setAuthorIconUrl(authorAvatar);

View File

@@ -1117,4 +1117,12 @@
<string name="customize_comment_filter_activity_label">Komment szűrő személyre szabása</string>
<string name="settings_reddit_user_agreement_title">Lemmy felhasználói megegyezés</string>
<string name="settings_custom_font_family_title">Egyedi betűtípus</string>
<string name="view_instance">Szerver megtekintése</string>
<string name="action_unblock_instance">Szerver tiltásának feloldása</string>
<string name="block_instance_failed">Szerver tiltása sikertelen</string>
<string name="action_block_instance">Szerver tiltása</string>
<string name="block_instance_success">Szerver tiltva!</string>
<string name="unblock_instance_success">Szerver tiltása feldoldva!</string>
<string name="settings_dont_hide_saved_read_posts_automatically">Ne rejtse el automatikusan az elmentett, olvasott bejegyzéseit</string>
<string name="settings_dont_hide_your_own_read_posts_automatically">Ne rejtse el automatikusan a saját, olvasott bejegyzéseit</string>
</resources>

View File

@@ -1332,4 +1332,6 @@
<string name="unblock_instance_success">Instance unblocked!</string>
<string name="settings_dont_hide_saved_read_posts_automatically">Don\'t hide saved read posts automatically</string>
<string name="settings_dont_hide_your_own_read_posts_automatically">Don\'t hide your own read posts automatically</string>
<string name="deleted_by_creator">deleted by creator</string>
<string name="removed_by_moderator">removed by moderator</string>
</resources>