backend for xcvr appview
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix :=

+17 -17
+3 -3
lexicons/org/xcvr/actor/profile.json
··· 20 20 }, 21 21 "status": { 22 22 "type": "string", 23 - "maxGraphemes": 64, 24 - "maxLength": 640 23 + "maxGraphemes": 640, 24 + "maxLength": 6400 25 25 }, 26 26 "avatar": { 27 27 "type": "blob", ··· 38 38 }, 39 39 } 40 40 } 41 - } 41 + }
+1 -1
server/internal/handler/oauthHandlers.go
··· 166 166 }) 167 167 } 168 168 169 - func (h *Handler) findDidAndHandle(w http.ResponseWriter, r *http.Request) (did, handle string, err error) { 169 + func (h *Handler) findDidAndHandle(w http.ResponseWriter, r *http.Request) (string, string, error) { 170 170 session, _ := h.sessionStore.Get(r, "oauthsession") 171 171 did, ok := session.Values["did"].(string) 172 172 if !ok || did == "" {
+13 -13
server/internal/handler/xcvrHandlers.go
··· 1 1 package handler 2 2 3 3 import ( 4 + "encoding/json" 5 + "errors" 4 6 "net/http" 5 - "xcvr-backend/internal/types" 6 7 "xcvr-backend/internal/db" 7 - "errors" 8 - "encoding/json" 8 + "xcvr-backend/internal/types" 9 9 ) 10 10 11 11 func (h *Handler) postProfile(w http.ResponseWriter, r *http.Request) { 12 12 did, handle, err := h.findDidAndHandle(w, r) 13 13 if err != nil { 14 - h.handleFindDidAndHandleError(w,r, err) 14 + h.handleFindDidAndHandleError(w, r, err) 15 15 return 16 16 } 17 17 var p types.PostProfileRequest 18 18 decoder := json.NewDecoder(r.Body) 19 - err := decoder.Decode(&p) 19 + err = decoder.Decode(&p) 20 20 if err != nil { 21 - h.badRequest(w, errors.New("error decoding post profile request: " + err.Error())) 21 + h.badRequest(w, errors.New("error decoding post profile request: "+err.Error())) 22 22 return 23 23 } 24 24 var pu db.ProfileUpdate ··· 26 26 if p.DisplayName != nil { 27 27 pu.Name = p.DisplayName 28 28 pu.UpdateName = true 29 - } 29 + } 30 30 if p.DefaultNick != nil { 31 31 pu.Nick = p.DefaultNick 32 32 pu.UpdateNick = true 33 - } 33 + } 34 34 if p.Status != nil { 35 35 pu.Status = p.Status 36 36 pu.UpdateStatus = true 37 - } 37 + } 38 38 if p.Avatar != nil { 39 39 pu.Avatar = p.Avatar 40 40 pu.UpdateAvatar = true 41 - } 41 + } 42 42 if p.Color != nil { 43 43 pu.Color = p.Color 44 44 pu.UpdateColor = true 45 - } 45 + } 46 46 err = h.db.UpdateProfile(pu, r.Context()) 47 47 if err != nil { 48 - h.serverError(w, errors.New("error updating profile: " + err.Error())) 48 + h.serverError(w, errors.New("error updating profile: "+err.Error())) 49 49 return 50 50 } 51 - h.serveProfileView(did, handle, w,r) 51 + h.serveProfileView(did, handle, w, r) 52 52 }