fix merge conflicts

This commit is contained in:
localhost_frssoft 2023-10-12 16:07:27 +03:00
parent 4379eab5bf
commit 96a0d7cf05
3 changed files with 2 additions and 54 deletions

View file

@ -207,43 +207,6 @@ func NewHandler(s *service, verbose bool, staticDir string) http.Handler {
return s.SearchPage(c, sq, qType, offset)
}, SESSION, HTML)
userEditPage := handle(func(c *client) error {
return s.UserEditPage(c)
}, SESSION, HTML)
userEdit := handle(func(c *client) error {
displayName := c.r.FormValue("display-name")
note := c.r.FormValue("note")
locked := c.r.FormValue("locked") == "true"
bot := c.r.FormValue("bot") == "true"
acceptsChatMessages := c.r.FormValue("accepts-chat-messages") == "true"
hideFavourites := c.r.FormValue("hide-favourites") == "true"
pleromaProfile := mastodon.ProfilePleroma{
AcceptsChatMessages: &acceptsChatMessages,
HideFavourites: &hideFavourites,
}
usersettings := mastodon.Profile{
DisplayName: &displayName,
Note: &note,
Locked: &locked,
Fields: nil,
Source: nil,
Avatar: "",
Header: "",
Bot: &bot,
Pleroma: &pleromaProfile,
}
err := s.UserSave(c, usersettings)
if err != nil {
return err
}
c.redirect("/user/"+c.r.FormValue("id"))
return nil
}, SESSION, HTML)
settingsPage := handle(func(c *client) error {
return s.SettingsPage(c)
}, SESSION, HTML)
@ -870,8 +833,6 @@ func NewHandler(s *service, verbose bool, staticDir string) http.Handler {
r.HandleFunc("/aboutinstance", aboutInstance).Methods(http.MethodGet)
r.HandleFunc("/emojis", emojisPage).Methods(http.MethodGet)
r.HandleFunc("/search", searchPage).Methods(http.MethodGet)
r.HandleFunc("/useredit", userEditPage).Methods(http.MethodGet)
r.HandleFunc("/useredit", userEdit).Methods(http.MethodPost)
r.HandleFunc("/settings", settingsPage).Methods(http.MethodGet)
r.HandleFunc("/filters", filtersPage).Methods(http.MethodGet)
r.HandleFunc("/profile", profilePage).Methods(http.MethodGet)