commit
f7658c323d
|
@ -101,7 +101,7 @@ export const MessageContextMenu = (props: PropsForMessageContextMenu) => {
|
|||
|
||||
const saveAttachment = useCallback(
|
||||
(e: any) => {
|
||||
e.stopPropagation();
|
||||
e.event.stopPropagation();
|
||||
if (!attachments?.length) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -825,7 +825,7 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
|
|||
_.defaults(options, { fromSync: false });
|
||||
|
||||
if (!expireTimer) {
|
||||
expireTimer = null;
|
||||
expireTimer = 0;
|
||||
}
|
||||
if (this.get('expireTimer') === expireTimer || (!expireTimer && !this.get('expireTimer'))) {
|
||||
return null;
|
||||
|
@ -852,6 +852,7 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
|
|||
// indicator above it. We set it to 'unread' to trigger that placement.
|
||||
unread: isOutgoing ? 0 : 1,
|
||||
conversationId: this.id,
|
||||
source,
|
||||
// No type; 'incoming' messages are specially treated by conversation.markRead()
|
||||
sent_at: timestamp,
|
||||
received_at: timestamp,
|
||||
|
|
|
@ -513,6 +513,7 @@ export class MessageModel extends Backbone.Model<MessageAttributes> {
|
|||
// isSelected: this.isSelected,
|
||||
id: this.id as string,
|
||||
conversationId: this.get('conversationId'),
|
||||
source: this.get('source'),
|
||||
receivedAt: this.get('received_at'),
|
||||
snippet: this.get('snippet'),
|
||||
};
|
||||
|
|
|
@ -115,7 +115,7 @@ export type PropsForDataExtractionNotification = DataExtractionNotificationMsg &
|
|||
|
||||
export interface MessageAttributesOptionals {
|
||||
id?: string;
|
||||
source?: string;
|
||||
source: string;
|
||||
quote?: any;
|
||||
expireTimer?: number;
|
||||
received_at?: number;
|
||||
|
|
|
@ -515,6 +515,7 @@ export async function handleDataExtractionNotification(
|
|||
|
||||
await convo.addSingleMessage({
|
||||
conversationId: convo.get('id'),
|
||||
source,
|
||||
type: 'outgoing', // mark it as outgoing just so it appears below our sent attachment
|
||||
sent_at: envelopeTimestamp,
|
||||
received_at: now,
|
||||
|
|
|
@ -164,8 +164,11 @@ export async function addUpdateMessage(
|
|||
|
||||
const unread = type === 'incoming';
|
||||
|
||||
const source = UserUtils.getOurPubKeyStrFromCache();
|
||||
|
||||
const message = await convo.addSingleMessage({
|
||||
conversationId: convo.get('id'),
|
||||
source,
|
||||
type,
|
||||
sent_at: sentAt,
|
||||
received_at: now,
|
||||
|
@ -313,9 +316,12 @@ export async function leaveClosedGroup(groupId: string) {
|
|||
convo.set({ groupAdmins: admins });
|
||||
await convo.commit();
|
||||
|
||||
const source = UserUtils.getOurPubKeyStrFromCache();
|
||||
|
||||
const dbMessage = await convo.addSingleMessage({
|
||||
group_update: { left: 'You' },
|
||||
conversationId: groupId,
|
||||
source,
|
||||
type: 'outgoing',
|
||||
sent_at: now,
|
||||
received_at: now,
|
||||
|
|
|
@ -128,6 +128,7 @@ export type PropsForSearchResults = {
|
|||
to: FindAndFormatContactType;
|
||||
id: string;
|
||||
conversationId: string;
|
||||
source: string;
|
||||
receivedAt: number | undefined;
|
||||
snippet?: string; //not sure about the type of snippet
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue