diff options
Diffstat (limited to 'app/src/main/java/net/lacolaco/smileessence/command/status')
3 files changed, 9 insertions, 5 deletions
diff --git a/app/src/main/java/net/lacolaco/smileessence/command/status/StatusCommandFavAndRT.java b/app/src/main/java/net/lacolaco/smileessence/command/status/StatusCommandFavAndRT.java index fe1a100f..9d5f5471 100644 --- a/app/src/main/java/net/lacolaco/smileessence/command/status/StatusCommandFavAndRT.java +++ b/app/src/main/java/net/lacolaco/smileessence/command/status/StatusCommandFavAndRT.java @@ -59,7 +59,7 @@ public class StatusCommandFavAndRT extends StatusCommand implements IConfirmable @Override public boolean isEnabled() { User user = getOriginalStatus().getUser(); - return !user.isProtected() && user.getId() != account.userID; + return !user.isProtected() && user.getId() != account.getUserId(); } // -------------------------- OTHER METHODS -------------------------- diff --git a/app/src/main/java/net/lacolaco/smileessence/command/status/StatusCommandMakeAnonymous.java b/app/src/main/java/net/lacolaco/smileessence/command/status/StatusCommandMakeAnonymous.java index 8f485b93..fa8cc5e0 100644 --- a/app/src/main/java/net/lacolaco/smileessence/command/status/StatusCommandMakeAnonymous.java +++ b/app/src/main/java/net/lacolaco/smileessence/command/status/StatusCommandMakeAnonymous.java @@ -29,6 +29,7 @@ import net.lacolaco.smileessence.R; import net.lacolaco.smileessence.command.IConfirmable; import net.lacolaco.smileessence.entity.Account; import net.lacolaco.smileessence.entity.Tweet; +import net.lacolaco.smileessence.entity.User; import net.lacolaco.smileessence.notification.NotificationType; import net.lacolaco.smileessence.notification.Notificator; import net.lacolaco.smileessence.twitter.TweetBuilder; @@ -52,13 +53,14 @@ public class StatusCommandMakeAnonymous extends StatusCommand implements IConfir // --------------------------- CONSTRUCTORS --------------------------- public static String build(Activity activity, Tweet tweet, Account account) { + User user = account.getUser(); String str = tweet.getText(); String header = ""; if (str.startsWith(".")) { str = str.replaceFirst(".", ""); } - if (str.startsWith(String.format("@%s", account.screenName))) { - str = str.replaceFirst(String.format("@%s", account.screenName), "").trim(); + if (str.startsWith(String.format("@%s", user.getScreenName()))) { + str = str.replaceFirst(String.format("@%s", user.getScreenName()), "").trim(); } str = activity.getString(R.string.format_status_command_make_anonymous, str).trim(); return str; diff --git a/app/src/main/java/net/lacolaco/smileessence/command/status/StatusCommandNanigaja.java b/app/src/main/java/net/lacolaco/smileessence/command/status/StatusCommandNanigaja.java index 5562c2b4..f132db1e 100644 --- a/app/src/main/java/net/lacolaco/smileessence/command/status/StatusCommandNanigaja.java +++ b/app/src/main/java/net/lacolaco/smileessence/command/status/StatusCommandNanigaja.java @@ -29,6 +29,7 @@ import net.lacolaco.smileessence.R; import net.lacolaco.smileessence.command.IConfirmable; import net.lacolaco.smileessence.entity.Account; import net.lacolaco.smileessence.entity.Tweet; +import net.lacolaco.smileessence.entity.User; import net.lacolaco.smileessence.notification.NotificationType; import net.lacolaco.smileessence.notification.Notificator; import net.lacolaco.smileessence.twitter.TweetBuilder; @@ -64,13 +65,14 @@ public class StatusCommandNanigaja extends StatusCommand implements IConfirmable // -------------------------- OTHER METHODS -------------------------- public String build() { + User user = account.getUser(); String str = getOriginalStatus().getText(); String header = ""; if (str.startsWith(".")) { str = str.replaceFirst(".", ""); } - if (str.startsWith(String.format("@%s", account.screenName))) { - str = str.replaceFirst(String.format("@%s", account.screenName), "").trim(); + if (str.startsWith(String.format("@%s", user.getScreenName()))) { + str = str.replaceFirst(String.format("@%s", user.getScreenName()), "").trim(); header = "@" + getOriginalStatus().getUser().getScreenName(); } str = String.format("%s %s", header, String.format(getFormatString(getActivity()), str)).trim(); |