mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-04-08 22:50:10 +00:00
Remove message group limit setting
This commit is contained in:
@@ -18,14 +18,12 @@ namespace DiscordChatExporter.Core.Services
|
||||
private readonly ExportFormat _format;
|
||||
private readonly ChatLog _log;
|
||||
private readonly string _dateFormat;
|
||||
private readonly int _messageGroupLimit;
|
||||
|
||||
public TemplateModel(ExportFormat format, ChatLog log, string dateFormat, int messageGroupLimit)
|
||||
public TemplateModel(ExportFormat format, ChatLog log, string dateFormat)
|
||||
{
|
||||
_format = format;
|
||||
_log = log;
|
||||
_dateFormat = dateFormat;
|
||||
_messageGroupLimit = messageGroupLimit;
|
||||
}
|
||||
|
||||
private IEnumerable<MessageGroup> GroupMessages(IEnumerable<Message> messages)
|
||||
@@ -39,8 +37,7 @@ namespace DiscordChatExporter.Core.Services
|
||||
buffer.Any() &&
|
||||
(
|
||||
message.Author.Id != buffer.First().Author.Id || // when author changes
|
||||
(message.Timestamp - buffer.Last().Timestamp).TotalMinutes > 7 || // when more than 7 minutes passed since last message
|
||||
buffer.Count >= _messageGroupLimit // when group is full
|
||||
(message.Timestamp - buffer.Last().Timestamp).TotalMinutes > 7 // when more than 7 minutes passed since last message
|
||||
);
|
||||
|
||||
// If condition is true - flush buffer
|
||||
|
||||
@@ -36,8 +36,7 @@ namespace DiscordChatExporter.Core.Services
|
||||
};
|
||||
|
||||
// Create template model
|
||||
var templateModel = new TemplateModel(format, chatLog,
|
||||
_settingsService.DateFormat, _settingsService.MessageGroupLimit);
|
||||
var templateModel = new TemplateModel(format, chatLog, _settingsService.DateFormat);
|
||||
|
||||
context.PushGlobal(templateModel.GetScriptObject());
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ namespace DiscordChatExporter.Core.Services
|
||||
public bool IsAutoUpdateEnabled { get; set; } = true;
|
||||
|
||||
public string DateFormat { get; set; } = "dd-MMM-yy hh:mm tt";
|
||||
public int MessageGroupLimit { get; set; } = 20;
|
||||
|
||||
public AuthToken LastToken { get; set; }
|
||||
public ExportFormat LastExportFormat { get; set; } = ExportFormat.HtmlDark;
|
||||
|
||||
Reference in New Issue
Block a user