feat: comment reporting
This commit is contained in:
parent
a251dd4ffb
commit
55e156579b
6 changed files with 90 additions and 16 deletions
|
@ -17,7 +17,6 @@ import ani.dantotsu.settings.saving.PrefName
|
|||
import ani.dantotsu.snackString
|
||||
import com.xwray.groupie.GroupieAdapter
|
||||
import com.xwray.groupie.Section
|
||||
|
||||
import com.xwray.groupie.viewbinding.BindableItem
|
||||
import io.noties.markwon.Markwon
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
|
@ -127,6 +126,15 @@ class CommentItem(val comment: Comment,
|
|||
}
|
||||
}
|
||||
}
|
||||
viewBinding.commentReport.setOnClickListener {
|
||||
val scope = CoroutineScope(Dispatchers.Main + SupervisorJob())
|
||||
scope.launch {
|
||||
val success = CommentsAPI.reportComment(comment.commentId, comment.username, commentsActivity.mediaName)
|
||||
if (success) {
|
||||
snackString("Comment Reported")
|
||||
}
|
||||
}
|
||||
}
|
||||
//fill the icon if the user has liked the comment
|
||||
setVoteButtons(viewBinding)
|
||||
viewBinding.commentUpVote.setOnClickListener {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue