Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33331882
D12352.1768887723.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D12352.1768887723.diff
View Options
diff --git a/lib/reducers/user-reducer.js b/lib/reducers/user-reducer.js
--- a/lib/reducers/user-reducer.js
+++ b/lib/reducers/user-reducer.js
@@ -23,6 +23,7 @@
setUserSettingsActionTypes,
updateUserAvatarActionTypes,
} from '../actions/user-actions.js';
+import bots from '../facts/bots.js';
import { extractKeyserverIDFromID } from '../keyserver-conn/keyserver-call-utils.js';
import { setNewSessionActionType } from '../keyserver-conn/keyserver-conn-types.js';
import {
@@ -224,6 +225,33 @@
.flat();
}
+function discardKeyserverUsernames(
+ newUserInfos: UserInfos,
+ stateUserInfos: UserInfos,
+): UserInfos {
+ let result: UserInfos = {};
+ for (const id in newUserInfos) {
+ if (id === bots.commbot.userID) {
+ result = {
+ ...result,
+ [id]: {
+ ...newUserInfos[id],
+ },
+ };
+ } else {
+ const username = stateUserInfos[id] ? stateUserInfos[id].username : null;
+ result = {
+ ...result,
+ [id]: {
+ ...newUserInfos[id],
+ username,
+ },
+ };
+ }
+ }
+ return result;
+}
+
type ReduceUserInfosResult = [
UserStore,
$ReadOnlyArray<ClientUserInconsistencyReportCreationRequest>,
@@ -314,10 +342,15 @@
if (keyserverID !== authoritativeKeyserverID()) {
return [state, [], []];
}
- const newUserInfos: UserInfos = _keyBy(userInfo => userInfo.id)(
+ const keyserverUserInfos: UserInfos = _keyBy(userInfo => userInfo.id)(
action.payload.userInfos,
);
+ const newUserInfos = discardKeyserverUsernames(
+ keyserverUserInfos,
+ state.userInfos,
+ );
+
const userStoreOps: $ReadOnlyArray<UserStoreOperation> =
convertUserInfosToReplaceUserOps(newUserInfos);
const processedUserInfos: UserInfos = processUserStoreOps(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Jan 20, 5:42 AM (7 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5959580
Default Alt Text
D12352.1768887723.diff (1 KB)
Attached To
Mode
D12352: [lib] Discard keyserver usernames for joinThreadActionTypes and newThreadActionTypes
Attached
Detach File
Event Timeline
Log In to Comment