Skip to content

feat: save avatars locally #599

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

LeonTheDev-io
Copy link
Contributor

Versioning information

  • This includes major changes (breaking changes)
  • This includes minor changes (minimal usage changes, minor new features)
  • This includes patches (bug fixes)
  • This does not change functionality at all (code refactoring, comments)

Is this related to an issue?

Mentioned in: #336

Changes made

  • Added users worker, for handling avatar downloads (src/lib/workers/users.js)
  • Added getAvatarData() method for returning the correct server/global avatar hash along with CDN-URL to src/lib/users.js
  • Modified src/lib/tickets/archiver.js to use save avatar and use new getAvatarData()

Confirmations

  • I have updated related documentation (if necessary)
  • My changes use consistent code style
  • My changes have been tested and confirmed to work

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't need to be a worker (in a separate thread), it can be a normal function.
Avatars are small enough that it doesn't really matter but it would be more efficient to pipe res.body to a writable stream from fs.createWritableStream()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants