|
@@ -448,12 +448,10 @@ const actionGetMessages = (chatID, skipCount) => actionPromise("messages", chatS
|
|
|
|
|
|
const actionChats = (chat_id, title, createdAt, lastModified, avatar, messages, members) => ({ type: "CHAT", chat_id, title, createdAt, lastModified, avatar, messages, members })
|
|
const actionChats = (chat_id, title, createdAt, lastModified, avatar, messages, members) => ({ type: "CHAT", chat_id, title, createdAt, lastModified, avatar, messages, members })
|
|
|
|
|
|
-export const actionEditChat = (chat_id, title, avatar, members) => ({ type: "CHAT", chat_id, title, avatar, members })
|
|
|
|
|
|
+const actionEditChat = (chat_id, title, avatar, members) => ({ type: "CHAT", chat_id, title, avatar, members })
|
|
|
|
|
|
const actionEditChatBack = (title, avatar, members) => actionPromise("edit_chat", editChat(title, avatar, members))
|
|
const actionEditChatBack = (title, avatar, members) => actionPromise("edit_chat", editChat(title, avatar, members))
|
|
|
|
|
|
-export const actionEditMSG = (chat_id, msg_id, msg_text) => ({ type: "MESSAGE", chat_id, msg_id, msg_text })
|
|
|
|
-
|
|
|
|
export const actionEditMSGback = (message_id, text, media) => actionPromise("edit_message", editMSG(message_id, text, media))
|
|
export const actionEditMSGback = (message_id, text, media) => actionPromise("edit_message", editMSG(message_id, text, media))
|
|
|
|
|
|
export const actionAddChatBack = (title, members) => actionPromise("chat", newChat(title, members))
|
|
export const actionAddChatBack = (title, members) => actionPromise("chat", newChat(title, members))
|
|
@@ -486,21 +484,6 @@ export const actionFullGetMessages = (id, skip) => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-export const actionFullAddChat = (title, members) => {
|
|
|
|
- return async (dispatch) => {
|
|
|
|
- let result = await dispatch(actionAddChatBack(title, members))
|
|
|
|
-
|
|
|
|
- dispatch(actionAddChat(result.data.ChatUpsert._id,
|
|
|
|
- result.data.ChatUpsert.title,
|
|
|
|
- result.data.ChatUpsert.createdAt,
|
|
|
|
- result.data.ChatUpsert.lastModified,
|
|
|
|
- result.data.ChatUpsert.owner,
|
|
|
|
- result.data.ChatUpsert.avatar,
|
|
|
|
- result.data.ChatUpsert.messages,
|
|
|
|
- result.data.ChatUpsert.members))
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
export const actionFullEditChat = (chat_id, title, avatar, members) => {
|
|
export const actionFullEditChat = (chat_id, title, avatar, members) => {
|
|
return async (dispatch) => {
|
|
return async (dispatch) => {
|
|
let result = await dispatch(actionEditChatBack(chat_id, title, members))
|
|
let result = await dispatch(actionEditChatBack(chat_id, title, members))
|
|
@@ -516,15 +499,4 @@ export const actionFullEditChat = (chat_id, title, avatar, members) => {
|
|
dispatch(actionEditChat(chat_id, title, null, members))
|
|
dispatch(actionEditChat(chat_id, title, null, members))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-}
|
|
|
|
-
|
|
|
|
-export const actionFullEditMSG = (message_id, text, media) => {
|
|
|
|
- return async (dispatch) => {
|
|
|
|
- let result = await dispatch(actionEditMSGback(message_id, text, media))
|
|
|
|
-
|
|
|
|
- dispatch(actionEditMSG(result.data.MessageUpsert.chat._id,
|
|
|
|
- result.data.MessageUpsert._id,
|
|
|
|
- result.data.MessageUpsert.text,
|
|
|
|
- result.data.MessageUpsert.media))
|
|
|
|
- }
|
|
|
|
}
|
|
}
|