From 435399dcf298e94bfbf2b2a6674c2ce1c67a4143 Mon Sep 17 00:00:00 2001 From: Toutsu Date: Thu, 7 May 2026 10:18:25 +0300 Subject: [PATCH] fix(#13): revert ExportCalendarHandler subscription logic (cross-project ref) --- .../ExportCalendar/ExportCalendarHandler.cs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/GmRelay.Bot/Features/Sessions/ExportCalendar/ExportCalendarHandler.cs b/src/GmRelay.Bot/Features/Sessions/ExportCalendar/ExportCalendarHandler.cs index 809ab9d..5744159 100644 --- a/src/GmRelay.Bot/Features/Sessions/ExportCalendar/ExportCalendarHandler.cs +++ b/src/GmRelay.Bot/Features/Sessions/ExportCalendar/ExportCalendarHandler.cs @@ -18,13 +18,13 @@ public sealed class ExportCalendarHandler( await using var connection = await dataSource.OpenConnectionAsync(cancellationToken); var sessions = await connection.QueryAsync( - @"SELECT s.id as Id, s.title as Title, s.scheduled_at as ScheduledAt - FROM sessions s - JOIN game_groups g ON s.group_id = g.id - WHERE g.telegram_chat_id = @ChatId - AND s.status = @Planned - AND s.scheduled_at > NOW() - ORDER BY s.scheduled_at ASC", + @"SELECT s.id as Id, s.title as Title, s.scheduled_at as ScheduledAt" + + " FROM sessions s" + + " JOIN game_groups g ON s.group_id = g.id" + + " WHERE g.telegram_chat_id = @ChatId" + + " AND s.status = @Planned" + + " AND s.scheduled_at > NOW()" + + " ORDER BY s.scheduled_at ASC", new { ChatId = message.Chat.Id, Planned = SessionStatus.Planned }); var sessionsList = sessions.ToList(); @@ -54,8 +54,6 @@ public sealed class ExportCalendarHandler( sb.AppendLine($"DTSTART:{dtStart}"); sb.AppendLine($"DTEND:{dtEnd}"); sb.AppendLine($"SUMMARY:{s.Title}"); - // Escape special chars according to iCal standards (RFC 5545) -- simple escaping for summary - // In a fuller implementation we'd escape \r\n, commas, etc. But titles are mostly plain text. sb.AppendLine("END:VEVENT"); }