From 92ec4c6667c4251bd1cfd3a1348a88306ea14fbb Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Sun, 4 Dec 2022 09:02:10 -0800 Subject: [PATCH] Update Profile Image Timestamp on Startup so Images get Reshared --- utils/eventHandler.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils/eventHandler.go b/utils/eventHandler.go index 68fbb1a..b2269f9 100644 --- a/utils/eventHandler.go +++ b/utils/eventHandler.go @@ -174,6 +174,9 @@ func (eh *EventHandler) handleAppBusEvent(e *event.Event) string { } else { e.Data[constants2.Picture], _ = profile.GetScopedZonedAttribute(attr.LocalScope, attr.FilesharingZone, fmt.Sprintf("%s.path", key)) serializedManifest, _ := profile.GetScopedZonedAttribute(attr.ConversationScope, attr.FilesharingZone, fmt.Sprintf("%s.manifest", key)) + // reset the share timestamp, currently file shares are hardcoded to expire after 30 days... + // we reset the profile image here so that it is always available. + profile.SetScopedZonedAttribute(attr.LocalScope, attr.FilesharingZone, fmt.Sprintf("%s.ts", key), strconv.FormatInt(time.Now().Unix(), 10)) profile.ShareFile(key, serializedManifest) log.Debugf("Custom Profile Image: %v %s", e.Data[constants2.Picture], serializedManifest) }