Update Profile Image Timestamp on Startup so Images get Reshared
continuous-integration/drone/pr Build is pending Details
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Sarah Jamie Lewis 2022-12-04 09:02:10 -08:00
parent d28d0db77c
commit 92ec4c6667
1 changed files with 3 additions and 0 deletions

View File

@ -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)