Commit Graph

2198 Commits

Author SHA1 Message Date
Meitar M
76bff83ca3 Allow http: image URLs if Converse.js is loaded on an insecure origin.
Currently, in order for Converse.js to recognize a pasted URL as an
image, it must be an URL whose protocol is `https:` (`https` in the
URI.js library's notation). This is sensible, but means that any
non-HTTPS image URL is not recognized as a valid URL (and thus will not
be rendered inline, even if `show_images_inline` is set to `true`).

It is important to always check for HTTPS URLs when in a secure context
(i.e., the initial page load was requested via HTTPS) in order to ensure
that non-secured content does not mix with secured content. However, the
inverse is not true: if the original page was loaded over HTTP, then
enforcing HTTPS for images adds arguably no meaningful protection while
also breaking the `show_images_inline` feature for the edge cases where
Converse.js is deployed without HTTPS and a user pastes an HTTP URL.

This patch changes the behavior of the `isImageURL` method such that the
requirement for the pasted URL's protocol to be `https:` is enforced
only when the `window.location.protocol` itself is also `https:`. By
doing this, we ensure that secure origins (i.e., when Converse.js is
loaded over HTTPS initially) are still secured and cannot have non-HTTPS
content introduced to the page via a pasted non-HTTPS URL, however it
also allows non-HTTPS origins to render both HTTP and HTTPS image URLs.
2019-03-09 14:15:22 +02:00
Christoph Scholz
ed9d2a2526 make it configurable whether to respect autojoin 2019-03-09 14:10:40 +02:00
JC Brand
143d44c3f6 Avoid horizontal scrolling on the fullscreen login page 2019-03-07 17:47:30 +01:00
JC Brand
ebd1797991 Call save only once when updating a cached message 2019-03-07 17:38:07 +01:00
Axel Viala
b51d98d6d1 Fix #1327: Refusing url and email as mentions
Before the function `extractReference` in
`/src/headless/converse-muc.js` matched url and email.

Fix: https://github.com/conversejs/converse.js/issues/1327
2019-03-07 16:53:27 +01:00
JC Brand
33600eeece No need for a separate archive_id value.
With MAM2 we can just use stanza-id
2019-03-07 16:45:00 +01:00
JC Brand
be6a5d9c37 Reuse XEP-359 unique and stable stanza ids for Message id.
This helps us to avoid duplicates by relying on the fact that Backbone
models have unique ids.
2019-03-07 08:56:17 +01:00
Holger Weiss
a15aec3519 Assume "text-single" as default form field type
As per XEP-0004, the default "type" of data form fields is
"text-single", so a missing "type" attribute should not be treated
differently.

This fixes handling of CAPTCHAs offered by ejabberd.
2019-03-06 15:08:41 +01:00
Christoph Scholz
37800d92d3 allow drag & drop also in MUCs 2019-03-05 18:21:07 +01:00
JC Brand
0ebfc3fce8 Let converse-autocomplete also be triggered with backspace 2019-03-05 17:59:22 +01:00
JC Brand
7910447cf6 Use ev.key instead of ev.keyCode
Removes the need for maintaining a map of keycodes to keys
2019-03-05 17:59:22 +01:00
JC Brand
f8e31a7b49 Update converse-autocomplete to make it more flexible
* Accepts other triggers besides tab or @
* More finegrained control over whether the triggering char is
  included in the returned value or not.
2019-03-05 17:59:22 +01:00
Emmanuel Gil Peyrot
3aa9ee1ba0 Replace http: with https: in xmpp.org links 2019-03-04 17:49:44 +01:00
Emmanuel Gil Peyrot
b7ae9f212c Replace http: with https: in conversejs.org links 2019-03-04 17:47:45 +01:00
JC Brand
b15ebdde40 Update to Backbone 1.4.0 and use fork of Backbone.NativeView
with `_setElement` fix.

See https://github.com/akre54/Backbone.NativeView/pull/29
2019-03-01 11:56:22 +01:00
JC Brand
310b2c723b Fixes #1149
With xhr_user_search_url, contact requests are not being sent out
2019-03-01 11:56:22 +01:00
JC Brand
d4fbdf5629 Fixes #1213. Switch roster filter input and icons 2019-03-01 11:56:22 +01:00
JC Brand
c26dde34f9 Allow setting of debug mode via URL with /#converse?debug=true 2019-02-27 16:28:30 +01:00
JC Brand
61a0e1bb16 New config setting show_client_info
Determines whether we show the icon for opening the client's "About" modal.
2019-02-27 14:42:27 +01:00
JC Brand
49da581d14 Fixes #1400. When chat message is only an emoji, enlarge it 2019-02-27 10:34:47 +01:00
JC Brand
519bd54acb Fixes #1457. Wrong tooltip shown for "unbookmark" icon 2019-02-26 12:08:48 +01:00
JC Brand
d3a4555165 Re-add support for muc_domain and add locked_muc_domain.
updates #1373
2019-02-26 11:58:01 +01:00
JC Brand
2ddd918f6a Fixes #1437. List of groupchats doesn't scroll 2019-02-26 11:57:36 +01:00
JC Brand
59c43a23f0 Two changes, see below
* Add new test helper to create contacts via IQ exchange
* Use roster nickname to set message fullname
2019-02-24 20:27:41 +01:00
JC Brand
0ee08ee622 Use async/await for enterRoom 2019-02-22 23:14:35 +01:00
JC Brand
9b0e23dcc6 Ensure new contact is attached to existing chatbox
When a new contact is added, check if we already have a chatbox open for it,
and if so attach it to the chatbox.
2019-02-22 23:05:03 +01:00
JC Brand
bfaa7e47f2 Add roomviews.get API method 2019-02-22 21:44:03 +01:00
JC Brand
0fc5112000 Found one more occurance of the word room 2019-02-22 21:44:03 +01:00
JC Brand
5afb3051cc New release v4.1.2 2019-02-22 16:49:45 +01:00
JC Brand
a8e05dae36 Fall back to chatbox JID if the stanza has no from 2019-02-21 09:21:18 +01:00
JC Brand
f123f483ae Fixes #1406 2019-02-21 09:19:02 +01:00
JC Brand
ce2ae87df2 Bugfix. Open groupchats not shown when logging in after disconnection
* Replace `tearDown` overrides with event handlers.
* Move presence listeners to `connected` event handler, otherwise they
  don't get called when logging in again after disconnection.
* Add `clearSession` listeners to clean up upon disconnection.
* Use `Promise.all` instead of listening for multiple events.
2019-02-20 23:08:27 +01:00
JC Brand
253958ed93 Prevent duplicate messages by comparing MAM archive id to XEP-0359 stanza ids 2019-02-19 23:08:29 +01:00
JC Brand
4463b44773 Use "XMPP address" instead of "XMPP username" 2019-02-19 15:00:38 +01:00
JC Brand
e389d77107 New release 4.1.1 2019-02-18 20:40:55 +01:00
André Berenguel
8dcb327ead Update contact nickname when receive a roster push 2019-02-18 20:23:20 +01:00
JC Brand
c026dc8a86 New copyright year 2019-02-18 20:23:18 +01:00
JC Brand
9233087548 Don't hash web storage ids.
Makes debugging more difficult and uses up extra CPU cycles for no real security benefit.
2019-02-18 20:23:18 +01:00
JC Brand
af0093bd39 Bugfix: MUC invite form not shown 2019-02-18 15:42:56 +01:00
JC Brand
d830bc1250 Also check for duplicates in one-on-one messages 2019-02-14 15:17:49 +01:00
JC Brand
d08f738656 Bugfix: Restore textarea size after sending message 2019-02-14 13:21:26 +01:00
JC Brand
7e34a462c1 Add support for handling multiple stanza-id elements 2019-02-14 12:13:07 +01:00
JC Brand
8d00294681 Use origin-id to check for reflected messages.
Also, store the returned `stanza-id` on the message.
2019-02-14 11:33:28 +01:00
JC Brand
6eb05be4be XEP-0359: Better usage of stanza-id to check for dupes 2019-02-13 22:14:58 +01:00
JC Brand
5b25d5daaa Don't send markers to someone not on your roster
Updates #324
2019-02-13 19:32:02 +01:00
JC Brand
370c4c84d9 Use async/await instead of explicit promises 2019-02-13 15:49:51 +01:00
JC Brand
4c83a23382 Revert "Reject the waitUntilFeaturesDiscovered promise if query failed"
This reverts commit 01f0a65209.

Updates #1410
2019-02-13 15:44:17 +01:00
JC Brand
2c9c11e971 onMessage improvements.
Don't check for older messages with same msgid
we can't rely on a message's `id` attribute being unique.

Also, remove `createMessage` in favour of calling `messages.create` directly.
2019-02-13 15:24:02 +01:00
JC Brand
0169d86b11 Re-add check for allow_non_roster_messaging 2019-02-13 15:21:41 +01:00
JC Brand
dfe9d301c6 Test that roster groups are fetched before contacts
updates #1405
2019-02-13 11:20:49 +01:00