mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-11-29 07:02:45 +00:00
small fiddling to allow whalebird to work (a bit)
This commit is contained in:
parent
43c3a47773
commit
aeb665df55
|
@ -44,9 +44,9 @@ func (m *Module) AccountUpdateCredentialsPATCHHandler(c *gin.Context) {
|
||||||
}
|
}
|
||||||
l.Tracef("retrieved account %+v", authed.Account.ID)
|
l.Tracef("retrieved account %+v", authed.Account.ID)
|
||||||
|
|
||||||
l.Trace("parsing request form")
|
l.Debugf("parsing request form %s", c.Request.Form)
|
||||||
form := &model.UpdateCredentialsRequest{}
|
form := &model.UpdateCredentialsRequest{}
|
||||||
if err := c.ShouldBind(form); err != nil || form == nil {
|
if err := c.ShouldBind(&form); err != nil || form == nil {
|
||||||
l.Debugf("could not parse form from request: %s", err)
|
l.Debugf("could not parse form from request: %s", err)
|
||||||
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
||||||
return
|
return
|
||||||
|
|
|
@ -33,7 +33,7 @@ type Instance struct {
|
||||||
// An email that may be contacted for any inquiries.
|
// An email that may be contacted for any inquiries.
|
||||||
Email string `json:"email"`
|
Email string `json:"email"`
|
||||||
// The version of Mastodon installed on the instance.
|
// The version of Mastodon installed on the instance.
|
||||||
Version string `json:"version,omitempty"`
|
Version string `json:"version"`
|
||||||
// Primary langauges of the website and its staff.
|
// Primary langauges of the website and its staff.
|
||||||
Languages []string `json:"languages,omitempty"`
|
Languages []string `json:"languages,omitempty"`
|
||||||
// Whether registrations are enabled.
|
// Whether registrations are enabled.
|
||||||
|
|
|
@ -30,4 +30,6 @@ type Instance struct {
|
||||||
ContactAccountID string
|
ContactAccountID string
|
||||||
// Reputation score of this instance
|
// Reputation score of this instance
|
||||||
Reputation int64 `pg:",notnull,default:0"`
|
Reputation int64 `pg:",notnull,default:0"`
|
||||||
|
// Version of the software used on this instance
|
||||||
|
Version string
|
||||||
}
|
}
|
||||||
|
|
|
@ -550,6 +550,7 @@ func (c *converter) InstanceToMasto(i *gtsmodel.Instance) (*model.Instance, erro
|
||||||
Description: i.Description,
|
Description: i.Description,
|
||||||
ShortDescription: i.ShortDescription,
|
ShortDescription: i.ShortDescription,
|
||||||
Email: i.ContactEmail,
|
Email: i.ContactEmail,
|
||||||
|
Version: i.Version,
|
||||||
}
|
}
|
||||||
|
|
||||||
if i.Domain == c.config.Host {
|
if i.Domain == c.config.Host {
|
||||||
|
@ -557,6 +558,9 @@ func (c *converter) InstanceToMasto(i *gtsmodel.Instance) (*model.Instance, erro
|
||||||
mi.ApprovalRequired = c.config.AccountsConfig.RequireApproval
|
mi.ApprovalRequired = c.config.AccountsConfig.RequireApproval
|
||||||
mi.InvitesEnabled = false // TODO
|
mi.InvitesEnabled = false // TODO
|
||||||
mi.MaxTootChars = uint(c.config.StatusesConfig.MaxChars)
|
mi.MaxTootChars = uint(c.config.StatusesConfig.MaxChars)
|
||||||
|
mi.URLS = &model.InstanceURLs{
|
||||||
|
StreamingAPI: fmt.Sprintf("wss://%s", c.config.Host),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// contact account is optional but let's try to get it
|
// contact account is optional but let's try to get it
|
||||||
|
|
Loading…
Reference in a new issue