add new user set avatar and profile background

This commit is contained in:
gitGnome
2026-04-28 11:16:37 +02:00
parent 6f7a913e64
commit 8697cd2632
10 changed files with 203 additions and 228 deletions
+19 -19
View File
@@ -90,22 +90,22 @@ func getHubUserIfValidWithResponseOnFail(ctx context.Context, response http.Resp
return user, hubUser, hub, nil
}
func getHubChannelIfValidWithResponseOnFail(ctx context.Context, response http.ResponseWriter, hub *types.Hub, hubUser *types.HubUser, channelId string) (
*types.HubChannel, error) {
channelUuid, err := convertions.StringToUuid(channelId)
if err != nil {
http.Error(response, "invalid channelid", http.StatusBadRequest)
return nil, errors.New("invalid channelid")
}
channel, ok := hub.Channels[channelUuid]
if !ok {
http.Error(response, "invalid channelid", http.StatusBadRequest)
return nil, errors.New("invalid channelid")
}
if !haveHubUserPermissionsOnChannel(types.CachedUserCanView, hubUser, channel) {
return nil, errors.New("invalid channelid")
}
return channel, nil
}
//func getHubChannelIfValidWithResponseOnFail(ctx context.Context, response http.ResponseWriter, hub *types.Hub, hubUser *types.HubUser, channelId string) (
// *types.HubChannel, error) {
// channelUuid, err := convertions.StringToUuid(channelId)
// if err != nil {
// http.Error(response, "invalid channelid", http.StatusBadRequest)
// return nil, errors.New("invalid channelid")
// }
// channel, ok := hub.Channels[channelUuid]
// if !ok {
// http.Error(response, "invalid channelid", http.StatusBadRequest)
// return nil, errors.New("invalid channelid")
// }
//
// if !haveHubUserPermissionsOnChannel(types.CachedUserCanView, hubUser, channel) {
// return nil, errors.New("invalid channelid")
// }
//
// return channel, nil
//}