prepare backend for inline replies
This commit is contained in:
Vendored
+6
-4
@@ -1312,7 +1312,7 @@
|
|||||||
const combinedChannel = allChannels.join("/");
|
const combinedChannel = allChannels.join("/");
|
||||||
return [senderName, combinedChannel];
|
return [senderName, combinedChannel];
|
||||||
};
|
};
|
||||||
this.sendMessage = async (body, fileContent) => {
|
this.sendMessage = async (body, replyId, fileContent) => {
|
||||||
const nameAndChannel = this.getNameAndChannel();
|
const nameAndChannel = this.getNameAndChannel();
|
||||||
if (nameAndChannel == false) return;
|
if (nameAndChannel == false) return;
|
||||||
const [senderName, combinedChannel] = nameAndChannel;
|
const [senderName, combinedChannel] = nameAndChannel;
|
||||||
@@ -1349,7 +1349,7 @@
|
|||||||
content,
|
content,
|
||||||
isDeleting
|
isDeleting
|
||||||
);
|
);
|
||||||
this.sendMessage("", reaction);
|
this.sendMessage("", void 0, reaction);
|
||||||
this.handleReaction(reaction);
|
this.handleReaction(reaction);
|
||||||
};
|
};
|
||||||
this.subscribe = () => {
|
this.subscribe = () => {
|
||||||
@@ -2257,7 +2257,7 @@
|
|||||||
this.connectionModel = connectionModel2;
|
this.connectionModel = connectionModel2;
|
||||||
this.chatListModel = chatListModel2;
|
this.chatListModel = chatListModel2;
|
||||||
this.fileTransferModel = fileTransferModel2;
|
this.fileTransferModel = fileTransferModel2;
|
||||||
this.BUILD = "Build 26.04.14.B";
|
this.BUILD = "Build 26.04.14.C";
|
||||||
// CONTEXT
|
// CONTEXT
|
||||||
this.contextStack = /* @__PURE__ */ new Map();
|
this.contextStack = /* @__PURE__ */ new Map();
|
||||||
this.closeContext = (contextId) => {
|
this.closeContext = (contextId) => {
|
||||||
@@ -2958,6 +2958,7 @@
|
|||||||
this.filteredMessageViewModels = new ListState();
|
this.filteredMessageViewModels = new ListState();
|
||||||
this.isFilterModalOpen = new State(false);
|
this.isFilterModalOpen = new State(false);
|
||||||
this.reactionFilter = new State(void 0);
|
this.reactionFilter = new State(void 0);
|
||||||
|
this.replyingMessageId = new State(void 0);
|
||||||
this.composingMessage = new State("");
|
this.composingMessage = new State("");
|
||||||
// methods
|
// methods
|
||||||
this.sendMessage = () => {
|
this.sendMessage = () => {
|
||||||
@@ -2966,7 +2967,8 @@
|
|||||||
this.composingMessage.value = "";
|
this.composingMessage.value = "";
|
||||||
};
|
};
|
||||||
this.sendMessageFromBody = (body) => {
|
this.sendMessageFromBody = (body) => {
|
||||||
this.chatViewModel.chatModel.sendMessage(body);
|
this.chatViewModel.chatModel.sendMessage(body, this.replyingMessageId.value);
|
||||||
|
this.replyingMessageId.value = void 0;
|
||||||
};
|
};
|
||||||
this.decryptMessage = async (messageViewModel) => {
|
this.decryptMessage = async (messageViewModel) => {
|
||||||
const chatMessage = messageViewModel.chatMessage;
|
const chatMessage = messageViewModel.chatMessage;
|
||||||
|
|||||||
@@ -180,6 +180,7 @@ export default class ChatModel {
|
|||||||
|
|
||||||
sendMessage = async (
|
sendMessage = async (
|
||||||
body: string,
|
body: string,
|
||||||
|
replyId?: string,
|
||||||
fileContent?: FileContent<string>,
|
fileContent?: FileContent<string>,
|
||||||
): Promise<boolean> => {
|
): Promise<boolean> => {
|
||||||
const nameAndChannel = this.getNameAndChannel();
|
const nameAndChannel = this.getNameAndChannel();
|
||||||
@@ -227,7 +228,7 @@ export default class ChatModel {
|
|||||||
content,
|
content,
|
||||||
isDeleting,
|
isDeleting,
|
||||||
);
|
);
|
||||||
this.sendMessage("", reaction);
|
this.sendMessage("", undefined, reaction);
|
||||||
this.handleReaction(reaction);
|
this.handleReaction(reaction);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -466,6 +467,7 @@ export interface ChatMessage extends ValidObject {
|
|||||||
readonly sender: string;
|
readonly sender: string;
|
||||||
body: string;
|
body: string;
|
||||||
readonly dateSent: string;
|
readonly dateSent: string;
|
||||||
|
readonly inlineReplyId?: string;
|
||||||
|
|
||||||
status: ChatMessageStatuses;
|
status: ChatMessageStatuses;
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,8 @@ export default class MessagePageViewModel extends Context {
|
|||||||
reactionFilter = new React.State<ReactionSymbols | undefined>(undefined);
|
reactionFilter = new React.State<ReactionSymbols | undefined>(undefined);
|
||||||
isFilterActive: React.State<boolean>;
|
isFilterActive: React.State<boolean>;
|
||||||
|
|
||||||
composingMessage: React.State<string> = new React.State("");
|
replyingMessageId = new React.State<string|undefined>(undefined)
|
||||||
|
composingMessage = new React.State<string>("");
|
||||||
|
|
||||||
// guards
|
// guards
|
||||||
cannotSendMessage: React.State<boolean>;
|
cannotSendMessage: React.State<boolean>;
|
||||||
@@ -37,7 +38,8 @@ export default class MessagePageViewModel extends Context {
|
|||||||
};
|
};
|
||||||
|
|
||||||
sendMessageFromBody = (body: string): void => {
|
sendMessageFromBody = (body: string): void => {
|
||||||
this.chatViewModel.chatModel.sendMessage(body);
|
this.chatViewModel.chatModel.sendMessage(body, this.replyingMessageId.value);
|
||||||
|
this.replyingMessageId.value = undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
decryptMessage = async (
|
decryptMessage = async (
|
||||||
|
|||||||
Reference in New Issue
Block a user