mirror of
https://github.com/mgrove36/ical-filter-proxy.git
synced 2026-03-03 01:47:07 +00:00
Merge pull request #2 from mgrove36/add-location-transformations
Add location transformations & update comment
This commit is contained in:
@@ -151,7 +151,7 @@ func (filter Filter) matchesEvent(event ics.VEvent) bool {
|
||||
}
|
||||
}
|
||||
|
||||
// Check Description filters against VEvent
|
||||
// Check Location filters against VEvent
|
||||
if filter.Match.Location.hasConditions() {
|
||||
eventLocation := event.GetProperty(ics.ComponentPropertyLocation)
|
||||
if eventLocation == nil {
|
||||
@@ -186,6 +186,13 @@ func (filter Filter) transformEvent(event *ics.VEvent) {
|
||||
} else if filter.Transform.Description.Replace != "" {
|
||||
event.SetDescription(filter.Transform.Description.Replace)
|
||||
}
|
||||
|
||||
// Location transformations
|
||||
if filter.Transform.Location.Remove {
|
||||
event.SetLocation("")
|
||||
} else if filter.Transform.Location.Replace != "" {
|
||||
event.SetLocation(filter.Transform.Location.Replace)
|
||||
}
|
||||
}
|
||||
|
||||
// EventMatchRules contains VEvent properties that user can match against
|
||||
|
||||
Reference in New Issue
Block a user