Skip to content

Commit

Permalink
Limit message groupping to 30 sec
Browse files Browse the repository at this point in the history
  • Loading branch information
Ri0n committed Oct 11, 2024
1 parent 9f94e0b commit 39d4a39
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion themes/chatview/adium/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,8 @@ chat.util.updateObject(adapter, function(chat){
(prevGrouppingData.mtype == cdata.mtype) &&
(prevGrouppingData.userid == cdata.userid) &&
(prevGrouppingData.emote == cdata.emote) &&
(prevGrouppingData.local == cdata.local));
(prevGrouppingData.local == cdata.local) &&
(cdata.time - prevGrouppingData.time) < 30000);
data.messageClasses += data.nextOfGroup? " consecutive" : "";

if (data.nextOfGroup) {
Expand Down
3 changes: 2 additions & 1 deletion themes/chatview/psi/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ function psiThemeAdapter(chat) {
(shared.prevGrouppingData.mtype == shared.cdata.mtype) &&
(shared.prevGrouppingData.userid == shared.cdata.userid) &&
(shared.prevGrouppingData.emote == shared.cdata.emote) &&
(shared.prevGrouppingData.local == shared.cdata.local));
(shared.prevGrouppingData.local == shared.cdata.local) &&
(shared.cdata.time - shared.prevGrouppingData.time) < 30000);
return shared.cdata.nextOfGroup;
},

Expand Down
4 changes: 4 additions & 0 deletions themes/chatview/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,10 @@ ${info}
}
}

if (data.time) {
data.time = new Date(data.time);
}

if (data.type == "message") {
if (data.mtype == "join") {
usersMap[data.sender] = {avatar:data.avatar, nickcolor:data.nickcolor, msgs:{}};
Expand Down

0 comments on commit 39d4a39

Please sign in to comment.