fix:#16 added userAgent and fixed logging for room ical

This commit is contained in:
Elmar Kresse
2024-11-18 21:20:45 +01:00
parent 86a6820038
commit 4809192570
3 changed files with 6 additions and 7 deletions

View File

@@ -107,7 +107,7 @@ func CreateFeed(app model.AppType, modules []model.FeedCollection) (string, erro
return token, nil
}
func FeedRoom(app model.AppType, room string) (string, string, error) {
func FeedRoom(app model.AppType, room string, userAgent string) (string, string, error) {
// Get all events for room
events, err := htwkalenderGrpc.GetEventsByRoom(room, app.GrpcClient)
@@ -121,7 +121,7 @@ func FeedRoom(app model.AppType, room string) (string, string, error) {
// Generate one Hash for E-TAG from all events
etag := functions.HashString(events.String())
cal := GenerateIcalFeed(events, map[string]model.FeedCollection{}, "")
cal := GenerateIcalFeed(events, map[string]model.FeedCollection{}, userAgent)
icalFeed := &model.FeedModel{Content: cal.Serialize(), ExpiresAt: model.JSONTime(time.Now().Add(expirationTime))}
return icalFeed.Content, etag, nil