Skip to content

Commit

Permalink
новая логика lastmod в трекере
Browse files Browse the repository at this point in the history
  • Loading branch information
maxcom committed Nov 4, 2023
1 parent 8e7a8e9 commit 85c9e5b
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/main/java/ru/org/linux/group/TopicsListItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,23 +77,15 @@ public TopicsListItem(User author, int msgid, Timestamp lastmod,

public String getLastPageUrl() {
if (pages > 1) {
return getGroupUrl() + msgid + "/page" + (pages - 1) + "?lastmod=" + lastmod.getTime();
return getGroupUrl() + msgid + "/page" + (pages - 1) + "?lastmod=" + cid;
} else {
return getGroupUrl() + msgid + "?lastmod=" + lastmod.getTime();
}
}

public String getCommentUrl() {
if (cid!=0) {
return getGroupUrl() + msgid + "?cid=" + cid;
} else {
return getLastPageUrl();
return getGroupUrl() + msgid + "?lastmod=" + cid;
}
}

public String getFirstPageUrl() {
if (pages<=1) {
return getGroupUrl() + msgid + "?lastmod=" + lastmod.getTime();
return getGroupUrl() + msgid + "?lastmod=" + cid;
} else {
return getCanonicalUrl();
}
Expand Down

0 comments on commit 85c9e5b

Please sign in to comment.