Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3156558
D10589.id35606.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D10589.id35606.diff
View Options
diff --git a/lib/reducers/message-reducer.js b/lib/reducers/message-reducer.js
--- a/lib/reducers/message-reducer.js
+++ b/lib/reducers/message-reducer.js
@@ -47,6 +47,8 @@
} from '../actions/thread-actions.js';
import { updateMultimediaMessageMediaActionType } from '../actions/upload-actions.js';
import {
+ keyserverAuthActionTypes,
+ tempIdentityLoginActionTypes,
logOutActionTypes,
deleteKeyserverAccountActionTypes,
logInActionTypes,
@@ -101,6 +103,7 @@
processUpdatesActionType,
} from '../types/update-types.js';
import { translateClientDBThreadMessageInfos } from '../utils/message-ops-utils.js';
+import { ashoatKeyserverID } from '../utils/validation-utils.js';
const _mapValuesWithKeys = _mapValues.convert({ cap: false });
@@ -745,6 +748,31 @@
threads: processedMessageStore.threads,
},
};
+ } else if (action.type === tempIdentityLoginActionTypes.success) {
+ const { messageStoreOperations, messageStore: freshStore } =
+ freshMessageStore([], {}, { [ashoatKeyserverID]: 0 }, newThreadInfos);
+
+ const processedMessageStore = processMessageStoreOperations(
+ messageStore,
+ messageStoreOperations,
+ );
+
+ return {
+ messageStoreOperations,
+ messageStore: {
+ ...freshStore,
+ messages: processedMessageStore.messages,
+ threads: processedMessageStore.threads,
+ },
+ };
+ } else if (action.type === keyserverAuthActionTypes.success) {
+ const { messagesResult } = action.payload;
+ return mergeNewMessages(
+ messageStore,
+ messagesResult.messageInfos,
+ messagesResult.truncationStatus,
+ newThreadInfos,
+ );
} else if (action.type === incrementalStateSyncActionType) {
if (
action.payload.messagesResult.rawMessageInfos.length === 0 &&
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 6, 4:12 PM (18 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2431344
Default Alt Text
D10589.id35606.diff (1 KB)
Attached To
Mode
D10589: [lib] Refactor reduceMessageStore
Attached
Detach File
Event Timeline
Log In to Comment