mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-12-24 14:07:03 +01:00
Time aware message collapsing
So messages across time dont get clumped together as one
This commit is contained in:
parent
0235197514
commit
1d2a94ce1a
@ -1098,6 +1098,7 @@
|
||||
if (replace == null) {
|
||||
$("#chatcontent").append(rendered);
|
||||
handle_last_message_mention();
|
||||
$("#chatcontent p:last-child").attr("timestamp", message.timestamp);
|
||||
$("#chatcontent p:last-child").find(".blockcode").find("br").remove(); // Remove excessive breaks in codeblocks
|
||||
render_code_highlighting($("#chatcontent p:last-child").find(".blockcode"));
|
||||
$("#chatcontent .chatusername").last().click(function () {
|
||||
@ -1258,7 +1259,7 @@
|
||||
for (var i = 1; i < allMessages.length; i++) {
|
||||
var last = $(allMessages[i - 1]);
|
||||
var current = $(allMessages[i]);
|
||||
if (last.attr("discord_userid") == current.attr("discord_userid") && current.attr("discord_userid")) {
|
||||
if (last.attr("discord_userid") == current.attr("discord_userid") && current.attr("discord_userid") && moment(current.attr("timestamp")).isSame(moment(last.attr("timestamp")), "hour")) {
|
||||
current.addClass("collapsed");
|
||||
} else {
|
||||
current.removeClass("collapsed");
|
||||
|
Loading…
Reference in New Issue
Block a user