mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-03 12:21:35 +00:00
use patch for event dates if possible
This commit is contained in:
12
src/gam.py
12
src/gam.py
@@ -3641,16 +3641,22 @@ def doCalendarAddOrUpdateEvent(action):
|
|||||||
# only way for non-Google calendars to get updates is via email
|
# only way for non-Google calendars to get updates is via email
|
||||||
timeZone = None
|
timeZone = None
|
||||||
kwargs = {}
|
kwargs = {}
|
||||||
|
body = {}
|
||||||
if action == 'add':
|
if action == 'add':
|
||||||
i = 4
|
i = 4
|
||||||
body = {}
|
|
||||||
func = 'insert'
|
func = 'insert'
|
||||||
else:
|
else:
|
||||||
eventId = sys.argv[4]
|
eventId = sys.argv[4]
|
||||||
kwargs = {'eventId': eventId}
|
kwargs = {'eventId': eventId}
|
||||||
i = 5
|
i = 5
|
||||||
func = 'update'
|
func = 'patch'
|
||||||
body = gapi.call(cal.events(), 'get', calendarId=calendarId, eventId=eventId)
|
requires_full_update = ['attendee', 'optionalattendee', 'removeattendee',
|
||||||
|
'replacedescription']
|
||||||
|
for arg in sys.argv[i:]:
|
||||||
|
if arg.replace('_', '').lower() in requires_full_update:
|
||||||
|
func = 'update'
|
||||||
|
body = gapi.call(cal.events(), 'get', calendarId=calendarId, eventId=eventId)
|
||||||
|
break
|
||||||
sendUpdates, body = getCalendarEventAttributes(i, cal, body, action)
|
sendUpdates, body = getCalendarEventAttributes(i, cal, body, action)
|
||||||
result = gapi.call(cal.events(), func, conferenceDataVersion=1,
|
result = gapi.call(cal.events(), func, conferenceDataVersion=1,
|
||||||
supportsAttachments=True, calendarId=calendarId,
|
supportsAttachments=True, calendarId=calendarId,
|
||||||
|
|||||||
Reference in New Issue
Block a user