Add missing directProfiles updates on real-time user updates (#3876)
Этот коммит содержится в:
@@ -235,7 +235,6 @@ func (u *User) Sanitize(options map[string]bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (u *User) ClearNonProfileFields() {
|
func (u *User) ClearNonProfileFields() {
|
||||||
u.UpdateAt = 0
|
|
||||||
u.Password = ""
|
u.Password = ""
|
||||||
u.AuthData = new(string)
|
u.AuthData = new(string)
|
||||||
*u.AuthData = ""
|
*u.AuthData = ""
|
||||||
|
|||||||
@@ -248,6 +248,9 @@ function handleUserRemovedEvent(msg) {
|
|||||||
function handleUserUpdatedEvent(msg) {
|
function handleUserUpdatedEvent(msg) {
|
||||||
if (UserStore.getCurrentId() !== msg.user_id) {
|
if (UserStore.getCurrentId() !== msg.user_id) {
|
||||||
UserStore.saveProfile(msg.data.user);
|
UserStore.saveProfile(msg.data.user);
|
||||||
|
if (UserStore.hasDirectProfile(msg.user_id)) {
|
||||||
|
UserStore.saveDirectProfile(msg.data.user);
|
||||||
|
}
|
||||||
UserStore.emitChange(msg.user_id);
|
UserStore.emitChange(msg.user_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -166,6 +166,10 @@ class UserStoreClass extends EventEmitter {
|
|||||||
return this.direct_profiles;
|
return this.direct_profiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
saveDirectProfile(profile) {
|
||||||
|
this.direct_profiles[profile.id] = profile;
|
||||||
|
}
|
||||||
|
|
||||||
saveDirectProfiles(profiles) {
|
saveDirectProfiles(profiles) {
|
||||||
this.direct_profiles = profiles;
|
this.direct_profiles = profiles;
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user