Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot]
b5565f628f
Bump url-parse from 1.4.7 to 1.5.1
Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.4.7 to 1.5.1.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](https://github.com/unshiftio/url-parse/compare/1.4.7...1.5.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-09 18:46:58 +00:00
8 changed files with 44 additions and 55 deletions

View File

@ -23,7 +23,6 @@ Built on:
exitMessage: 'The chat is closed. You may close this window.', exitMessage: 'The chat is closed. You may close this window.',
chatUnavailableMessage: 'The chat service is not available right now. Please try again later.', chatUnavailableMessage: 'The chat service is not available right now. Please try again later.',
anonymousDisplayName: 'Anonymous', anonymousDisplayName: 'Anonymous',
enableEncryption: 'yes',
} }
EmbeddableChatbox.mount(config); EmbeddableChatbox.mount(config);
@ -42,7 +41,6 @@ Options:
| `exitMessage` (optional) | Text to show if the user rejects the Terms of Use. | `The chat is closed. You may close this window.` | | `exitMessage` (optional) | Text to show if the user rejects the Terms of Use. | `The chat is closed. You may close this window.` |
| `anonymousDisplayName` (optional) | The display name for the chat user. | `Anonymous` | | `anonymousDisplayName` (optional) | The display name for the chat user. | `Anonymous` |
| `chatUnavailableMessage` (optional) | Text to show if no-one is available to respond | `The chat service is not available right now. Please try again later.` | | `chatUnavailableMessage` (optional) | Text to show if no-one is available to respond | `The chat service is not available right now. Please try again later.` |
| `enableEncryption` (optional) | if set to "yes" then the chat will be encrypted by default | `yes` |
## Feature list ## Feature list
@ -82,7 +80,7 @@ You can try this out on the [live demo](https://nomadic-labs.github.io/safesuppo
Clone the project: Clone the project:
``` ```
git clone https://git.umycode.com/dave/safesupport-chatbox.git git clone https://github.com/nomadic-labs/safesupport-chatbox.git
``` ```
Install the dependencies: Install the dependencies:
``` ```

12
dist/bookmarklet.js vendored

File diff suppressed because one or more lines are too long

12
dist/chatbox.js vendored

File diff suppressed because one or more lines are too long

1
dist/index.html vendored
View File

@ -23,7 +23,6 @@
exitMessage: 'The chat is closed. You may close this window.', exitMessage: 'The chat is closed. You may close this window.',
chatUnavailableMessage: 'The chat service is not available right now. Please try again later.', chatUnavailableMessage: 'The chat service is not available right now. Please try again later.',
anonymousDisplayName: 'Anonymous', anonymousDisplayName: 'Anonymous',
enableEncryption: 'no',
} }
EmbeddableChatbox.mount(config); EmbeddableChatbox.mount(config);

View File

@ -23,7 +23,6 @@
exitMessage: 'The chat is closed. You may close this window.', exitMessage: 'The chat is closed. You may close this window.',
chatUnavailableMessage: 'The chat service is not available right now. Please try again later.', chatUnavailableMessage: 'The chat service is not available right now. Please try again later.',
anonymousDisplayName: 'Anonymous', anonymousDisplayName: 'Anonymous',
enableEncryption: 'no',
} }
EmbeddableChatbox.mount(config); EmbeddableChatbox.mount(config);

View File

