Do not add non-messages to the timeline
This commit is contained in:
parent
19bb3bc994
commit
9ffcd44e6d
2 changed files with 16 additions and 10 deletions
|
@ -90,10 +90,11 @@ import {
|
||||||
} from '../util/whatTypeOfConversation';
|
} from '../util/whatTypeOfConversation';
|
||||||
import { SignalService as Proto } from '../protobuf';
|
import { SignalService as Proto } from '../protobuf';
|
||||||
import {
|
import {
|
||||||
|
getMessagePropStatus,
|
||||||
hasErrors,
|
hasErrors,
|
||||||
isIncoming,
|
isIncoming,
|
||||||
|
isStory,
|
||||||
isTapToView,
|
isTapToView,
|
||||||
getMessagePropStatus,
|
|
||||||
} from '../state/selectors/message';
|
} from '../state/selectors/message';
|
||||||
import {
|
import {
|
||||||
conversationJobQueue,
|
conversationJobQueue,
|
||||||
|
@ -1373,7 +1374,9 @@ export class ConversationModel extends window.Backbone
|
||||||
// Clear typing indicator for a given contact if we receive a message from them
|
// Clear typing indicator for a given contact if we receive a message from them
|
||||||
this.clearContactTypingTimer(typingToken);
|
this.clearContactTypingTimer(typingToken);
|
||||||
|
|
||||||
|
if (!isStory(message.attributes)) {
|
||||||
this.addSingleMessage(message);
|
this.addSingleMessage(message);
|
||||||
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||||
this.debouncedUpdateLastMessage!();
|
this.debouncedUpdateLastMessage!();
|
||||||
|
|
|
@ -227,14 +227,6 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
||||||
}
|
}
|
||||||
|
|
||||||
notifyRedux(): void {
|
notifyRedux(): void {
|
||||||
const { messageChanged } = window.reduxActions.conversations;
|
|
||||||
|
|
||||||
if (messageChanged) {
|
|
||||||
const conversationId = this.get('conversationId');
|
|
||||||
// Note: The clone is important for triggering a re-run of selectors
|
|
||||||
messageChanged(this.id, conversationId, { ...this.attributes });
|
|
||||||
}
|
|
||||||
|
|
||||||
const { storyChanged } = window.reduxActions.stories;
|
const { storyChanged } = window.reduxActions.stories;
|
||||||
|
|
||||||
if (isStory(this.attributes)) {
|
if (isStory(this.attributes)) {
|
||||||
|
@ -250,6 +242,17 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
||||||
}
|
}
|
||||||
|
|
||||||
storyChanged(storyData);
|
storyChanged(storyData);
|
||||||
|
|
||||||
|
// We don't want messageChanged to run
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { messageChanged } = window.reduxActions.conversations;
|
||||||
|
|
||||||
|
if (messageChanged) {
|
||||||
|
const conversationId = this.get('conversationId');
|
||||||
|
// Note: The clone is important for triggering a re-run of selectors
|
||||||
|
messageChanged(this.id, conversationId, { ...this.attributes });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue