mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-14 07:37:29 -06:00
add emoji + tags
This commit is contained in:
parent
23e2c4a567
commit
bf93305931
6 changed files with 129 additions and 25 deletions
|
|
@ -23,13 +23,13 @@ import (
|
|||
"fmt"
|
||||
"net"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/google/uuid"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db/model"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/distributor"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/oauth"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/util"
|
||||
"github.com/superseriousbusiness/gotosocial/pkg/mastotypes"
|
||||
|
|
@ -101,7 +101,6 @@ func (m *statusModule) statusCreatePOSTHandler(c *gin.Context) {
|
|||
thisStatusID := uuid.NewString()
|
||||
thisStatusURI := fmt.Sprintf("%s/%s", uris.StatusesURI, thisStatusID)
|
||||
thisStatusURL := fmt.Sprintf("%s/%s", uris.StatusesURL, thisStatusID)
|
||||
|
||||
newStatus := &model.Status{
|
||||
ID: thisStatusID,
|
||||
URI: thisStatusURI,
|
||||
|
|
@ -116,7 +115,6 @@ func (m *statusModule) statusCreatePOSTHandler(c *gin.Context) {
|
|||
ActivityStreamsType: model.ActivityStreamsNote,
|
||||
}
|
||||
|
||||
// take care of side effects -- mentions, updating metadata, etc, etc
|
||||
menchies, err := m.db.AccountStringsToMentions(util.DeriveMentions(form.Status), authed.Account.ID, thisStatusID)
|
||||
if err != nil {
|
||||
l.Debugf("error generating mentions from status: %s", err)
|
||||
|
|
@ -124,6 +122,17 @@ func (m *statusModule) statusCreatePOSTHandler(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
newStatus.Mentions = menchies
|
||||
|
||||
// take care of side effects -- federation, mentions, updating metadata, etc, etc
|
||||
|
||||
|
||||
m.distributor.FromClientAPI() <- distributor.FromClientAPI{
|
||||
APObjectType: model.ActivityStreamsNote,
|
||||
APActivityType: model.ActivityStreamsCreate,
|
||||
Activity: newStatus,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func validateCreateStatus(form *advancedStatusCreateForm, config *config.StatusesConfig, accountID string, db db.DB) error {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue