Skip to content
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

feat: support sha256 avatar hash #706

Merged
merged 4 commits into from
May 28, 2024
Merged

feat: support sha256 avatar hash #706

merged 4 commits into from
May 28, 2024

Conversation

devhaozi
Copy link
Contributor

@devhaozi devhaozi commented May 24, 2024

Closes #701

  1. 头像采用 sha256 进行邮箱哈希,同时也兼容不支持 sha256 的 Cravatar
  2. 默认使用 WeAvatar 作为头像源(WeAvatar 支持 Cravatar 的所有功能)
  3. 默认头像采用首字母(由 WeAvatar 提供)
  4. 优化了头像相关函数的 if 结构

最终效果如图:

image

@imaegoo
Copy link
Member

imaegoo commented May 25, 2024

看起来只改了预览时的头像加载逻辑,没改发送以后的头像加载逻辑,发送以后的头像mail字段是undefined,头像会显示不出来的。

twikoo的评论数据结构有mail和mailMd5两个字段用于存储加密前的邮箱和加密后的邮箱,或许可以复用mailMd5字段来存储sha256(不然再增加一个mailSha256字段,改动太大了,也不利于兼容升级),通过mailMd5的位数来判断其存的是md5还是sha256。

我下周一(5月27日)抽时间再把这个pr完善一下。

@Android-KitKat
Copy link
Contributor

Android-KitKat commented May 25, 2024

不过这样的话,mailMd5 其实应该叫 mailHash
但这个功能改动,对用户其实不太明显,要做出 突破性变化(指改字段名) 确实让人有些纠结。

@imaegoo imaegoo merged commit d3d5487 into twikoojs:main May 28, 2024
1 check passed
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.

[建议] Gravatar 头像使用 SHA256 哈希
3 participants