Probably fix #703
This commit is contained in:
@@ -30,4 +30,19 @@ public class Hashtag extends BaseModel implements DisplayItemsParent{
|
|||||||
public String getID(){
|
public String getID(){
|
||||||
return name;
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,4 +20,22 @@ public class Mention extends BaseModel{
|
|||||||
", url='"+url+'\''+
|
", 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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,10 +81,10 @@ public class HtmlParser{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, String> idsByUrl=mentions.stream().collect(Collectors.toMap(m->m.url, m->m.id));
|
Map<String, String> idsByUrl=mentions.stream().distinct().collect(Collectors.toMap(m->m.url, m->m.id));
|
||||||
// Hashtags in remote posts have remote URLs, these have local URLs so they don't match.
|
// Hashtags in remote posts have remote URLs, these have local URLs so they don't match.
|
||||||
// Map<String, String> tagsByUrl=tags.stream().collect(Collectors.toMap(t->t.url, t->t.name));
|
// Map<String, String> tagsByUrl=tags.stream().collect(Collectors.toMap(t->t.url, t->t.name));
|
||||||
Map<String, Hashtag> tagsByTag=tags.stream().collect(Collectors.toMap(t->t.name.toLowerCase(), Function.identity()));
|
Map<String, Hashtag> tagsByTag=tags.stream().distinct().collect(Collectors.toMap(t->t.name.toLowerCase(), Function.identity()));
|
||||||
|
|
||||||
final SpannableStringBuilder ssb=new SpannableStringBuilder();
|
final SpannableStringBuilder ssb=new SpannableStringBuilder();
|
||||||
Jsoup.parseBodyFragment(source).body().traverse(new NodeVisitor(){
|
Jsoup.parseBodyFragment(source).body().traverse(new NodeVisitor(){
|
||||||
|
|||||||
Reference in New Issue
Block a user