@ -38,7 +38,6 @@ const DEFAULT_EXIT_MESSAGE = "The chat is closed. You may close this window."
const DEFAULT_ANONYMOUS_DISPLAY_NAME="Anonymous" const DEFAULT_ANONYMOUS_DISPLAY_NAME="Anonymous"
const DEFAULT_CHAT_UNAVAILABLE_MESSAGE = "The chat service is not available right now. Please try again later." const DEFAULT_CHAT_UNAVAILABLE_MESSAGE = "The chat service is not available right now. Please try again later."
const DEFAULT_WAIT_MESSAGE = "Please be patient, our online facilitators are currently responding to other support requests." const DEFAULT_WAIT_MESSAGE = "Please be patient, our online facilitators are currently responding to other support requests."
const DEFAULT_ENCRYPTION = "yes"
class ChatBox extends React.Component { class ChatBox extends React.Component {
@ -230,15 +229,11 @@ class ChatBox extends React.Component {
client.setDisplayName(this.props.anonymousDisplayName) client.setDisplayName(this.props.anonymousDisplayName)
this.setMatrixListeners(client) this.setMatrixListeners(client)
if(this.props.enableEncryption == "yes"){
try { try {
await client.initCrypto() await client.initCrypto()
} catch(err) { } catch(err) {
return this.initializeUnencryptedChat() return this.initializeUnencryptedChat()
} }
}else{
return this.initializeUnencryptedChat()
}
await client.startClient() await client.startClient()
await this.createRoom(client) await this.createRoom(client)
@ -262,9 +257,7 @@ class ChatBox extends React.Component {
isCryptoEnabled: false, isCryptoEnabled: false,
}) })
if(this.props.enableEncryption == "yes"){
this.displayBotMessage({ body: RESTARTING_UNENCRYPTED_CHAT_MESSAGE }) this.displayBotMessage({ body: RESTARTING_UNENCRYPTED_CHAT_MESSAGE })
}
let opts = { let opts = {
baseUrl: this.props.matrixServerUrl, baseUrl: this.props.matrixServerUrl,
@ -284,9 +277,7 @@ class ChatBox extends React.Component {
client.setDisplayName(this.props.anonymousDisplayName) client.setDisplayName(this.props.anonymousDisplayName)
await this.createRoom(client) await this.createRoom(client)
await client.startClient() await client.startClient()
if(this.props.enableEncryption == "yes"){
this.displayBotMessage({ body: UNENCRYPTION_NOTICE }) this.displayBotMessage({ body: UNENCRYPTION_NOTICE })
}
} catch(err) { } catch(err) {
console.log("error", err) console.log("error", err)
this.handleInitError(err) this.handleInitError(err)
@ -724,7 +715,6 @@ ChatBox.propTypes = {
chatUnavailableMessage: PropTypes.string, chatUnavailableMessage: PropTypes.string,
anonymousDisplayName: PropTypes.string, anonymousDisplayName: PropTypes.string,
waitMessage: PropTypes.string, waitMessage: PropTypes.string,
enableEncryption: PropTypes.string,
} }
ChatBox.defaultProps = { ChatBox.defaultProps = {
@ -739,7 +729,6 @@ ChatBox.defaultProps = {
anonymousDisplayName: DEFAULT_ANONYMOUS_DISPLAY_NAME, anonymousDisplayName: DEFAULT_ANONYMOUS_DISPLAY_NAME,
chatUnavailableMessage: DEFAULT_CHAT_UNAVAILABLE_MESSAGE, chatUnavailableMessage: DEFAULT_CHAT_UNAVAILABLE_MESSAGE,
waitMessage: DEFAULT_WAIT_MESSAGE, waitMessage: DEFAULT_WAIT_MESSAGE,
enableEncryption: DEFAULT_ENCRYPTION,
} }
export default ChatBox; export default ChatBox;

View File

@ -5,14 +5,13 @@ const config = {
botId: '@help-bot:safesupport.chat', botId: '@help-bot:safesupport.chat',
roomName: 'Support Chat', roomName: 'Support Chat',
termsUrl: 'https://tosdr.org/', termsUrl: 'https://tosdr.org/',
introMessage: 'This chat application does not collect any of your personal data or any data from your use of this service.', introMessage: "This chat application does not collect any of your personal data or any data from your use of this service.",
agreementMessage: 'Do you want to continue?', agreementMessage: 'Do you want to continue?',
confirmationMessage: 'Waiting for a facilitator to join the chat...', confirmationMessage: 'Waiting for a facilitator to join the chat...',
exitMessage: 'The chat is closed. You may close this window.', exitMessage: 'The chat is closed. You may close this window.',
chatUnavailableMessage: 'The chat service is not available right now. Please try again later.', chatUnavailableMessage: 'The chat service is not available right now. Please try again later.',
anonymousDisplayName: 'Anonymous', anonymousDisplayName: 'Anonymous',
enableEncryption: 'no', }
};
export default function bookmarklet() { export default function bookmarklet() {
if (window.EmbeddableChatbox) { if (window.EmbeddableChatbox) {

View File

@ -2763,10 +2763,15 @@ camelcase@^5.0.0, camelcase@^5.3.1:
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320"
integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==
caniuse-lite@^1.0.30001023, caniuse-lite@^1.0.30001036, caniuse-lite@^1.0.30001038: caniuse-lite@^1.0.30001023:
version "1.0.30001251" version "1.0.30001023"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001251.tgz" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001023.tgz#b82155827f3f5009077bdd2df3d8968bcbcc6fc4"
integrity sha512-HOe1r+9VkU4TFmnU70z+r7OLmtR+/chB1rdcJUeQlAinjEeb0cKL20tlAtOagNZhbrtLnCvV19B4FmF1rgzl6A== integrity sha512-C5TDMiYG11EOhVOA62W1p3UsJ2z4DsHtMBQtjzp3ZsUglcQn62WOUgW0y795c7A5uZ+GCEIvzkMatLIlAsbNTA==
caniuse-lite@^1.0.30001036, caniuse-lite@^1.0.30001038:
version "1.0.30001038"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001038.tgz#44da3cbca2ab6cb6aa83d1be5d324e17f141caff"
integrity sha512-zii9quPo96XfOiRD4TrfYGs+QsGZpb2cGiMAzPjtf/hpFgB6zCPZgJb7I1+EATeMw/o+lG8FyRAnI+CWStHcaQ==
capture-exit@^2.0.0: capture-exit@^2.0.0:
version "2.0.0" version "2.0.0"
@ -8182,9 +8187,9 @@ querystring@0.2.0:
integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA= integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=
querystringify@^2.1.1: querystringify@^2.1.1:
version "2.1.1" version "2.2.0"
resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.1.1.tgz#60e5a5fd64a7f8bfa4d2ab2ed6fdf4c85bad154e" resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6"
integrity sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA== integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==
raf@^3.4.1: raf@^3.4.1:
version "3.4.1" version "3.4.1"
@ -9912,9 +9917,9 @@ urix@^0.1.0:
integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=
url-parse@^1.4.3: url-parse@^1.4.3:
version "1.4.7" version "1.5.1"
resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.4.7.tgz#a8a83535e8c00a316e403a5db4ac1b9b853ae278" resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.1.tgz#d5fa9890af8a5e1f274a2c98376510f6425f6e3b"
integrity sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg== integrity sha512-HOfCOUJt7iSYzEx/UqgtwKRMC6EU91NFhsCHMv9oM03VJcVo2Qrp8T8kI9D7amFf1cu+/3CEhgb3rF9zL7k85Q==
dependencies: dependencies:
querystringify "^2.1.1" querystringify "^2.1.1"
requires-port "^1.0.0" requires-port "^1.0.0"