Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disappearing messages #2660

Closed
wants to merge 150 commits into from

Conversation

yougotwill
Copy link
Collaborator

@yougotwill yougotwill commented Feb 3, 2023

  • Updated right panel in a conversation to use overlay logic similar to the left panel.
  • Improved design for disappearing messages
  • Added panel radio buttons that are used for the disappearing message timer options
  • Improved Conversation Header that can switch between the notification settings, disappearing message setting and group members. When you click on the heading it opens the related right panel option (if available)
  • Added 2 new disappearing message modes (The original mode aka. Legacy will be removed in the future but will be kept for now for backwards compatibility / migration purposes)
    1. Disappear After Read
    2. Disappear After Send
  • Added disappearing support to other visible messages (call, group update, media extraction notifications etc.)
  • Use clock svg for disappearing countdown in all cases to keep in line with other platforms.
  • Disappearing messages are now correctly deleted from the swarm and won't appear when restoring a device
  • Users with newer desktop clients will get notified if they are sent messages from an older (legacy) client encouraging them to tell the other user to upgrade
  • Attachments should be correctly deleted off disk (and off swarm) once deleted in the client (solves Disappearing messages leave attachments on disk #2594, Attachment local deletion #2567)
  • Added a release feature utility which is used to activate a feature based on a set unix timestamp
  • Improved spacing and line height on toast notification

NOTE: Disappearing messages syncing will be finished after this branch is merged into the user config branch

ts/session/apis/snode_api/swarmPolling.ts Outdated Show resolved Hide resolved
ts/session/sending/MessageSentHandler.ts Outdated Show resolved Hide resolved
ts/node/migration/sessionMigrations.ts Show resolved Hide resolved
ts/session/apis/open_group_api/sogsv3/sogsV3ClearInbox.ts Outdated Show resolved Hide resolved
ts/hooks/useParamSelector.ts Outdated Show resolved Hide resolved
ts/models/message.ts Outdated Show resolved Hide resolved
ts/state/ducks/conversations.ts Outdated Show resolved Hide resolved
ts/util/releaseFeature.ts Outdated Show resolved Hide resolved
…reparation for disappearing messages

added panel buttons specific to this UI
added expirationType and lastDisappearingMessageChangeTimestamp to conversations table, left a few comments for future work
this is more explicit and allows use to use DisappearingMessageType in the message model
…ated message pipeline

this includes sync messages and updating the protobuf, haven't tested closed groups
updated copy for setting change messages
updated in parts but haven't test what happens
improved setExpirationStartTimestamp logic
ts/components/conversation/right-panel/RightPanel.tsx Outdated Show resolved Hide resolved
Comment on lines +1184 to +1194
(convo: ReduxConversationType | undefined) => {
let modes = DisappearingMessageConversationSetting;
// TODO legacy messages support will be removed in a future release
// TODO remove legacy mode
modes = modes.slice(0, -1);

// Note to Self and Closed Groups only support deleteAfterSend
const isClosedGroup = convo?.isGroup && !convo.isPublic;
if (convo?.isMe || isClosedGroup) {
modes = [modes[0], modes[2]];
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could mark DisappearingMessageConversationSetting as const so typescript understands it's not just an array of random string.

I think those lines could maybe be

const modes =  convo?.isMe || isClosedGroup ? 
    [DisappearingMessageConversationSetting[0], DisappearingMessageConversationSetting[2] 
: DisappearingMessageConversationSetting.filter("legacy")

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's keep in like that until we remove the legacy support. I saw the next function has the same issues too

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool cool. Yeah will be easier to cleanup later

ts/state/selectors/conversations.ts Outdated Show resolved Hide resolved
ts/state/selectors/conversations.ts Outdated Show resolved Hide resolved
ts/types/attachments/migrations.ts Outdated Show resolved Hide resolved
ts/types/attachments/migrations.ts Outdated Show resolved Hide resolved
@yougotwill yougotwill changed the title [WIP] Disappearing messages Disappearing messages May 18, 2023
…o we have to make deleteData more robust

javascript ¯\_(ツ)_/¯
…the default

fixed session radio button flickering
converted scss toast styling to styled components
@yougotwill
Copy link
Collaborator Author

Closed in favour of #2940

@yougotwill yougotwill closed this Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants