Skip to content

Commit ab4e201

Browse files
committed
Fixes
1 parent e527073 commit ab4e201

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/main/java/smithereen/controllers/NotificationsController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ yield switch(comment.parentObjectID.type()){
425425
if(StringUtils.isNotEmpty(preview))
426426
yield makeActorLink(actor)+" "+preview;
427427
User u=(User)actor;
428-
String text=l.get("notification_content_comment_post", Map.of("name", u.getFirstLastAndGender(), "gender", u.gender));
428+
String text=l.get("notification_content_wall_post", Map.of("name", u.getFirstLastAndGender(), "gender", u.gender));
429429
yield TextProcessor.substituteLinks(text, Map.of("actor", Map.of("href", actor.getProfileURL())));
430430
}
431431
case INVITE_SIGNUP -> makeActorLink(actor)+" "+l.get("notification_invite_signup", Map.of("gender", ((User)actor).gender));

src/main/java/smithereen/routes/PostRoutes.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ public static Object ajaxCommentPreview(Request req, Response resp){
884884
Map<Integer, UserInteractions> interactions=ctx.getWallController().getUserInteractions(Stream.of(List.of(topLevel), comments.list).flatMap(List::stream).toList(), self!=null ? self.user : null);
885885
model.with("postInteractions", interactions)
886886
.with("preview", true)
887-
.with("replyFormID", (viewType==CommentViewType.FLAT ? "wallPostForm_commentPost" : "wallPostForm_commentReplyPost")+postID+ridSuffix)
887+
.with("replyFormID", (viewType==CommentViewType.FLAT || isMobile(req) ? "wallPostForm_commentPost" : "wallPostForm_commentReplyPost")+postID+ridSuffix)
888888
.with("commentViewType", viewType);
889889
model.with("topLevel", topLevel);
890890
WebDeltaResponse rb=new WebDeltaResponse(resp)
@@ -940,7 +940,7 @@ public static Object ajaxCommentBranch(Request req, Response resp){
940940
}
941941
Map<Integer, UserInteractions> interactions=ctx.getWallController().getUserInteractions(Stream.of(List.of(topLevel), allReplies).flatMap(List::stream).toList(), self!=null ? self.user : null);
942942
preparePostList(ctx, comments.list, model, self);
943-
model.with("postInteractions", interactions).with("replyFormID", "wallPostForm_commentReplyPost"+topLevel.post.id+ridSuffix);
943+
model.with("postInteractions", interactions).with("replyFormID", (isMobile(req) ? "wallPostForm_commentPost" : "wallPostForm_commentReplyPost")+topLevel.post.id+ridSuffix);
944944
model.with("topLevel", topLevel);
945945
model.with("commentViewType", viewType);
946946
if(StringUtils.isNotEmpty(rid))
@@ -1253,11 +1253,11 @@ public static Object ajaxLayerPrevComments(Request req, Response resp){
12531253
model.with("randomID", rid);
12541254
preparePostList(ctx, comments.list, model, self);
12551255
Map<Integer, UserInteractions> interactions=ctx.getWallController().getUserInteractions(Stream.of(List.of(post), comments.list).flatMap(List::stream).toList(), self!=null ? self.user : null);
1256+
boolean mobile=isMobile(req);
12561257
model.with("postInteractions", interactions)
1257-
.with("replyFormID", "wallPostForm_commentReplyPost"+postID+ridSuffix)
1258+
.with("replyFormID", (mobile ? "wallPostForm_commentPost" : "wallPostForm_commentReplyPost")+postID+ridSuffix)
12581259
.with("commentViewType", viewType);
12591260
model.with("topLevel", post);
1260-
boolean mobile=isMobile(req);
12611261
WebDeltaResponse rb=new WebDeltaResponse(resp)
12621262
.runScript(mobile ? "window._layerScrollHeight=document.scrollingElement.scrollHeight;" : "window._layerScrollHeight=ge(\"postReplies"+postID+ridSuffix+"\").closest(\".layerContent\").scrollHeight;")
12631263
.insertHTML(WebDeltaResponse.ElementInsertionMode.AFTER_BEGIN, "postReplies"+postID+ridSuffix, model.renderToString())

0 commit comments

Comments
 (0)