mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-14 13:22:26 +03:00
Notify profile update (#153)
* Profile retrieval * Saving avatar (without propagating it) * Saving display name (without propagating it) * Getters for display name and avatar URL * Doc'd * Introduced new Kafka topic and producer * Updated config with new kafka topic * Switched to samara producer and now sending messages * Doc'd * Put kafka update after the database insert * Doc'd profileUpdate structure * Removed unused parameter * Moved user updates producer to clientapi/producers
This commit is contained in:
parent
1efbad8119
commit
355ab5eedf
6 changed files with 113 additions and 3 deletions
|
@ -46,6 +46,7 @@ func Setup(
|
|||
deviceDB *devices.Database,
|
||||
federation *gomatrixserverlib.FederationClient,
|
||||
keyRing gomatrixserverlib.KeyRing,
|
||||
userUpdateProducer *producers.UserUpdateProducer,
|
||||
) {
|
||||
apiMux := mux.NewRouter()
|
||||
|
||||
|
@ -178,7 +179,7 @@ func Setup(
|
|||
r0mux.Handle("/profile/{userID}/avatar_url",
|
||||
common.MakeAuthAPI("profile_avatar_url", deviceDB, func(req *http.Request, device *authtypes.Device) util.JSONResponse {
|
||||
vars := mux.Vars(req)
|
||||
return readers.SetAvatarURL(req, accountDB, vars["userID"])
|
||||
return readers.SetAvatarURL(req, accountDB, vars["userID"], userUpdateProducer)
|
||||
}),
|
||||
).Methods("PUT", "OPTIONS")
|
||||
// Browsers use the OPTIONS HTTP method to check if the CORS policy allows
|
||||
|
@ -194,7 +195,7 @@ func Setup(
|
|||
r0mux.Handle("/profile/{userID}/displayname",
|
||||
common.MakeAuthAPI("profile_displayname", deviceDB, func(req *http.Request, device *authtypes.Device) util.JSONResponse {
|
||||
vars := mux.Vars(req)
|
||||
return readers.SetDisplayName(req, accountDB, vars["userID"])
|
||||
return readers.SetDisplayName(req, accountDB, vars["userID"], userUpdateProducer)
|
||||
}),
|
||||
).Methods("PUT", "OPTIONS")
|
||||
// Browsers use the OPTIONS HTTP method to check if the CORS policy allows
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue