From 425286482ff111c0c4e5e438bb2ee29168d85b21 Mon Sep 17 00:00:00 2001 From: Ross Scroggs Date: Wed, 13 May 2026 09:55:50 -0700 Subject: [PATCH] Added new matchfield option for events --- src/GamCommands.txt | 1 + src/GamUpdate.txt | 6 ++++++ src/gam/__init__.py | 18 ++++++++++++++++-- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/GamCommands.txt b/src/GamCommands.txt index 19cea414..89487da6 100644 --- a/src/GamCommands.txt +++ b/src/GamCommands.txt @@ -1720,6 +1720,7 @@ gam calendar printacl [todrive *] ::= (matchfield attendees )| + (matchfield attendeesorganizer )| (matchfield attendeesonlydomainlist )| (matchfield attendeesdomainlist )| (matchfield attendeesnotdomainlist )| diff --git a/src/GamUpdate.txt b/src/GamUpdate.txt index e07dfc2b..537d7b53 100644 --- a/src/GamUpdate.txt +++ b/src/GamUpdate.txt @@ -1,3 +1,9 @@ +7.43.05 + +Added option `matchfield attendeesorganizer ` to `` +that is used in commands that process events. The match is true if all of the addresses in `` +are present as attendees in the event and are an organizer or not based on ``. + 7.43.04 Added option `include_suspended_zeros []` to `gam print vaultcounts` that causes diff --git a/src/gam/__init__.py b/src/gam/__init__.py index 569638ae..ce31604c 100755 --- a/src/gam/__init__.py +++ b/src/gam/__init__.py @@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki """ __author__ = 'GAM Team ' -__version__ = '7.43.04' +__version__ = '7.43.05' __license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)' # pylint: disable=wrong-import-position @@ -41121,6 +41121,8 @@ LIST_EVENTS_SELECT_PROPERTIES = { LIST_EVENTS_MATCH_FIELDS = { 'attendees': ['attendees', 'email'], + 'attendeesorganizer': ['attendees', 'organizer'], + 'attendeesorganiser': ['attendees', 'organizer'], 'attendeesonlydomainlist': ['attendees', 'onlydomainlist'], 'attendeesdomainlist': ['attendees', 'domainlist'], 'attendeesnotdomainlist': ['attendees', 'notdomainlist'], @@ -41200,6 +41202,8 @@ def getCalendarEventEntity(): calendarEventEntity['matches'].append((matchField, set(getString(Cmd.OB_DOMAIN_NAME_LIST).replace(',', ' ').split()))) elif matchField[1] == 'email': calendarEventEntity['matches'].append((matchField, getNormalizedEmailAddressEntity())) + elif matchField[1] == 'organizer': + calendarEventEntity['matches'].append((matchField, getBoolean(defaultValue=None), getNormalizedEmailAddressEntity())) else: #status calendarEventEntity['matches'].append((matchField, getChoice(CALENDAR_ATTENDEE_OPTIONAL_CHOICE_MAP, defaultChoice=False, mapChoice=True), @@ -41531,7 +41535,17 @@ def _eventMatches(event, match): if domain not in match[1]: return True return False - # status + if match[0][1] == 'organizer': + for matchEmail in match[2]: + for attendee in event['attendees']: + if 'email' in attendee and matchEmail == attendee['email']: + if attendee.get('organizer', False) != match[1]: + return False + break + else: + return False + return True + # if match[0][1] == 'status': for matchEmail in match[3]: for attendee in event['attendees']: if 'email' in attendee and matchEmail == attendee['email']: