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();
}
setupButtons(listener, realStatus.account.id);
setRebloggingEnabled(realStatus.visibility != Status.Visibility.PRIVATE);
setRebloggingEnabled(status.rebloggingAllowed());
if (realStatus.spoilerText.isEmpty()) {
hideSpoilerText();
} else {

View File

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