Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Awful.apk/src/main/assets/javascript/thread.js
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ function showPostMenu(postMenu) {
postMenu.getAttribute('userid'),
postMenu.getAttribute('lastreadurl'),
postMenu.hasAttribute('editable'),
postMenu.hasAttribute('has-role'),
postMenu.getAttribute('data-role') || '',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think they should be null like avatar below

postMenu.hasAttribute('isPlat'),
avatar ? avatar.getAttribute('src') : null
);
Expand Down
2 changes: 1 addition & 1 deletion Awful.apk/src/main/assets/mustache/post.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{{#avatarText}}<aside aria-hidden="true" class="postinfo-title">{{avatarText}}</aside>{{/avatarText}}
</section >
</div>
<nav aria-label="post menu" role="button" class="postmenu" username="{{username}}" userid="{{userID}}" lastreadurl="{{lastReadUrl}}" {{#editable}}editable{{/editable}} {{#role}}has-role {{role}}{{/role}} {{#plat}}isPlat{{/plat}} ></nav>
<nav aria-label="post menu" role="button" class="postmenu" username="{{username}}" userid="{{userID}}" lastreadurl="{{lastReadUrl}}" {{#editable}}editable{{/editable}} {{#role}}data-role="{{role}}"{{/role}} {{#plat}}isPlat{{/plat}} ></nav>
</header>
<div class="postseparator"></div>
<section class="postcontent">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,7 @@ public void onMoreClick(
final String aUserId,
final String lastReadUrl,
final boolean editable,
final boolean isAdminOrMod,
final String posterRole,
final boolean isPlat,
final String avatarUrl) {

Expand All @@ -1149,7 +1149,7 @@ public void onMoreClick(
editable, aUsername,
Integer.parseInt(aUserId),
isPlat,
isAdminOrMod,
posterRole,
postFilterUserId,
avatarUrl);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class PostContextMenu extends BasePopupMenu<PostContextMenu.PostMenuActio
private static final String ARG_POSTER_USER_ID = "posterUserId";
private static final String ARG_EDITABLE = "editable";
private static final String ARG_POSTER_HAS_PLAT = "posterHasPlat";
private static final String ARG_POSTER_IS_ADMIN_OR_MOD = "posterIsAdminOrMod";
private static final String ARG_POSTER_ROLE = "posterRole";
private static final String ARG_THREAD_ID = "threadId";
private static final String ARG_POST_ID = "postId";
private static final String ARG_LAST_READ_CODE = "lastReadCode";
Expand All @@ -54,7 +54,8 @@ public class PostContextMenu extends BasePopupMenu<PostContextMenu.PostMenuActio
private int posterUserId;
private boolean editable;
private boolean posterHasPlat;
private boolean posterIsAdminOrMod;
private boolean posterHasRole;
private boolean posterIsAdmin;
private int threadId;
private int postId;
private int lastReadCode;
Expand All @@ -73,7 +74,7 @@ public class PostContextMenu extends BasePopupMenu<PostContextMenu.PostMenuActio
* @param posterUsername the username of the post creator
* @param posterUserId the user ID of the post creator
* @param posterHasPlat true if the post creator has a platinum account
* @param posterIsAdminOrMod true if the post creator has mod/admin status
* @param posterRole the role of the post creator (e.g. "admin", "mod"), or empty string if none
* @param posterAvatarUrl the URL of the post creator's avatar
* @return the configured menu, ready to show
*/
Expand All @@ -84,7 +85,7 @@ public static PostContextMenu newInstance(int threadId,
@NonNull String posterUsername,
int posterUserId,
boolean posterHasPlat,
boolean posterIsAdminOrMod,
@NonNull String posterRole,
Integer postFilterUserId,
String posterAvatarUrl) {
Bundle args = new Bundle();
Expand All @@ -93,7 +94,7 @@ public static PostContextMenu newInstance(int threadId,
args.putInt(ARG_POSTER_USER_ID, posterUserId);
args.putBoolean(ARG_EDITABLE, editable);
args.putBoolean(ARG_POSTER_HAS_PLAT, posterHasPlat);
args.putBoolean(ARG_POSTER_IS_ADMIN_OR_MOD, posterIsAdminOrMod);
args.putString(ARG_POSTER_ROLE, posterRole);
args.putInt(ARG_THREAD_ID, threadId);
args.putInt(ARG_POST_ID, postId);
args.putInt(ARG_LAST_READ_CODE, lastReadCode);
Expand All @@ -112,7 +113,9 @@ void init(@NonNull Bundle args) {
posterUserId = args.getInt(ARG_POSTER_USER_ID);
editable = args.getBoolean(ARG_EDITABLE);
posterHasPlat = args.getBoolean(ARG_POSTER_HAS_PLAT);
posterIsAdminOrMod = args.getBoolean(ARG_POSTER_IS_ADMIN_OR_MOD);
String posterRole = args.getString(ARG_POSTER_ROLE, "");
posterHasRole = !posterRole.isEmpty();
posterIsAdmin = "admin".equals(posterRole);
threadId = args.getInt(ARG_THREAD_ID);
postId = args.getInt(ARG_POST_ID);
lastReadCode = args.getInt(ARG_LAST_READ_CODE);
Expand All @@ -136,19 +139,19 @@ List<PostMenuAction> generateMenuItems() {
awfulActions.add(EDIT);
}
awfulActions.add(MARK_LAST_SEEN);
if (!ownPost && youHavePlat && (posterHasPlat || posterIsAdminOrMod)) {
if (!ownPost && youHavePlat && (posterHasPlat || posterHasRole)) {
awfulActions.add(SEND_PM);
}
awfulActions.add(ownPost ? YOUR_POSTS : USER_POSTS);
if (!ownPost) {
awfulActions.add(prefs.markedUsers.contains(posterUsername) ? UNMARK_USER : MARK_USER);
}
if (!ownPost && !posterIsAdminOrMod) {
if (!ownPost && !posterIsAdmin) {
awfulActions.add(REPORT_POST);
}
awfulActions.add(COPY_URL);
awfulActions.add(RAP_SHEET);
if (!ownPost && !posterIsAdminOrMod) {
if (!ownPost && !posterHasRole) {
awfulActions.add(IGNORE_USER);
}
if (prefs.avatarsEnabled && posterAvatarUrl != null) {
Expand Down