mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-05 18:25:57 +00:00
Dont group messages after certain period of time
This commit is contained in:
parent
06a325dafd
commit
24f6c434cf
1 changed files with 6 additions and 3 deletions
|
@ -18,7 +18,7 @@ use project::Fs;
|
|||
use rich_text::RichText;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use settings::Settings;
|
||||
use std::sync::Arc;
|
||||
use std::{sync::Arc, time::Duration};
|
||||
use time::{OffsetDateTime, UtcOffset};
|
||||
use ui::{
|
||||
popover_menu, prelude::*, Avatar, Button, ContextMenu, IconButton, IconName, KeyBinding, Label,
|
||||
|
@ -304,8 +304,11 @@ impl ChatPanel {
|
|||
let last_message = active_chat.message(ix.saturating_sub(1));
|
||||
let this_message = active_chat.message(ix).clone();
|
||||
|
||||
let is_continuation_from_previous = last_message.id != this_message.id
|
||||
&& last_message.sender.id == this_message.sender.id;
|
||||
let duration_since_last_message = this_message.timestamp - last_message.timestamp;
|
||||
let is_continuation_from_previous = last_message.sender.id
|
||||
== this_message.sender.id
|
||||
&& last_message.id != this_message.id
|
||||
&& duration_since_last_message < Duration::from_secs(5 * 60);
|
||||
|
||||
if let ChannelMessageId::Saved(id) = this_message.id {
|
||||
if this_message
|
||||
|
|
Loading…
Reference in a new issue