Add initials provider

This commit is contained in:
kolaente 2020-08-01 19:13:37 +02:00
parent 9b81d63f3e
commit d543762883
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,25 @@
// Vikunja is a to-do list application to facilitate your life.
// Copyright 2018-2020 Vikunja and contributors. All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package initials
import "code.vikunja.io/api/pkg/user"
type Provider struct {
}
func (p *Provider) GetAvatar(u *user.User, size int64) (avatar []byte, mimeType string, err error) {
}

View File

@ -21,6 +21,7 @@ import (
"code.vikunja.io/api/pkg/modules/avatar"
"code.vikunja.io/api/pkg/modules/avatar/empty"
"code.vikunja.io/api/pkg/modules/avatar/gravatar"
"code.vikunja.io/api/pkg/modules/avatar/initials"
user2 "code.vikunja.io/api/pkg/user"
"code.vikunja.io/web/handler"
"github.com/labstack/echo/v4"
@ -57,6 +58,8 @@ func GetAvatar(c echo.Context) error {
switch user.AvatarProvider {
case "gravatar":
avatarProvider = &gravatar.Provider{}
case "initials":
avatarProvider = &initials.Provider{}
default:
avatarProvider = &empty.Provider{}
}