Fixes direct messages falsely being shown as able to be boosted.

This commit is contained in:
Vavassor 2017-03-31 20:53:05 -04:00
parent d8a5ec3132
commit 88df8216a6
2 changed files with 11 additions and 1 deletions

View File

@ -382,7 +382,7 @@ class StatusViewHolder extends RecyclerView.ViewHolder {
hideSensitiveMediaWarning(); hideSensitiveMediaWarning();
} }
setupButtons(listener, realStatus.account.id); setupButtons(listener, realStatus.account.id);
setRebloggingEnabled(realStatus.visibility != Status.Visibility.PRIVATE); setRebloggingEnabled(status.rebloggingAllowed());
if (realStatus.spoilerText.isEmpty()) { if (realStatus.spoilerText.isEmpty()) {
hideSpoilerText(); hideSpoilerText();
} else { } else {

View File

@ -47,12 +47,15 @@ public class Status {
} }
public enum Visibility { public enum Visibility {
UNKNOWN,
@SerializedName("public") @SerializedName("public")
PUBLIC, PUBLIC,
@SerializedName("unlisted") @SerializedName("unlisted")
UNLISTED, UNLISTED,
@SerializedName("private") @SerializedName("private")
PRIVATE, PRIVATE,
@SerializedName("direct")
DIRECT,
} }
public String id; public String id;
@ -81,6 +84,13 @@ public class Status {
return visibility == null ? Visibility.UNLISTED : visibility; return visibility == null ? Visibility.UNLISTED : visibility;
} }
public boolean rebloggingAllowed() {
return visibility != null
&& visibility != Visibility.PRIVATE
&& visibility != Visibility.DIRECT
&& visibility != Visibility.UNKNOWN;
}
@SerializedName("media_attachments") @SerializedName("media_attachments")
public MediaAttachment[] attachments; public MediaAttachment[] attachments;