Add numeric avatars

pull/58/head
Matt Baer 6 years ago
parent 2942a6818e
commit c2a7f19ef0
  1. 4
      collections.go
  2. BIN
      static/img/avatars/0.png
  3. BIN
      static/img/avatars/1.png
  4. BIN
      static/img/avatars/2.png
  5. BIN
      static/img/avatars/3.png
  6. BIN
      static/img/avatars/4.png
  7. BIN
      static/img/avatars/5.png
  8. BIN
      static/img/avatars/6.png
  9. BIN
      static/img/avatars/7.png
  10. BIN
      static/img/avatars/8.png
  11. BIN
      static/img/avatars/9.png

@ -262,7 +262,7 @@ func (c *Collection) ForPublic() {
c.URL = c.CanonicalURL()
}
var isLowerLetter = regexp.MustCompile("[a-z]").MatchString
var isAvatarChar = regexp.MustCompile("[a-z0-9]").MatchString
func (c *Collection) PersonObject(ids ...int64) *activitystreams.Person {
accountRoot := c.FederatedAccount()
@ -297,7 +297,7 @@ func (c *Collection) PersonObject(ids ...int64) *activitystreams.Person {
func (c *Collection) AvatarURL() string {
fl := string(unicode.ToLower([]rune(c.DisplayTitle())[0]))
if !isLowerLetter(fl) {
if !isAvatarChar(fl) {
return ""
}
return hostName + "/img/avatars/" + fl + ".png"

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Loading…
Cancel
Save