You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't think that you can uniquely identify a comment with just its ID, but if you can get the post ID that they each replied to, then you could compare reply.id == child.id && reply.subreddit.id == child.subreddit.id && post_id == child.post_id (this already works for link posts with link_id but I'm not sure if an equivalent exists for self posts.
The text was updated successfully, but these errors were encountered:
avinashbot
changed the title
c1 == c2 on identical(?) comments returns false
Implement Equality (==) on Models
Apr 5, 2017
Actually, you can indeed just compare ids. Comments have unique ids, so as long as you're not comparing Submission IDs with Comment IDs, id should be fine. Leaving this one open as well, can't believe I haven't implemented this!
Last thing I'll bug you with for a while!
I have a comment
child
, and that comment is the only reply to another commentparent
.I don't think that you can uniquely identify a comment with just its ID, but if you can get the post ID that they each replied to, then you could compare
reply.id == child.id && reply.subreddit.id == child.subreddit.id && post_id == child.post_id
(this already works for link posts withlink_id
but I'm not sure if an equivalent exists for self posts.The text was updated successfully, but these errors were encountered: