Update Profile Image Timestamp on Startup so Images get Reshared #102

Merged
dan merged 1 commits from image-fix into trunk 2022-12-04 18:01:03 +00:00
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)
}