mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-06 10:47:27 +01:00
Fix issue with comment editing
In some change the behavior for detecting the users comments broke making it impossible to edit or delete previously created comments. Closes #136
This commit is contained in:
parent
f61c12a30b
commit
d216fc4640
@ -99,7 +99,8 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
|
||||
private Retrofit mOauthRetrofit;
|
||||
private Markwon mCommentMarkwon;
|
||||
private String mAccessToken;
|
||||
private String mAccountName;
|
||||
private String mAccountQualifiedName;
|
||||
|
||||
private Post mPost;
|
||||
private ArrayList<Comment> mVisibleComments;
|
||||
|
||||
@ -217,7 +218,7 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
|
||||
miscPlugin, mCommentTextColor, commentSpoilerBackgroundColor, onLinkLongClickListener);
|
||||
recycledViewPool = new RecyclerView.RecycledViewPool();
|
||||
mAccessToken = accessToken;
|
||||
mAccountName = accountName;
|
||||
mAccountQualifiedName = accountName;
|
||||
mPost = post;
|
||||
mVisibleComments = new ArrayList<>();
|
||||
loadedComments = new HashSet<>();
|
||||
@ -389,7 +390,7 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
|
||||
Drawable moderatorDrawable = Utils.getTintedDrawable(mActivity, R.drawable.ic_verified_user_14dp, mModeratorColor);
|
||||
((CommentViewHolder) holder).authorTextView.setCompoundDrawablesWithIntrinsicBounds(
|
||||
moderatorDrawable, null, null, null);
|
||||
} else if (comment.getAuthor().equals(mAccountName)) {
|
||||
} else if (comment.getAuthorQualifiedName().equals(mAccountQualifiedName)) {
|
||||
((CommentViewHolder) holder).authorTextView.setTextColor(mCurrentUserColor);
|
||||
Drawable currentUserDrawable = Utils.getTintedDrawable(mActivity, R.drawable.ic_current_user_14dp, mCurrentUserColor);
|
||||
((CommentViewHolder) holder).authorTextView.setCompoundDrawablesWithIntrinsicBounds(
|
||||
@ -1373,7 +1374,7 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
|
||||
Comment comment = getCurrentComment(this);
|
||||
if (comment != null) {
|
||||
Bundle bundle = new Bundle();
|
||||
if (!mPost.isArchived() && !mPost.isLocked() && comment.getAuthor().equals(mAccountName)) {
|
||||
if (!mPost.isArchived() && !mPost.isLocked() && comment.getAuthorQualifiedName().equals(mAccountQualifiedName)) {
|
||||
bundle.putBoolean(CommentMoreBottomSheetFragment.EXTRA_EDIT_AND_DELETE_AVAILABLE, true);
|
||||
}
|
||||
bundle.putString(CommentMoreBottomSheetFragment.EXTRA_ACCESS_TOKEN, mAccessToken);
|
||||
|
@ -621,7 +621,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
|
||||
mExoCreator, post -> EventBus.getDefault().post(new PostUpdateEventToPostList(mPost, postListPosition)));
|
||||
mCommentsAdapter = new CommentsRecyclerViewAdapter(activity,
|
||||
this, mCustomThemeWrapper, mExecutor, mRetrofit.getRetrofit(),
|
||||
mAccessToken, mAccountName, mPost, mLocale, mSingleCommentId
|
||||
mAccessToken, mAccountQualifiedName, mPost, mLocale, mSingleCommentId
|
||||
, isSingleCommentThreadMode, mSharedPreferences, mCurrentAccountSharedPreferences,
|
||||
new CommentsRecyclerViewAdapter.CommentRecyclerViewAdapterCallback() {
|
||||
@Override
|
||||
@ -1351,7 +1351,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
|
||||
pages_loaded++;
|
||||
mCommentsAdapter = new CommentsRecyclerViewAdapter(activity,
|
||||
ViewPostDetailFragment.this, mCustomThemeWrapper, mExecutor,
|
||||
mRetrofit.getRetrofit(), mAccessToken, mAccountName, mPost, mLocale,
|
||||
mRetrofit.getRetrofit(), mAccessToken, mAccountQualifiedName, mPost, mLocale,
|
||||
mSingleCommentId, isSingleCommentThreadMode, mSharedPreferences, mCurrentAccountSharedPreferences,
|
||||
new CommentsRecyclerViewAdapter.CommentRecyclerViewAdapterCallback() {
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user