Progress on DMs
Progress on DMs
This commit is contained in:
@@ -7,6 +7,7 @@ import compareId from '../utils/compare_id'
|
||||
import {
|
||||
CHAT_MESSAGES_SEND_SUCCESS,
|
||||
CHAT_MESSAGES_DELETE_REQUEST,
|
||||
CHAT_MESSAGES_PURGE_SUCCESS,
|
||||
} from '../actions/chat_messages'
|
||||
import {
|
||||
CHAT_CONVERSATION_MESSAGES_EXPAND_REQUEST,
|
||||
@@ -101,6 +102,9 @@ export default function chat_conversation_messages(state = initialState, action)
|
||||
case CHAT_MESSAGES_DELETE_REQUEST:
|
||||
// : todo :
|
||||
return state
|
||||
case CHAT_MESSAGES_PURGE_SUCCESS:
|
||||
// : todo :
|
||||
return state
|
||||
default:
|
||||
return state
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import {
|
||||
CHAT_CONVERSATIONS_REQUESTED_EXPAND_SUCCESS,
|
||||
CHAT_CONVERSATION_REQUEST_APPROVE_SUCCESS,
|
||||
CHAT_CONVERSATION_MARK_READ_SUCCESS,
|
||||
SET_CHAT_CONVERSATION_EXPIRATION_SUCCESS,
|
||||
} from '../actions/chat_conversations'
|
||||
|
||||
const initialState = ImmutableMap()
|
||||
@@ -41,6 +42,7 @@ const importChatConversations = (state, chatConversations) => {
|
||||
export default function chat_conversations(state = initialState, action) {
|
||||
switch(action.type) {
|
||||
case CHAT_CONVERSATION_REQUEST_APPROVE_SUCCESS:
|
||||
case SET_CHAT_CONVERSATION_EXPIRATION_SUCCESS:
|
||||
return importChatConversation(state, action.chatConversation)
|
||||
case CHAT_CONVERSATIONS_APPROVED_FETCH_SUCCESS:
|
||||
case CHAT_CONVERSATIONS_APPROVED_EXPAND_SUCCESS:
|
||||
|
||||
@@ -12,6 +12,7 @@ import {
|
||||
RELATIONSHIPS_FETCH_SUCCESS,
|
||||
} from '../actions/accounts'
|
||||
import {
|
||||
FETCH_CHAT_MESSENGER_BLOCKING_RELATIONSHIPS_SUCCESS,
|
||||
BLOCK_CHAT_MESSAGER_SUCCESS,
|
||||
UNBLOCK_CHAT_MESSAGER_SUCCESS,
|
||||
} from '../actions/chat_conversation_accounts'
|
||||
@@ -39,14 +40,21 @@ export default function relationships(state = initialState, action) {
|
||||
return state.setIn([action.id, 'following'], false)
|
||||
case ACCOUNT_UNFOLLOW_FAIL:
|
||||
return state.setIn([action.id, 'following'], true)
|
||||
|
||||
case BLOCK_CHAT_MESSAGER_SUCCESS:
|
||||
case FETCH_CHAT_MESSENGER_BLOCKING_RELATIONSHIPS_SUCCESS:
|
||||
case UNBLOCK_CHAT_MESSAGER_SUCCESS:
|
||||
return state.withMutations((map) => {
|
||||
if (action.data.chat_blocking !== undefined) map.setIn([data.target_id, 'chat_blocking'], action.data.chat_blocking)
|
||||
if (action.data.chat_blocked_by !== undefined) map.setIn([data.target_id, 'chat_blocked_by'], action.data.chat_blocked_by)
|
||||
})
|
||||
|
||||
case ACCOUNT_FOLLOW_SUCCESS:
|
||||
case ACCOUNT_UNFOLLOW_SUCCESS:
|
||||
case ACCOUNT_BLOCK_SUCCESS:
|
||||
case ACCOUNT_UNBLOCK_SUCCESS:
|
||||
case ACCOUNT_MUTE_SUCCESS:
|
||||
case ACCOUNT_UNMUTE_SUCCESS:
|
||||
case BLOCK_CHAT_MESSAGER_SUCCESS:
|
||||
case UNBLOCK_CHAT_MESSAGER_SUCCESS:
|
||||
return normalizeRelationship(state, action.relationship)
|
||||
case RELATIONSHIPS_FETCH_SUCCESS:
|
||||
return normalizeRelationships(state, action.relationships)
|
||||
|
||||
Reference in New Issue
Block a user