Added the following options to <EventMatchProperty>

```
matchfield attendeesdomainlist <DomainNameList>
matchfield attendeesnotdomainlist <DomainNameList>
```
This commit is contained in:
Ross Scroggs
2024-04-16 15:32:25 -07:00
parent bad4866bf7
commit 842e46d060
8 changed files with 65 additions and 5 deletions

View File

@@ -36164,6 +36164,8 @@ LIST_EVENTS_SELECT_PROPERTIES = {
LIST_EVENTS_MATCH_FIELDS = {
'attendees': ['attendees', 'email'],
'attendeesdomainlist': ['attendees', 'domainlist'],
'attendeesnotdomainlist': ['attendees', 'notdomainlist'],
'attendeespattern': ['attendees', 'match'],
'attendeesstatus': ['attendees', 'status'],
'description': ['description'],
@@ -36235,6 +36237,8 @@ def getCalendarEventEntity():
calendarEventEntity['matches'].append((matchField, getBoolean()))
elif matchField[0] != 'attendees' or matchField[1] == 'match':
calendarEventEntity['matches'].append((matchField, getREPattern(re.IGNORECASE)))
elif matchField[0] == 'attendees' and matchField[1] in {'domainlist', 'notdomainlist'}:
calendarEventEntity['matches'].append((matchField, set(getString(Cmd.OB_DOMAIN_NAME_LIST).replace(',', ' ').split())))
elif matchField[1] == 'email':
calendarEventEntity['matches'].append((matchField, getNormalizedEmailAddressEntity()))
else: #status
@@ -36509,6 +36513,18 @@ def _eventMatches(event, match):
if match[1].search(attendee) is not None:
return True
return False
if match[0][1] == 'domainlist':
for attendee in attendees:
_, domain = attendee.lower().split('@', 1)
if domain in match[1]:
return True
return False
if match[0][1] == 'notdomainlist':
for attendee in attendees:
_, domain = attendee.lower().split('@', 1)
if domain not in match[1]:
return True
return False
# status
for matchEmail in match[3]:
for attendee in event['attendees']: