reply bug fix

Signed-off-by: nuclearfog <hatespirit666@gmail.com>
This commit is contained in:
nuclearfog 2021-10-08 10:56:26 +02:00
parent 2b15f4a722
commit dd10eb0c7a
No known key found for this signature in database
GPG Key ID: AA0271FBE406DB98
1 changed files with 12 additions and 5 deletions

View File

@ -401,17 +401,24 @@ public class Tweet implements Serializable {
if (start > 0 && end > start)
source = source.substring(start, end);
}
// add reply mention
StringBuilder userMentions = new StringBuilder();
if (user.getId() != twitterId) {
// prevent self mentioning
userMentions.append(user.getScreenname());
}
// add user mentions
UserMentionEntity[] mentionedUsers = status.getUserMentionEntities();
if (mentionedUsers != null && mentionedUsers.length > 0) {
StringBuilder userMentions = new StringBuilder(user.getScreenname());
for (UserMentionEntity mention : mentionedUsers) {
if (mention.getId() != twitterId) {
// filter out current user's screen name
userMentions.append(" @").append(mention.getScreenName());
}
this.userMentions = userMentions.toString();
} else {
this.userMentions = user.getScreenname();
}
}
this.userMentions = userMentions.toString();
}
/**
* add media information to the Tweet