Skip to content

Commit

Permalink
Poster's last comment topic stops being sticky after 14 days
Browse files Browse the repository at this point in the history
  • Loading branch information
kohler committed Nov 26, 2024
1 parent c661ddc commit 3923a93
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
9 changes: 6 additions & 3 deletions scripts/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -6837,7 +6837,7 @@ const vismap = {
cmts = {}, resp_rounds = {},
twiddle_start = siteinfo.user && siteinfo.user.uid ? siteinfo.user.uid + "~" : "###";
let has_unload = false, last_visibility = null,
last_topic = null, my_last_topic = false,
last_topic = null, last_topic_viewer = false, last_topic_viewer_time = now_sec() - 14 * 86400,
editor_observer, editing_list;

function unparse_tag(tag, strip_value) {
Expand Down Expand Up @@ -7791,9 +7791,12 @@ function add_new_comment(cj, cid) {
id: cid, class: "pcard cmtcard cmtid comment view need-anchor-unfold has-fold ".concat(cj.collapsed ? "fold20c" : "fold20o", cj.editable ? " editable" : "")
}), $$("k-comment-actions"));
if (!cj.is_new && !cj.response) {
if (!my_last_topic || cj.viewer_owned) {
if (cj.viewer_owned && cj.modified_at > last_topic_viewer_time) {
last_topic = cj.topic || "rev";
last_topic_viewer = true;
last_topic_viewer_time = cj.modified_at;
} else if (!last_topic_viewer) {
last_topic = cj.topic || "rev";
my_last_topic = cj.viewer_owned;
}
if (cj.viewer_owned) {
last_visibility = cj.visibility;
Expand Down
3 changes: 0 additions & 3 deletions src/commentinfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,6 @@ static function script($prow) {
$t[] = "hotcrp.set_response_round(" . json_encode_browser($rrd->name) . "," . json_encode_browser($j) . ")";
}
Icons::stash_defs("tag", "attachment", "trash", "thread");
Icons::stash_licon("ui_tag"); // XXX backward compat
Icons::stash_licon("ui_attachment"); // XXX backward compat
Icons::stash_licon("ui_trash"); // XXX backward compat
return Ht::unstash_script(join(";", $t));
}

Expand Down

0 comments on commit 3923a93

Please sign in to comment.