Universal Disappearing Messages
This commit is contained in:
parent
c63871d71b
commit
19f8042cd3
50 changed files with 1224 additions and 191 deletions
|
@ -129,6 +129,10 @@ type MessageBubbleProps =
|
|||
type: 'profileChange';
|
||||
data: ProfileChangeNotificationPropsType;
|
||||
}
|
||||
| {
|
||||
type: 'universalTimerNotification';
|
||||
data: null;
|
||||
}
|
||||
| {
|
||||
type: 'chatSessionRefreshed';
|
||||
data: null;
|
||||
|
@ -333,6 +337,7 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
|||
!this.isKeyChange() &&
|
||||
!this.isMessageHistoryUnsynced() &&
|
||||
!this.isProfileChange() &&
|
||||
!this.isUniversalTimerNotification() &&
|
||||
!this.isUnsupportedMessage() &&
|
||||
!this.isVerifiedChange()
|
||||
);
|
||||
|
@ -406,6 +411,12 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
|||
data: this.getPropsForProfileChange(),
|
||||
};
|
||||
}
|
||||
if (this.isUniversalTimerNotification()) {
|
||||
return {
|
||||
type: 'universalTimerNotification',
|
||||
data: null,
|
||||
};
|
||||
}
|
||||
if (this.isChatSessionRefreshed()) {
|
||||
return {
|
||||
type: 'chatSessionRefreshed',
|
||||
|
@ -600,6 +611,10 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
|||
return this.get('type') === 'profile-change';
|
||||
}
|
||||
|
||||
isUniversalTimerNotification(): boolean {
|
||||
return this.get('type') === 'universal-timer-notification';
|
||||
}
|
||||
|
||||
// Props for each message type
|
||||
getPropsForUnsupportedMessage(): PropsForUnsupportedMessage {
|
||||
const requiredVersion = this.get('requiredProtocolVersion');
|
||||
|
@ -1941,6 +1956,7 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
|||
const isKeyChange = this.isKeyChange();
|
||||
const isMessageHistoryUnsynced = this.isMessageHistoryUnsynced();
|
||||
const isProfileChange = this.isProfileChange();
|
||||
const isUniversalTimerNotification = this.isUniversalTimerNotification();
|
||||
|
||||
// Note: not all of these message types go through message.handleDataMessage
|
||||
|
||||
|
@ -1967,7 +1983,8 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
|||
// Locally-generated notifications
|
||||
isKeyChange ||
|
||||
isMessageHistoryUnsynced ||
|
||||
isProfileChange;
|
||||
isProfileChange ||
|
||||
isUniversalTimerNotification;
|
||||
|
||||
return !hasSomethingToDisplay;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue