mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
Universal Disappearing Messages
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user