mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-16 03:13:11 -06:00
Suggested changes made
This commit is contained in:
parent
55f8e042f3
commit
322a8f471c
|
|
@ -115,6 +115,8 @@ func PutTag(
|
||||||
return httputil.LogThenError(req, err)
|
return httputil.LogThenError(req, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Send data to syncProducer in order to inform clients of changes
|
||||||
|
// Run in a goroutine in order to prevent blocking the tag request response
|
||||||
go func() {
|
go func() {
|
||||||
if err := syncProducer.SendData(userID, roomID, "m.tag"); err != nil {
|
if err := syncProducer.SendData(userID, roomID, "m.tag"); err != nil {
|
||||||
logrus.WithError(err).Error("Failed to send m.tag account data update to syncapi")
|
logrus.WithError(err).Error("Failed to send m.tag account data update to syncapi")
|
||||||
|
|
@ -181,6 +183,8 @@ func DeleteTag(
|
||||||
return httputil.LogThenError(req, err)
|
return httputil.LogThenError(req, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Send data to syncProducer in order to inform clients of changes
|
||||||
|
// Run in a goroutine in order to prevent blocking the tag request response
|
||||||
go func() {
|
go func() {
|
||||||
if err := syncProducer.SendData(userID, roomID, "m.tag"); err != nil {
|
if err := syncProducer.SendData(userID, roomID, "m.tag"); err != nil {
|
||||||
logrus.WithError(err).Error("Failed to send m.tag account data update to syncapi")
|
logrus.WithError(err).Error("Failed to send m.tag account data update to syncapi")
|
||||||
|
|
@ -193,7 +197,8 @@ func DeleteTag(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// obtainSavedTags gets all the tags saved in the DB
|
// obtainSavedTags gets all tags scoped to a userID and roomID
|
||||||
|
// from the database
|
||||||
func obtainSavedTags(
|
func obtainSavedTags(
|
||||||
req *http.Request,
|
req *http.Request,
|
||||||
userID string,
|
userID string,
|
||||||
|
|
@ -208,14 +213,11 @@ func obtainSavedTags(
|
||||||
data, err := accountDB.GetAccountDataByType(
|
data, err := accountDB.GetAccountDataByType(
|
||||||
req.Context(), localpart, roomID, "m.tag",
|
req.Context(), localpart, roomID, "m.tag",
|
||||||
)
|
)
|
||||||
if err != nil {
|
|
||||||
return "", nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return localpart, data, nil
|
return localpart, data, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// saveTagData saves the tag data into the DB
|
// saveTagData saves the provided tag data into the database
|
||||||
func saveTagData(
|
func saveTagData(
|
||||||
req *http.Request,
|
req *http.Request,
|
||||||
localpart string,
|
localpart string,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue