Skip to content

Commit

Permalink
Probably fix sk22#703
Browse files Browse the repository at this point in the history
  • Loading branch information
grishka authored and LucasGGamerM committed Sep 28, 2023
1 parent d706768 commit d2de62e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
15 changes: 15 additions & 0 deletions mastodon/src/main/java/org/joinmastodon/android/model/Hashtag.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,19 @@ public String toString(){
public String getID(){
return name;
}

@Override
public boolean equals(Object o){
if(this==o) return true;
if(o==null || getClass()!=o.getClass()) return false;

Hashtag hashtag=(Hashtag) o;

return name.equals(hashtag.name);
}

@Override
public int hashCode(){
return name.hashCode();
}
}
18 changes: 18 additions & 0 deletions mastodon/src/main/java/org/joinmastodon/android/model/Mention.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,22 @@ public String toString(){
", url='"+url+'\''+
'}';
}

@Override
public boolean equals(Object o){
if(this==o) return true;
if(o==null || getClass()!=o.getClass()) return false;

Mention mention=(Mention) o;

if(!id.equals(mention.id)) return false;
return url.equals(mention.url);
}

@Override
public int hashCode(){
int result=id.hashCode();
result=31*result+url.hashCode();
return result;
}
}

0 comments on commit d2de62e

Please sign in to comment.