You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
session-desktop/ts/models/messageType.ts

238 lines
6.7 KiB
TypeScript

import _ from 'underscore';
4 years ago
import { v4 as uuidv4 } from 'uuid';
Session 1.7.5 (#2094) * Added message requests disabled for now * no longer showing empty space for conversations moved from list. * Added syncing accepting of contact between running instances. * Adding blocking of individual requests and syncing of block to devices. Added approval by replying to a message. * fixed typos for translations and method name. * Blocking, accepting on click and accepting on msg send working across clients. * adding setting of active_at to hide unapproved messages. * adding feature flag for config message receiving * fix archlinux pw unused issue on archlinux, the appimage links to the system sqlite by default which does not support sqlcipher * hide activeAt = 0 convo from search results Fixes #2033 * opengroup messages from blocked user are dropped Fixes #2019 * opengroup messages from blocked user are dropped Fixes #2019 * dismiss a call when answered from another of our devices * add data-testid for leftpane sections and edit profile dialog * update turn servers * cleanup sessionprotobuf * move the state of calling to its own slice * no video track by default and will be turn ON if asked to * message request refactoring. * create offer and answer ourselves and do not use the negotiation needed event. this event is causing us to loop in negotiation needed when each side try to create one, gets the answer and so on... * auto select the first audio input on connection success webrtc * add a way to choose the audioouput/mute a webrtc call * mute audio from bg when video is in fullscreen this is to avoid having two times the remote sound playing one in the bg and one in the fullscreen * Adding improvements to message request handling. * Only updating approval when it is a true value as we consider a block a decline. * Linting and formatting. * More formatting and linting * fixing merge conflicts * linting and formatting changes * darken a bit the green of sent message box in light theme * disable deduplication based serverId+sender only use the serverTimestamp+sender for searching because serverId+sender might have false positive * Fixing up block all logic. * speed up fetching closed group's members avatar * Applying PR changes. * cleanup props passing of avatar and name with a custom hook * fix a bug releasing the decrypted attachment blobs too early * Adding trigger logic for conversation filtering of requests. * Fixing rimraf transpile bug. Adding PR fixes - icon buttons. * Minor call tweaks (#2051) * show missed-call,started-call and answered call notification in chat * fix types for createLastMessageUpdate * show incoming dialog if we have a pending call when enable call receptio * simplify a bit the avatar component * move disableDrag to a custom hook * speed up hash colors of avatarPlaceHolders * fixup text selection and double click reply on message * keep avatar decoded items longer before releasing memory * add incoming/outgoing/missed call notification also, merge that notification with the timer and group notification component * hangup call if no answer after 30sec * refactor SessionInput using hook + add testid field for recovery * disable message request feature flag for now * fix merge issue * force loading screen to be black instead of white for our dark theme user's eyes safety * Fetch translations (#2056) * show missed-call,started-call and answered call notification in chat * fix types for createLastMessageUpdate * show incoming dialog if we have a pending call when enable call receptio * simplify a bit the avatar component * move disableDrag to a custom hook * speed up hash colors of avatarPlaceHolders * fixup text selection and double click reply on message * keep avatar decoded items longer before releasing memory * add incoming/outgoing/missed call notification also, merge that notification with the timer and group notification component * hangup call if no answer after 30sec * refactor SessionInput using hook + add testid field for recovery * disable message request feature flag for now * fix merge issue * force loading screen to be black instead of white for our dark theme user's eyes safety * add type for i18n to run update after crowdin fetch with tools/updateI18nKeysType.py * update to latest translations * Open group regex fixes (#2058) * Open group URL regex fixes - Capital letters in room tokens were not being accepted (it eventually gets lower-cased internally, which works fine, but that happens *after* the URL is tested for acceptability). - `-` in room was not being allowed (it is and always has been on SOGS, session-android, and session-ios). - single-letter room ids are valid, but only 2+ letter ids were being accepted. - complete URL regex wasn't anchored so something like `garbagehttps://example.com/room?public_key=<64hex>moregarbage` was being accepted in the GUI input (it fails later when other code tries to parse it as a URL). - removed `m` modifier from open group regex: without anchors it wasn't doing anything anyway, but *with* anchors it would still allow leading/trailing garbage if delineated by newlines. - public key regex was accepting g-z letters, and not accepting A-F. - various regex cleanups: - use non-capture groups (?:...) rather than capturing groups (...) - avoid repetition in host segment matching - tightened up host pattern matching a bit: - DNS host segments have a max length of 63 - Limit port max length to 5, and disallow starting with 0 * Show an error when the open group URL is invalid It's quite disconcerting when you have a bad open group URL and try to add it and the join button just "doesn't work" without any feedback at all. Fix it to show an error message. (There is already an i18n entry for this because this same message is thrown if the URL can't be parsed later on). * Add call duration (#2059) * add call duration once connected * close incoming call dialog if endCall from same sender * disable message request toggle if featureFlag is OFF * Cleanup message request (#2063) * close incoming call dialog if endCall from seame sender * disable message request toggle if featureFlag is OFF * cleanup UI of message requests * mark all existing conversations as approved in a migration * fix regex with conversationID for opengroups * Various UI fixes (#2070) * cleanup unused convo json fields in db * display a toast if the user is not approved yet on call OFFER received * enable CBR for calls * do not update active_at on configMessage if !!active_at * remove mkdirp dependency * disable call button if focused convo is blocked * quote: do not include the full body in quote, but just the first 100 * click on the edit profile qr code padding * Allow longer input for opengroup join overlay Fixes #2068 * Fix overlay feature for start new session button * make ringing depend on redux CALL status * turn ON read-receipt by default * keep read-receipts disabled by default (#2071) * refactor most of the components to outside of their Session folder (#2072) * refactor most of the components to outside of their Session folder * finish moving overlay and memberListItem to react hook * fix bug with kicked member len >2 not being displayed also sort admins first in UpdateGroupMembers dialog * fix admin leaving text of groupNotification * add a useFocusMount hook to focus input fields on mount * make click avatar convo item open only user dialog * cleanup config default.json * make sure to use convoController to build sync message * disable showing pubkey on opengroups * add a pause on audio playback Fixes #2079 * Minor styling fix for large amount of message requests (#2080) * Minor styling fix for large amount of message requests * Vertical center fix for message request banner. * removing top margin from banner again. * reactify group updates text bubble from redux store (#2083) * add crown icon for closed group admins (#2084) * disable call for now + fix left pane actions overflow (#2085) * Fix attachment dl freeze (#2086) * fix attachment download freezing app for some opengroups * make registration page work with smaller height * Unban UI (#2091) * adding basic functionaliy for unbanning a user * merge ban and unban user dialog in to one dialog Co-authored-by: warrickct <warrickct@gmail.com> * use React Provider for convoListItem (#2088) this is to avoid passing down the prop to all the components * fix closed group updates undefined on no names (#2092) Co-authored-by: Warrick Corfe-Tan <warrickct@gmail.com> Co-authored-by: Jason Rhinelander <jason@imaginary.ca> Co-authored-by: Warrick <wcor690@aucklanduni.ac.nz>
3 years ago
import { CallNotificationType, PropsForMessageWithConvoProps } from '../state/ducks/conversations';
import { AttachmentTypeWithPath } from '../types/Attachment';
export type MessageModelType = 'incoming' | 'outgoing';
export type MessageDeliveryStatus = 'sending' | 'sent' | 'read' | 'error';
export interface MessageAttributes {
// the id of the message
// this can have several uses:
id: string;
source: string;
quote?: any;
expireTimer: number;
received_at?: number;
sent_at?: number;
destination?: string;
preview?: any;
body?: string;
expirationStartTimestamp: number;
read_by: Array<string>;
decrypted_at: number;
expires_at?: number;
recipients: Array<string>;
type: MessageModelType;
Session 1.7.5 (#2094) * Added message requests disabled for now * no longer showing empty space for conversations moved from list. * Added syncing accepting of contact between running instances. * Adding blocking of individual requests and syncing of block to devices. Added approval by replying to a message. * fixed typos for translations and method name. * Blocking, accepting on click and accepting on msg send working across clients. * adding setting of active_at to hide unapproved messages. * adding feature flag for config message receiving * fix archlinux pw unused issue on archlinux, the appimage links to the system sqlite by default which does not support sqlcipher * hide activeAt = 0 convo from search results Fixes #2033 * opengroup messages from blocked user are dropped Fixes #2019 * opengroup messages from blocked user are dropped Fixes #2019 * dismiss a call when answered from another of our devices * add data-testid for leftpane sections and edit profile dialog * update turn servers * cleanup sessionprotobuf * move the state of calling to its own slice * no video track by default and will be turn ON if asked to * message request refactoring. * create offer and answer ourselves and do not use the negotiation needed event. this event is causing us to loop in negotiation needed when each side try to create one, gets the answer and so on... * auto select the first audio input on connection success webrtc * add a way to choose the audioouput/mute a webrtc call * mute audio from bg when video is in fullscreen this is to avoid having two times the remote sound playing one in the bg and one in the fullscreen * Adding improvements to message request handling. * Only updating approval when it is a true value as we consider a block a decline. * Linting and formatting. * More formatting and linting * fixing merge conflicts * linting and formatting changes * darken a bit the green of sent message box in light theme * disable deduplication based serverId+sender only use the serverTimestamp+sender for searching because serverId+sender might have false positive * Fixing up block all logic. * speed up fetching closed group's members avatar * Applying PR changes. * cleanup props passing of avatar and name with a custom hook * fix a bug releasing the decrypted attachment blobs too early * Adding trigger logic for conversation filtering of requests. * Fixing rimraf transpile bug. Adding PR fixes - icon buttons. * Minor call tweaks (#2051) * show missed-call,started-call and answered call notification in chat * fix types for createLastMessageUpdate * show incoming dialog if we have a pending call when enable call receptio * simplify a bit the avatar component * move disableDrag to a custom hook * speed up hash colors of avatarPlaceHolders * fixup text selection and double click reply on message * keep avatar decoded items longer before releasing memory * add incoming/outgoing/missed call notification also, merge that notification with the timer and group notification component * hangup call if no answer after 30sec * refactor SessionInput using hook + add testid field for recovery * disable message request feature flag for now * fix merge issue * force loading screen to be black instead of white for our dark theme user's eyes safety * Fetch translations (#2056) * show missed-call,started-call and answered call notification in chat * fix types for createLastMessageUpdate * show incoming dialog if we have a pending call when enable call receptio * simplify a bit the avatar component * move disableDrag to a custom hook * speed up hash colors of avatarPlaceHolders * fixup text selection and double click reply on message * keep avatar decoded items longer before releasing memory * add incoming/outgoing/missed call notification also, merge that notification with the timer and group notification component * hangup call if no answer after 30sec * refactor SessionInput using hook + add testid field for recovery * disable message request feature flag for now * fix merge issue * force loading screen to be black instead of white for our dark theme user's eyes safety * add type for i18n to run update after crowdin fetch with tools/updateI18nKeysType.py * update to latest translations * Open group regex fixes (#2058) * Open group URL regex fixes - Capital letters in room tokens were not being accepted (it eventually gets lower-cased internally, which works fine, but that happens *after* the URL is tested for acceptability). - `-` in room was not being allowed (it is and always has been on SOGS, session-android, and session-ios). - single-letter room ids are valid, but only 2+ letter ids were being accepted. - complete URL regex wasn't anchored so something like `garbagehttps://example.com/room?public_key=<64hex>moregarbage` was being accepted in the GUI input (it fails later when other code tries to parse it as a URL). - removed `m` modifier from open group regex: without anchors it wasn't doing anything anyway, but *with* anchors it would still allow leading/trailing garbage if delineated by newlines. - public key regex was accepting g-z letters, and not accepting A-F. - various regex cleanups: - use non-capture groups (?:...) rather than capturing groups (...) - avoid repetition in host segment matching - tightened up host pattern matching a bit: - DNS host segments have a max length of 63 - Limit port max length to 5, and disallow starting with 0 * Show an error when the open group URL is invalid It's quite disconcerting when you have a bad open group URL and try to add it and the join button just "doesn't work" without any feedback at all. Fix it to show an error message. (There is already an i18n entry for this because this same message is thrown if the URL can't be parsed later on). * Add call duration (#2059) * add call duration once connected * close incoming call dialog if endCall from same sender * disable message request toggle if featureFlag is OFF * Cleanup message request (#2063) * close incoming call dialog if endCall from seame sender * disable message request toggle if featureFlag is OFF * cleanup UI of message requests * mark all existing conversations as approved in a migration * fix regex with conversationID for opengroups * Various UI fixes (#2070) * cleanup unused convo json fields in db * display a toast if the user is not approved yet on call OFFER received * enable CBR for calls * do not update active_at on configMessage if !!active_at * remove mkdirp dependency * disable call button if focused convo is blocked * quote: do not include the full body in quote, but just the first 100 * click on the edit profile qr code padding * Allow longer input for opengroup join overlay Fixes #2068 * Fix overlay feature for start new session button * make ringing depend on redux CALL status * turn ON read-receipt by default * keep read-receipts disabled by default (#2071) * refactor most of the components to outside of their Session folder (#2072) * refactor most of the components to outside of their Session folder * finish moving overlay and memberListItem to react hook * fix bug with kicked member len >2 not being displayed also sort admins first in UpdateGroupMembers dialog * fix admin leaving text of groupNotification * add a useFocusMount hook to focus input fields on mount * make click avatar convo item open only user dialog * cleanup config default.json * make sure to use convoController to build sync message * disable showing pubkey on opengroups * add a pause on audio playback Fixes #2079 * Minor styling fix for large amount of message requests (#2080) * Minor styling fix for large amount of message requests * Vertical center fix for message request banner. * removing top margin from banner again. * reactify group updates text bubble from redux store (#2083) * add crown icon for closed group admins (#2084) * disable call for now + fix left pane actions overflow (#2085) * Fix attachment dl freeze (#2086) * fix attachment download freezing app for some opengroups * make registration page work with smaller height * Unban UI (#2091) * adding basic functionaliy for unbanning a user * merge ban and unban user dialog in to one dialog Co-authored-by: warrickct <warrickct@gmail.com> * use React Provider for convoListItem (#2088) this is to avoid passing down the prop to all the components * fix closed group updates undefined on no names (#2092) Co-authored-by: Warrick Corfe-Tan <warrickct@gmail.com> Co-authored-by: Jason Rhinelander <jason@imaginary.ca> Co-authored-by: Warrick <wcor690@aucklanduni.ac.nz>
3 years ago
group_update?: MessageGroupUpdate;
groupInvitation?: any;
attachments?: any;
conversationId: string;
errors?: any;
flags?: number;
hasAttachments: boolean;
hasFileAttachments: boolean;
hasVisualMediaAttachments: boolean;
schemaVersion: number;
expirationTimerUpdate?: {
expireTimer: number;
source: string;
fromSync?: boolean;
};
/**
* 1 means unread, 0 or anything else is read.
*/
unread: number;
group?: any;
/**
* timestamp is the sent_at timestamp, which is the envelope.timestamp
*/
timestamp?: number;
status?: MessageDeliveryStatus;
Session 1.7.5 (#2094) * Added message requests disabled for now * no longer showing empty space for conversations moved from list. * Added syncing accepting of contact between running instances. * Adding blocking of individual requests and syncing of block to devices. Added approval by replying to a message. * fixed typos for translations and method name. * Blocking, accepting on click and accepting on msg send working across clients. * adding setting of active_at to hide unapproved messages. * adding feature flag for config message receiving * fix archlinux pw unused issue on archlinux, the appimage links to the system sqlite by default which does not support sqlcipher * hide activeAt = 0 convo from search results Fixes #2033 * opengroup messages from blocked user are dropped Fixes #2019 * opengroup messages from blocked user are dropped Fixes #2019 * dismiss a call when answered from another of our devices * add data-testid for leftpane sections and edit profile dialog * update turn servers * cleanup sessionprotobuf * move the state of calling to its own slice * no video track by default and will be turn ON if asked to * message request refactoring. * create offer and answer ourselves and do not use the negotiation needed event. this event is causing us to loop in negotiation needed when each side try to create one, gets the answer and so on... * auto select the first audio input on connection success webrtc * add a way to choose the audioouput/mute a webrtc call * mute audio from bg when video is in fullscreen this is to avoid having two times the remote sound playing one in the bg and one in the fullscreen * Adding improvements to message request handling. * Only updating approval when it is a true value as we consider a block a decline. * Linting and formatting. * More formatting and linting * fixing merge conflicts * linting and formatting changes * darken a bit the green of sent message box in light theme * disable deduplication based serverId+sender only use the serverTimestamp+sender for searching because serverId+sender might have false positive * Fixing up block all logic. * speed up fetching closed group's members avatar * Applying PR changes. * cleanup props passing of avatar and name with a custom hook * fix a bug releasing the decrypted attachment blobs too early * Adding trigger logic for conversation filtering of requests. * Fixing rimraf transpile bug. Adding PR fixes - icon buttons. * Minor call tweaks (#2051) * show missed-call,started-call and answered call notification in chat * fix types for createLastMessageUpdate * show incoming dialog if we have a pending call when enable call receptio * simplify a bit the avatar component * move disableDrag to a custom hook * speed up hash colors of avatarPlaceHolders * fixup text selection and double click reply on message * keep avatar decoded items longer before releasing memory * add incoming/outgoing/missed call notification also, merge that notification with the timer and group notification component * hangup call if no answer after 30sec * refactor SessionInput using hook + add testid field for recovery * disable message request feature flag for now * fix merge issue * force loading screen to be black instead of white for our dark theme user's eyes safety * Fetch translations (#2056) * show missed-call,started-call and answered call notification in chat * fix types for createLastMessageUpdate * show incoming dialog if we have a pending call when enable call receptio * simplify a bit the avatar component * move disableDrag to a custom hook * speed up hash colors of avatarPlaceHolders * fixup text selection and double click reply on message * keep avatar decoded items longer before releasing memory * add incoming/outgoing/missed call notification also, merge that notification with the timer and group notification component * hangup call if no answer after 30sec * refactor SessionInput using hook + add testid field for recovery * disable message request feature flag for now * fix merge issue * force loading screen to be black instead of white for our dark theme user's eyes safety * add type for i18n to run update after crowdin fetch with tools/updateI18nKeysType.py * update to latest translations * Open group regex fixes (#2058) * Open group URL regex fixes - Capital letters in room tokens were not being accepted (it eventually gets lower-cased internally, which works fine, but that happens *after* the URL is tested for acceptability). - `-` in room was not being allowed (it is and always has been on SOGS, session-android, and session-ios). - single-letter room ids are valid, but only 2+ letter ids were being accepted. - complete URL regex wasn't anchored so something like `garbagehttps://example.com/room?public_key=<64hex>moregarbage` was being accepted in the GUI input (it fails later when other code tries to parse it as a URL). - removed `m` modifier from open group regex: without anchors it wasn't doing anything anyway, but *with* anchors it would still allow leading/trailing garbage if delineated by newlines. - public key regex was accepting g-z letters, and not accepting A-F. - various regex cleanups: - use non-capture groups (?:...) rather than capturing groups (...) - avoid repetition in host segment matching - tightened up host pattern matching a bit: - DNS host segments have a max length of 63 - Limit port max length to 5, and disallow starting with 0 * Show an error when the open group URL is invalid It's quite disconcerting when you have a bad open group URL and try to add it and the join button just "doesn't work" without any feedback at all. Fix it to show an error message. (There is already an i18n entry for this because this same message is thrown if the URL can't be parsed later on). * Add call duration (#2059) * add call duration once connected * close incoming call dialog if endCall from same sender * disable message request toggle if featureFlag is OFF * Cleanup message request (#2063) * close incoming call dialog if endCall from seame sender * disable message request toggle if featureFlag is OFF * cleanup UI of message requests * mark all existing conversations as approved in a migration * fix regex with conversationID for opengroups * Various UI fixes (#2070) * cleanup unused convo json fields in db * display a toast if the user is not approved yet on call OFFER received * enable CBR for calls * do not update active_at on configMessage if !!active_at * remove mkdirp dependency * disable call button if focused convo is blocked * quote: do not include the full body in quote, but just the first 100 * click on the edit profile qr code padding * Allow longer input for opengroup join overlay Fixes #2068 * Fix overlay feature for start new session button * make ringing depend on redux CALL status * turn ON read-receipt by default * keep read-receipts disabled by default (#2071) * refactor most of the components to outside of their Session folder (#2072) * refactor most of the components to outside of their Session folder * finish moving overlay and memberListItem to react hook * fix bug with kicked member len >2 not being displayed also sort admins first in UpdateGroupMembers dialog * fix admin leaving text of groupNotification * add a useFocusMount hook to focus input fields on mount * make click avatar convo item open only user dialog * cleanup config default.json * make sure to use convoController to build sync message * disable showing pubkey on opengroups * add a pause on audio playback Fixes #2079 * Minor styling fix for large amount of message requests (#2080) * Minor styling fix for large amount of message requests * Vertical center fix for message request banner. * removing top margin from banner again. * reactify group updates text bubble from redux store (#2083) * add crown icon for closed group admins (#2084) * disable call for now + fix left pane actions overflow (#2085) * Fix attachment dl freeze (#2086) * fix attachment download freezing app for some opengroups * make registration page work with smaller height * Unban UI (#2091) * adding basic functionaliy for unbanning a user * merge ban and unban user dialog in to one dialog Co-authored-by: warrickct <warrickct@gmail.com> * use React Provider for convoListItem (#2088) this is to avoid passing down the prop to all the components * fix closed group updates undefined on no names (#2092) Co-authored-by: Warrick Corfe-Tan <warrickct@gmail.com> Co-authored-by: Jason Rhinelander <jason@imaginary.ca> Co-authored-by: Warrick <wcor690@aucklanduni.ac.nz>
3 years ago
// dataMessage: any;
sent_to: any;
sent: boolean;
/**
* The serverId is the id on the open group server itself.
* Each message sent to an open group gets a serverId.
* This is not the id for the server, but the id ON the server.
*
* This field is not set for a message not on an opengroup server.
*/
serverId?: number;
/**
* This is the timestamp of that messages as it was saved by the Open group server.
* We rely on this one to order Open Group messages.
* This field is not set for a message not on an opengroup server.
*/
serverTimestamp?: number;
/**
* This field is set to true if the message is for a public server.
* This is useful to make the Badge `Public` Appear on a sent message to a server, even if we did not get
* the response from the server yet that this message was successfully added.
*/
isPublic: boolean;
/**
* sentSync set to true means we just triggered the sync message for this Private Chat message.
* We did not yet get the message sent confirmation, it was just added to the Outgoing MessageQueue
*/
sentSync: boolean;
/**
* synced set to true means that this message was successfully sent by our current device to our other devices.
* It is set to true when the MessageQueue did effectively sent our sync message without errors.
*/
synced: boolean;
sync: boolean;
/**
* This field is used for search only
*/
snippet?: any;
direction: any;
/**
* This is used for when a user screenshots or saves an attachment you sent.
* We display a small message just below the message referenced
*/
dataExtractionNotification?: DataExtractionNotificationMsg;
/**
* This field is used for unsending messages and used in sending unsend message requests.
*/
messageHash?: string;
/**
* This field is used for unsending messages and used in sending unsend message requests.
*/
isDeleted?: boolean;
Session 1.7.5 (#2094) * Added message requests disabled for now * no longer showing empty space for conversations moved from list. * Added syncing accepting of contact between running instances. * Adding blocking of individual requests and syncing of block to devices. Added approval by replying to a message. * fixed typos for translations and method name. * Blocking, accepting on click and accepting on msg send working across clients. * adding setting of active_at to hide unapproved messages. * adding feature flag for config message receiving * fix archlinux pw unused issue on archlinux, the appimage links to the system sqlite by default which does not support sqlcipher * hide activeAt = 0 convo from search results Fixes #2033 * opengroup messages from blocked user are dropped Fixes #2019 * opengroup messages from blocked user are dropped Fixes #2019 * dismiss a call when answered from another of our devices * add data-testid for leftpane sections and edit profile dialog * update turn servers * cleanup sessionprotobuf * move the state of calling to its own slice * no video track by default and will be turn ON if asked to * message request refactoring. * create offer and answer ourselves and do not use the negotiation needed event. this event is causing us to loop in negotiation needed when each side try to create one, gets the answer and so on... * auto select the first audio input on connection success webrtc * add a way to choose the audioouput/mute a webrtc call * mute audio from bg when video is in fullscreen this is to avoid having two times the remote sound playing one in the bg and one in the fullscreen * Adding improvements to message request handling. * Only updating approval when it is a true value as we consider a block a decline. * Linting and formatting. * More formatting and linting * fixing merge conflicts * linting and formatting changes * darken a bit the green of sent message box in light theme * disable deduplication based serverId+sender only use the serverTimestamp+sender for searching because serverId+sender might have false positive * Fixing up block all logic. * speed up fetching closed group's members avatar * Applying PR changes. * cleanup props passing of avatar and name with a custom hook * fix a bug releasing the decrypted attachment blobs too early * Adding trigger logic for conversation filtering of requests. * Fixing rimraf transpile bug. Adding PR fixes - icon buttons. * Minor call tweaks (#2051) * show missed-call,started-call and answered call notification in chat * fix types for createLastMessageUpdate * show incoming dialog if we have a pending call when enable call receptio * simplify a bit the avatar component * move disableDrag to a custom hook * speed up hash colors of avatarPlaceHolders * fixup text selection and double click reply on message * keep avatar decoded items longer before releasing memory * add incoming/outgoing/missed call notification also, merge that notification with the timer and group notification component * hangup call if no answer after 30sec * refactor SessionInput using hook + add testid field for recovery * disable message request feature flag for now * fix merge issue * force loading screen to be black instead of white for our dark theme user's eyes safety * Fetch translations (#2056) * show missed-call,started-call and answered call notification in chat * fix types for createLastMessageUpdate * show incoming dialog if we have a pending call when enable call receptio * simplify a bit the avatar component * move disableDrag to a custom hook * speed up hash colors of avatarPlaceHolders * fixup text selection and double click reply on message * keep avatar decoded items longer before releasing memory * add incoming/outgoing/missed call notification also, merge that notification with the timer and group notification component * hangup call if no answer after 30sec * refactor SessionInput using hook + add testid field for recovery * disable message request feature flag for now * fix merge issue * force loading screen to be black instead of white for our dark theme user's eyes safety * add type for i18n to run update after crowdin fetch with tools/updateI18nKeysType.py * update to latest translations * Open group regex fixes (#2058) * Open group URL regex fixes - Capital letters in room tokens were not being accepted (it eventually gets lower-cased internally, which works fine, but that happens *after* the URL is tested for acceptability). - `-` in room was not being allowed (it is and always has been on SOGS, session-android, and session-ios). - single-letter room ids are valid, but only 2+ letter ids were being accepted. - complete URL regex wasn't anchored so something like `garbagehttps://example.com/room?public_key=<64hex>moregarbage` was being accepted in the GUI input (it fails later when other code tries to parse it as a URL). - removed `m` modifier from open group regex: without anchors it wasn't doing anything anyway, but *with* anchors it would still allow leading/trailing garbage if delineated by newlines. - public key regex was accepting g-z letters, and not accepting A-F. - various regex cleanups: - use non-capture groups (?:...) rather than capturing groups (...) - avoid repetition in host segment matching - tightened up host pattern matching a bit: - DNS host segments have a max length of 63 - Limit port max length to 5, and disallow starting with 0 * Show an error when the open group URL is invalid It's quite disconcerting when you have a bad open group URL and try to add it and the join button just "doesn't work" without any feedback at all. Fix it to show an error message. (There is already an i18n entry for this because this same message is thrown if the URL can't be parsed later on). * Add call duration (#2059) * add call duration once connected * close incoming call dialog if endCall from same sender * disable message request toggle if featureFlag is OFF * Cleanup message request (#2063) * close incoming call dialog if endCall from seame sender * disable message request toggle if featureFlag is OFF * cleanup UI of message requests * mark all existing conversations as approved in a migration * fix regex with conversationID for opengroups * Various UI fixes (#2070) * cleanup unused convo json fields in db * display a toast if the user is not approved yet on call OFFER received * enable CBR for calls * do not update active_at on configMessage if !!active_at * remove mkdirp dependency * disable call button if focused convo is blocked * quote: do not include the full body in quote, but just the first 100 * click on the edit profile qr code padding * Allow longer input for opengroup join overlay Fixes #2068 * Fix overlay feature for start new session button * make ringing depend on redux CALL status * turn ON read-receipt by default * keep read-receipts disabled by default (#2071) * refactor most of the components to outside of their Session folder (#2072) * refactor most of the components to outside of their Session folder * finish moving overlay and memberListItem to react hook * fix bug with kicked member len >2 not being displayed also sort admins first in UpdateGroupMembers dialog * fix admin leaving text of groupNotification * add a useFocusMount hook to focus input fields on mount * make click avatar convo item open only user dialog * cleanup config default.json * make sure to use convoController to build sync message * disable showing pubkey on opengroups * add a pause on audio playback Fixes #2079 * Minor styling fix for large amount of message requests (#2080) * Minor styling fix for large amount of message requests * Vertical center fix for message request banner. * removing top margin from banner again. * reactify group updates text bubble from redux store (#2083) * add crown icon for closed group admins (#2084) * disable call for now + fix left pane actions overflow (#2085) * Fix attachment dl freeze (#2086) * fix attachment download freezing app for some opengroups * make registration page work with smaller height * Unban UI (#2091) * adding basic functionaliy for unbanning a user * merge ban and unban user dialog in to one dialog Co-authored-by: warrickct <warrickct@gmail.com> * use React Provider for convoListItem (#2088) this is to avoid passing down the prop to all the components * fix closed group updates undefined on no names (#2092) Co-authored-by: Warrick Corfe-Tan <warrickct@gmail.com> Co-authored-by: Jason Rhinelander <jason@imaginary.ca> Co-authored-by: Warrick <wcor690@aucklanduni.ac.nz>
3 years ago
callNotificationType?: CallNotificationType;
}
export interface DataExtractionNotificationMsg {
type: number; // screenshot or saving event, based on SignalService.DataExtractionNotification.Type
source: string; // the guy who made a screenshot
referencedAttachmentTimestamp: number; // the attachment timestamp he screenshot
}
export type PropsForDataExtractionNotification = DataExtractionNotificationMsg & {
name: string;
messageId: string;
receivedAt?: number;
isUnread: boolean;
};
Session 1.7.5 (#2094) * Added message requests disabled for now * no longer showing empty space for conversations moved from list. * Added syncing accepting of contact between running instances. * Adding blocking of individual requests and syncing of block to devices. Added approval by replying to a message. * fixed typos for translations and method name. * Blocking, accepting on click and accepting on msg send working across clients. * adding setting of active_at to hide unapproved messages. * adding feature flag for config message receiving * fix archlinux pw unused issue on archlinux, the appimage links to the system sqlite by default which does not support sqlcipher * hide activeAt = 0 convo from search results Fixes #2033 * opengroup messages from blocked user are dropped Fixes #2019 * opengroup messages from blocked user are dropped Fixes #2019 * dismiss a call when answered from another of our devices * add data-testid for leftpane sections and edit profile dialog * update turn servers * cleanup sessionprotobuf * move the state of calling to its own slice * no video track by default and will be turn ON if asked to * message request refactoring. * create offer and answer ourselves and do not use the negotiation needed event. this event is causing us to loop in negotiation needed when each side try to create one, gets the answer and so on... * auto select the first audio input on connection success webrtc * add a way to choose the audioouput/mute a webrtc call * mute audio from bg when video is in fullscreen this is to avoid having two times the remote sound playing one in the bg and one in the fullscreen * Adding improvements to message request handling. * Only updating approval when it is a true value as we consider a block a decline. * Linting and formatting. * More formatting and linting * fixing merge conflicts * linting and formatting changes * darken a bit the green of sent message box in light theme * disable deduplication based serverId+sender only use the serverTimestamp+sender for searching because serverId+sender might have false positive * Fixing up block all logic. * speed up fetching closed group's members avatar * Applying PR changes. * cleanup props passing of avatar and name with a custom hook * fix a bug releasing the decrypted attachment blobs too early * Adding trigger logic for conversation filtering of requests. * Fixing rimraf transpile bug. Adding PR fixes - icon buttons. * Minor call tweaks (#2051) * show missed-call,started-call and answered call notification in chat * fix types for createLastMessageUpdate * show incoming dialog if we have a pending call when enable call receptio * simplify a bit the avatar component * move disableDrag to a custom hook * speed up hash colors of avatarPlaceHolders * fixup text selection and double click reply on message * keep avatar decoded items longer before releasing memory * add incoming/outgoing/missed call notification also, merge that notification with the timer and group notification component * hangup call if no answer after 30sec * refactor SessionInput using hook + add testid field for recovery * disable message request feature flag for now * fix merge issue * force loading screen to be black instead of white for our dark theme user's eyes safety * Fetch translations (#2056) * show missed-call,started-call and answered call notification in chat * fix types for createLastMessageUpdate * show incoming dialog if we have a pending call when enable call receptio * simplify a bit the avatar component * move disableDrag to a custom hook * speed up hash colors of avatarPlaceHolders * fixup text selection and double click reply on message * keep avatar decoded items longer before releasing memory * add incoming/outgoing/missed call notification also, merge that notification with the timer and group notification component * hangup call if no answer after 30sec * refactor SessionInput using hook + add testid field for recovery * disable message request feature flag for now * fix merge issue * force loading screen to be black instead of white for our dark theme user's eyes safety * add type for i18n to run update after crowdin fetch with tools/updateI18nKeysType.py * update to latest translations * Open group regex fixes (#2058) * Open group URL regex fixes - Capital letters in room tokens were not being accepted (it eventually gets lower-cased internally, which works fine, but that happens *after* the URL is tested for acceptability). - `-` in room was not being allowed (it is and always has been on SOGS, session-android, and session-ios). - single-letter room ids are valid, but only 2+ letter ids were being accepted. - complete URL regex wasn't anchored so something like `garbagehttps://example.com/room?public_key=<64hex>moregarbage` was being accepted in the GUI input (it fails later when other code tries to parse it as a URL). - removed `m` modifier from open group regex: without anchors it wasn't doing anything anyway, but *with* anchors it would still allow leading/trailing garbage if delineated by newlines. - public key regex was accepting g-z letters, and not accepting A-F. - various regex cleanups: - use non-capture groups (?:...) rather than capturing groups (...) - avoid repetition in host segment matching - tightened up host pattern matching a bit: - DNS host segments have a max length of 63 - Limit port max length to 5, and disallow starting with 0 * Show an error when the open group URL is invalid It's quite disconcerting when you have a bad open group URL and try to add it and the join button just "doesn't work" without any feedback at all. Fix it to show an error message. (There is already an i18n entry for this because this same message is thrown if the URL can't be parsed later on). * Add call duration (#2059) * add call duration once connected * close incoming call dialog if endCall from same sender * disable message request toggle if featureFlag is OFF * Cleanup message request (#2063) * close incoming call dialog if endCall from seame sender * disable message request toggle if featureFlag is OFF * cleanup UI of message requests * mark all existing conversations as approved in a migration * fix regex with conversationID for opengroups * Various UI fixes (#2070) * cleanup unused convo json fields in db * display a toast if the user is not approved yet on call OFFER received * enable CBR for calls * do not update active_at on configMessage if !!active_at * remove mkdirp dependency * disable call button if focused convo is blocked * quote: do not include the full body in quote, but just the first 100 * click on the edit profile qr code padding * Allow longer input for opengroup join overlay Fixes #2068 * Fix overlay feature for start new session button * make ringing depend on redux CALL status * turn ON read-receipt by default * keep read-receipts disabled by default (#2071) * refactor most of the components to outside of their Session folder (#2072) * refactor most of the components to outside of their Session folder * finish moving overlay and memberListItem to react hook * fix bug with kicked member len >2 not being displayed also sort admins first in UpdateGroupMembers dialog * fix admin leaving text of groupNotification * add a useFocusMount hook to focus input fields on mount * make click avatar convo item open only user dialog * cleanup config default.json * make sure to use convoController to build sync message * disable showing pubkey on opengroups * add a pause on audio playback Fixes #2079 * Minor styling fix for large amount of message requests (#2080) * Minor styling fix for large amount of message requests * Vertical center fix for message request banner. * removing top margin from banner again. * reactify group updates text bubble from redux store (#2083) * add crown icon for closed group admins (#2084) * disable call for now + fix left pane actions overflow (#2085) * Fix attachment dl freeze (#2086) * fix attachment download freezing app for some opengroups * make registration page work with smaller height * Unban UI (#2091) * adding basic functionaliy for unbanning a user * merge ban and unban user dialog in to one dialog Co-authored-by: warrickct <warrickct@gmail.com> * use React Provider for convoListItem (#2088) this is to avoid passing down the prop to all the components * fix closed group updates undefined on no names (#2092) Co-authored-by: Warrick Corfe-Tan <warrickct@gmail.com> Co-authored-by: Jason Rhinelander <jason@imaginary.ca> Co-authored-by: Warrick <wcor690@aucklanduni.ac.nz>
3 years ago
export type MessageGroupUpdate = {
left?: Array<string>;
joined?: Array<string>;
kicked?: Array<string>;
name?: string;
};
export interface MessageAttributesOptionals {
id?: string;
source: string;
quote?: any;
expireTimer?: number;
received_at?: number;
sent_at?: number;
destination?: string;
preview?: any;
body?: string;
expirationStartTimestamp?: number;
read_by?: Array<string>;
decrypted_at?: number;
expires_at?: number;
recipients?: Array<string>;
type: MessageModelType;
Session 1.7.5 (#2094) * Added message requests disabled for now * no longer showing empty space for conversations moved from list. * Added syncing accepting of contact between running instances. * Adding blocking of individual requests and syncing of block to devices. Added approval by replying to a message. * fixed typos for translations and method name. * Blocking, accepting on click and accepting on msg send working across clients. * adding setting of active_at to hide unapproved messages. * adding feature flag for config message receiving * fix archlinux pw unused issue on archlinux, the appimage links to the system sqlite by default which does not support sqlcipher * hide activeAt = 0 convo from search results Fixes #2033 * opengroup messages from blocked user are dropped Fixes #2019 * opengroup messages from blocked user are dropped Fixes #2019 * dismiss a call when answered from another of our devices * add data-testid for leftpane sections and edit profile dialog * update turn servers * cleanup sessionprotobuf * move the state of calling to its own slice * no video track by default and will be turn ON if asked to * message request refactoring. * create offer and answer ourselves and do not use the negotiation needed event. this event is causing us to loop in negotiation needed when each side try to create one, gets the answer and so on... * auto select the first audio input on connection success webrtc * add a way to choose the audioouput/mute a webrtc call * mute audio from bg when video is in fullscreen this is to avoid having two times the remote sound playing one in the bg and one in the fullscreen * Adding improvements to message request handling. * Only updating approval when it is a true value as we consider a block a decline. * Linting and formatting. * More formatting and linting * fixing merge conflicts * linting and formatting changes * darken a bit the green of sent message box in light theme * disable deduplication based serverId+sender only use the serverTimestamp+sender for searching because serverId+sender might have false positive * Fixing up block all logic. * speed up fetching closed group's members avatar * Applying PR changes. * cleanup props passing of avatar and name with a custom hook * fix a bug releasing the decrypted attachment blobs too early * Adding trigger logic for conversation filtering of requests. * Fixing rimraf transpile bug. Adding PR fixes - icon buttons. * Minor call tweaks (#2051) * show missed-call,started-call and answered call notification in chat * fix types for createLastMessageUpdate * show incoming dialog if we have a pending call when enable call receptio * simplify a bit the avatar component * move disableDrag to a custom hook * speed up hash colors of avatarPlaceHolders * fixup text selection and double click reply on message * keep avatar decoded items longer before releasing memory * add incoming/outgoing/missed call notification also, merge that notification with the timer and group notification component * hangup call if no answer after 30sec * refactor SessionInput using hook + add testid field for recovery * disable message request feature flag for now * fix merge issue * force loading screen to be black instead of white for our dark theme user's eyes safety * Fetch translations (#2056) * show missed-call,started-call and answered call notification in chat * fix types for createLastMessageUpdate * show incoming dialog if we have a pending call when enable call receptio * simplify a bit the avatar component * move disableDrag to a custom hook * speed up hash colors of avatarPlaceHolders * fixup text selection and double click reply on message * keep avatar decoded items longer before releasing memory * add incoming/outgoing/missed call notification also, merge that notification with the timer and group notification component * hangup call if no answer after 30sec * refactor SessionInput using hook + add testid field for recovery * disable message request feature flag for now * fix merge issue * force loading screen to be black instead of white for our dark theme user's eyes safety * add type for i18n to run update after crowdin fetch with tools/updateI18nKeysType.py * update to latest translations * Open group regex fixes (#2058) * Open group URL regex fixes - Capital letters in room tokens were not being accepted (it eventually gets lower-cased internally, which works fine, but that happens *after* the URL is tested for acceptability). - `-` in room was not being allowed (it is and always has been on SOGS, session-android, and session-ios). - single-letter room ids are valid, but only 2+ letter ids were being accepted. - complete URL regex wasn't anchored so something like `garbagehttps://example.com/room?public_key=<64hex>moregarbage` was being accepted in the GUI input (it fails later when other code tries to parse it as a URL). - removed `m` modifier from open group regex: without anchors it wasn't doing anything anyway, but *with* anchors it would still allow leading/trailing garbage if delineated by newlines. - public key regex was accepting g-z letters, and not accepting A-F. - various regex cleanups: - use non-capture groups (?:...) rather than capturing groups (...) - avoid repetition in host segment matching - tightened up host pattern matching a bit: - DNS host segments have a max length of 63 - Limit port max length to 5, and disallow starting with 0 * Show an error when the open group URL is invalid It's quite disconcerting when you have a bad open group URL and try to add it and the join button just "doesn't work" without any feedback at all. Fix it to show an error message. (There is already an i18n entry for this because this same message is thrown if the URL can't be parsed later on). * Add call duration (#2059) * add call duration once connected * close incoming call dialog if endCall from same sender * disable message request toggle if featureFlag is OFF * Cleanup message request (#2063) * close incoming call dialog if endCall from seame sender * disable message request toggle if featureFlag is OFF * cleanup UI of message requests * mark all existing conversations as approved in a migration * fix regex with conversationID for opengroups * Various UI fixes (#2070) * cleanup unused convo json fields in db * display a toast if the user is not approved yet on call OFFER received * enable CBR for calls * do not update active_at on configMessage if !!active_at * remove mkdirp dependency * disable call button if focused convo is blocked * quote: do not include the full body in quote, but just the first 100 * click on the edit profile qr code padding * Allow longer input for opengroup join overlay Fixes #2068 * Fix overlay feature for start new session button * make ringing depend on redux CALL status * turn ON read-receipt by default * keep read-receipts disabled by default (#2071) * refactor most of the components to outside of their Session folder (#2072) * refactor most of the components to outside of their Session folder * finish moving overlay and memberListItem to react hook * fix bug with kicked member len >2 not being displayed also sort admins first in UpdateGroupMembers dialog * fix admin leaving text of groupNotification * add a useFocusMount hook to focus input fields on mount * make click avatar convo item open only user dialog * cleanup config default.json * make sure to use convoController to build sync message * disable showing pubkey on opengroups * add a pause on audio playback Fixes #2079 * Minor styling fix for large amount of message requests (#2080) * Minor styling fix for large amount of message requests * Vertical center fix for message request banner. * removing top margin from banner again. * reactify group updates text bubble from redux store (#2083) * add crown icon for closed group admins (#2084) * disable call for now + fix left pane actions overflow (#2085) * Fix attachment dl freeze (#2086) * fix attachment download freezing app for some opengroups * make registration page work with smaller height * Unban UI (#2091) * adding basic functionaliy for unbanning a user * merge ban and unban user dialog in to one dialog Co-authored-by: warrickct <warrickct@gmail.com> * use React Provider for convoListItem (#2088) this is to avoid passing down the prop to all the components * fix closed group updates undefined on no names (#2092) Co-authored-by: Warrick Corfe-Tan <warrickct@gmail.com> Co-authored-by: Jason Rhinelander <jason@imaginary.ca> Co-authored-by: Warrick <wcor690@aucklanduni.ac.nz>
3 years ago
group_update?: MessageGroupUpdate;
groupInvitation?: any;
attachments?: any;
contact?: any;
conversationId: string;
errors?: any;
flags?: number;
hasAttachments?: boolean;
hasFileAttachments?: boolean;
hasVisualMediaAttachments?: boolean;
schemaVersion?: number;
expirationTimerUpdate?: {
expireTimer: number;
source: string;
fromSync?: boolean;
};
dataExtractionNotification?: {
type: number;
source: string;
referencedAttachmentTimestamp: number;
};
unread?: number;
group?: any;
timestamp?: number;
status?: MessageDeliveryStatus;
dataMessage?: any;
sent_to?: Array<string>;
sent?: boolean;
serverId?: number;
serverTimestamp?: number;
isPublic?: boolean;
sentSync?: boolean;
synced?: boolean;
sync?: boolean;
snippet?: any;
direction?: any;
messageHash?: string;
isDeleted?: boolean;
Session 1.7.5 (#2094) * Added message requests disabled for now * no longer showing empty space for conversations moved from list. * Added syncing accepting of contact between running instances. * Adding blocking of individual requests and syncing of block to devices. Added approval by replying to a message. * fixed typos for translations and method name. * Blocking, accepting on click and accepting on msg send working across clients. * adding setting of active_at to hide unapproved messages. * adding feature flag for config message receiving * fix archlinux pw unused issue on archlinux, the appimage links to the system sqlite by default which does not support sqlcipher * hide activeAt = 0 convo from search results Fixes #2033 * opengroup messages from blocked user are dropped Fixes #2019 * opengroup messages from blocked user are dropped Fixes #2019 * dismiss a call when answered from another of our devices * add data-testid for leftpane sections and edit profile dialog * update turn servers * cleanup sessionprotobuf * move the state of calling to its own slice * no video track by default and will be turn ON if asked to * message request refactoring. * create offer and answer ourselves and do not use the negotiation needed event. this event is causing us to loop in negotiation needed when each side try to create one, gets the answer and so on... * auto select the first audio input on connection success webrtc * add a way to choose the audioouput/mute a webrtc call * mute audio from bg when video is in fullscreen this is to avoid having two times the remote sound playing one in the bg and one in the fullscreen * Adding improvements to message request handling. * Only updating approval when it is a true value as we consider a block a decline. * Linting and formatting. * More formatting and linting * fixing merge conflicts * linting and formatting changes * darken a bit the green of sent message box in light theme * disable deduplication based serverId+sender only use the serverTimestamp+sender for searching because serverId+sender might have false positive * Fixing up block all logic. * speed up fetching closed group's members avatar * Applying PR changes. * cleanup props passing of avatar and name with a custom hook * fix a bug releasing the decrypted attachment blobs too early * Adding trigger logic for conversation filtering of requests. * Fixing rimraf transpile bug. Adding PR fixes - icon buttons. * Minor call tweaks (#2051) * show missed-call,started-call and answered call notification in chat * fix types for createLastMessageUpdate * show incoming dialog if we have a pending call when enable call receptio * simplify a bit the avatar component * move disableDrag to a custom hook * speed up hash colors of avatarPlaceHolders * fixup text selection and double click reply on message * keep avatar decoded items longer before releasing memory * add incoming/outgoing/missed call notification also, merge that notification with the timer and group notification component * hangup call if no answer after 30sec * refactor SessionInput using hook + add testid field for recovery * disable message request feature flag for now * fix merge issue * force loading screen to be black instead of white for our dark theme user's eyes safety * Fetch translations (#2056) * show missed-call,started-call and answered call notification in chat * fix types for createLastMessageUpdate * show incoming dialog if we have a pending call when enable call receptio * simplify a bit the avatar component * move disableDrag to a custom hook * speed up hash colors of avatarPlaceHolders * fixup text selection and double click reply on message * keep avatar decoded items longer before releasing memory * add incoming/outgoing/missed call notification also, merge that notification with the timer and group notification component * hangup call if no answer after 30sec * refactor SessionInput using hook + add testid field for recovery * disable message request feature flag for now * fix merge issue * force loading screen to be black instead of white for our dark theme user's eyes safety * add type for i18n to run update after crowdin fetch with tools/updateI18nKeysType.py * update to latest translations * Open group regex fixes (#2058) * Open group URL regex fixes - Capital letters in room tokens were not being accepted (it eventually gets lower-cased internally, which works fine, but that happens *after* the URL is tested for acceptability). - `-` in room was not being allowed (it is and always has been on SOGS, session-android, and session-ios). - single-letter room ids are valid, but only 2+ letter ids were being accepted. - complete URL regex wasn't anchored so something like `garbagehttps://example.com/room?public_key=<64hex>moregarbage` was being accepted in the GUI input (it fails later when other code tries to parse it as a URL). - removed `m` modifier from open group regex: without anchors it wasn't doing anything anyway, but *with* anchors it would still allow leading/trailing garbage if delineated by newlines. - public key regex was accepting g-z letters, and not accepting A-F. - various regex cleanups: - use non-capture groups (?:...) rather than capturing groups (...) - avoid repetition in host segment matching - tightened up host pattern matching a bit: - DNS host segments have a max length of 63 - Limit port max length to 5, and disallow starting with 0 * Show an error when the open group URL is invalid It's quite disconcerting when you have a bad open group URL and try to add it and the join button just "doesn't work" without any feedback at all. Fix it to show an error message. (There is already an i18n entry for this because this same message is thrown if the URL can't be parsed later on). * Add call duration (#2059) * add call duration once connected * close incoming call dialog if endCall from same sender * disable message request toggle if featureFlag is OFF * Cleanup message request (#2063) * close incoming call dialog if endCall from seame sender * disable message request toggle if featureFlag is OFF * cleanup UI of message requests * mark all existing conversations as approved in a migration * fix regex with conversationID for opengroups * Various UI fixes (#2070) * cleanup unused convo json fields in db * display a toast if the user is not approved yet on call OFFER received * enable CBR for calls * do not update active_at on configMessage if !!active_at * remove mkdirp dependency * disable call button if focused convo is blocked * quote: do not include the full body in quote, but just the first 100 * click on the edit profile qr code padding * Allow longer input for opengroup join overlay Fixes #2068 * Fix overlay feature for start new session button * make ringing depend on redux CALL status * turn ON read-receipt by default * keep read-receipts disabled by default (#2071) * refactor most of the components to outside of their Session folder (#2072) * refactor most of the components to outside of their Session folder * finish moving overlay and memberListItem to react hook * fix bug with kicked member len >2 not being displayed also sort admins first in UpdateGroupMembers dialog * fix admin leaving text of groupNotification * add a useFocusMount hook to focus input fields on mount * make click avatar convo item open only user dialog * cleanup config default.json * make sure to use convoController to build sync message * disable showing pubkey on opengroups * add a pause on audio playback Fixes #2079 * Minor styling fix for large amount of message requests (#2080) * Minor styling fix for large amount of message requests * Vertical center fix for message request banner. * removing top margin from banner again. * reactify group updates text bubble from redux store (#2083) * add crown icon for closed group admins (#2084) * disable call for now + fix left pane actions overflow (#2085) * Fix attachment dl freeze (#2086) * fix attachment download freezing app for some opengroups * make registration page work with smaller height * Unban UI (#2091) * adding basic functionaliy for unbanning a user * merge ban and unban user dialog in to one dialog Co-authored-by: warrickct <warrickct@gmail.com> * use React Provider for convoListItem (#2088) this is to avoid passing down the prop to all the components * fix closed group updates undefined on no names (#2092) Co-authored-by: Warrick Corfe-Tan <warrickct@gmail.com> Co-authored-by: Jason Rhinelander <jason@imaginary.ca> Co-authored-by: Warrick <wcor690@aucklanduni.ac.nz>
3 years ago
callNotificationType?: CallNotificationType;
}
/**
* This function mutates optAttributes
* @param optAttributes the entry object attributes to set the defaults to.
*/
export const fillMessageAttributesWithDefaults = (
optAttributes: MessageAttributesOptionals
): MessageAttributes => {
const defaulted = _.defaults(optAttributes, {
expireTimer: 0, // disabled
id: uuidv4(),
4 years ago
schemaVersion: window.Signal.Types.Message.CURRENT_SCHEMA_VERSION,
unread: 0, // if nothing is set, this message is considered read
});
// this is just to cleanup a bit the db. delivered and delivered_to were removed, so everytime we load a message
// we make sure to clean those fields in the json.
// the next commit() will write that to the disk
if (defaulted.delivered) {
delete defaulted.delivered;
}
if (defaulted.delivered_to) {
delete defaulted.delivered_to;
}
return defaulted;
};
export type QuoteClickOptions = {
quoteAuthor: string;
quoteId: number;
referencedMessageNotFound: boolean;
};
/**
* Those props are the one generated from a single Message improved by the one by the app itself.
* Some of the one added comes from the MessageList, some from redux, etc..
*/
export type MessageRenderingProps = PropsForMessageWithConvoProps & {
disableMenu?: boolean;
/** Note: this should be formatted for display */
attachments?: Array<AttachmentTypeWithPath>; // vs Array<PropsForAttachment>;
// whether or not to allow selecting the message
multiSelectMode: boolean;
firstMessageOfSeries: boolean;
lastMessageOfSeries: boolean;
onQuoteClick?: (options: QuoteClickOptions) => Promise<void>;
};