Skip to content

Commit

Permalink
fix issue with profile chat meta loading
Browse files Browse the repository at this point in the history
  • Loading branch information
RaidMax committed Aug 29, 2023
1 parent a2e5e94 commit d9df5f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Plugins/Stats/Dtos/ChatSearchQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,19 @@ public class ChatSearchQuery : ClientPaginationRequest
/// <summary>
/// The time associated with SentAfter date
/// </summary>
public string SentAfterTime { get; set; } = "00:00";
public string SentAfterTime { get; set; }

public DateTime? SentAfterDateTime => SentAfter?.Add(TimeSpan.Parse(SentAfterTime));
public DateTime? SentAfterDateTime => SentAfter?.Add(string.IsNullOrEmpty(SentAfterTime) ? TimeSpan.Zero : TimeSpan.Parse(SentAfterTime));

/// <summary>
/// only look for messages sent before this date0
/// </summary>
public DateTime SentBefore { get; set; } = DateTime.UtcNow.Date;

public string SentBeforeTime { get; set; } = DateTime.UtcNow.ToString("HH:mm");
public string SentBeforeTime { get; set; }

public DateTime? SentBeforeDateTime => SentBefore.Add(TimeSpan.Parse(SentBeforeTime));
public DateTime? SentBeforeDateTime =>
SentBefore.Add(string.IsNullOrEmpty(SentBeforeTime) ? TimeSpan.Zero : TimeSpan.Parse(SentBeforeTime));

public bool IsExactMatch { get; set; }

Expand Down
2 changes: 2 additions & 0 deletions Plugins/Stats/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,8 @@ async Task<IEnumerable<MessageResponse>> GetMessages(ClientPaginationRequest req
ClientId = request.ClientId,
Before = request.Before,
SentBefore = request.Before ?? DateTime.UtcNow,
SentAfter = request.After,
After = request.After,
Count = request.Count,
IsProfileMeta = true
};
Expand Down

0 comments on commit d9df5f0

Please sign in to comment.