Commit Graph

6267 Commits

Author SHA1 Message Date
JC Brand
aa30e4d9e8 Bugfix. Don't unnecessarily fetch roster again when it's empty 2019-07-29 11:20:33 +02:00
JC Brand
e20b654876 Stop using _.isUndefined 2019-07-29 10:32:29 +02:00
JC Brand
caad85f45b Manually remove BOSH session tokens from cache
even if the `_converse.bosh_session` instance does not exist.

We do this to avoid trying to reconnect with stale tokens upon
reconnection. Especially relevant for anonymous connections, but could
also be applicable when switching between websocket and BOSH connections
when reconnecting.

Also renamed `startNewBOSHSession` to `startNewPreboundBOSHSession`
2019-07-29 10:08:38 +02:00
JC Brand
f9cc51b28a Bugfix. Make sure that restoreBOSHSession is always called
I.e. also when we're reconnecting.

Otherwise the `_converse.bosh_session` object doesn't get recreated and
we don't cache the BOSH tokens.
2019-07-29 10:05:31 +02:00
JC Brand
179c0810c7 Prioritise logging in with credentials_url...
above logging in with passed in JID and password, since the password
might be an expired token.
2019-07-26 20:03:32 +02:00
JC Brand
778b4ff131 Bugfix. Fix check for debounced reconnection 2019-07-26 20:02:56 +02:00
JC Brand
5a48f3da23 Clone auto_join_rooms values before passing in
otherwise values get tacked on, causing problems when reconnecting.
2019-07-26 19:30:01 +02:00
JC Brand
6dd4fc5234 Tear down previous session when reconnecting anonymously
Because when we reconnect anonymously, we get a new JID, so it's as if
it's a completely new user.
2019-07-26 19:29:01 +02:00
JC Brand
a1d7076e93 Let initConnection wait for for _converse.api.login
So that the BOSH connection will be restored before we trigger `connectionInitialized`
2019-07-26 18:57:28 +02:00
JC Brand
fd4ba89182 Reconnect when an anonymous connection drops or fails. 2019-07-26 18:50:19 +02:00
JC Brand
ea36d53f78 Re-add the keepalive options.
It's unlikely that `keepalive` needs to be set to `false`, but there are
some edge cases where it might be useful.

Here's a breakdown of the different configurations of `keepalive` and `auto_join`:

---

* auto_login: false, keepalive: true

This is the default config. Users need to log in manually, but then
Converse will try to reconnect them when the page reloads.

* auto_login: true, keepalive: true

Also very popular configuration. Used with `credentials_url` or `prebind_url`.

* auto_login = `true`, keepalive = `false`

Not sure what this could be useful for. No currently known application.

* auto_login = `false`, keepalive = `false`

Useful when you want some kind of specific action to trigger login, but
you don't want to maintain that state across page reloads.

Also relevant when using a websocket connection with anonymous login.
With websocket it's impossible to maintain anonymous sessions across page
reload because the the session gets removed server-side as soon as the
websocket connection drops and the server won't accept a full JID with
password for an anonymous connection anyway (which could happen upon
page reload when Converse tries to login in again if `keepalive` was `true`).
2019-07-26 18:08:38 +02:00
JC Brand
b6b085189b Attempt to restore BOSH session or auto_login before...
triggering connectionInitialized.

That way, when listening for `connectionInitialized`, we'll know when it
fires whether we've attached to a BOSH connection or not.
2019-07-26 16:43:35 +02:00
Weblate (bot)
1ba320ef46 Update from Weblate (#1655)
* Translated using Weblate (Norwegian Bokmål)

Currently translated at 70.9% (268 of 378 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/nb_NO/

* Translated using Weblate (Hebrew)

Currently translated at 100.0% (378 of 378 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/he/

* Translated using Weblate (German)

Currently translated at 100.0% (378 of 378 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/de/

* Translated using Weblate (French)

Currently translated at 100.0% (378 of 378 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/fr/

* Translated using Weblate (Spanish)

Currently translated at 100.0% (378 of 378 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/es/

* Translated using Weblate (Japanese)

Currently translated at 98.1% (371 of 378 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/ja/

* Translated using Weblate (Galician)

Currently translated at 100.0% (378 of 378 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/gl/

* Translated using Weblate (Lithuanian)

Currently translated at 80.4% (304 of 378 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/lt/

* Added translation using Weblate (Portuguese)

* Translated using Weblate (Arabic)

Currently translated at 81.7% (309 of 378 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/ar/

* Translated using Weblate (Czech)

Currently translated at 100.0% (378 of 378 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/cs/

* Translated using Weblate (Chinese (Simplified))

Currently translated at 38.4% (145 of 378 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/zh_Hans/

* Translated using Weblate (Turkish)

Currently translated at 4.8% (18 of 378 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/tr/

* Translated using Weblate (Portuguese)

Currently translated at 83.1% (314 of 378 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/pt/

* Translated using Weblate (Portuguese)

Currently translated at 82.5% (312 of 378 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/pt/

* Translated using Weblate (Romanian)

Currently translated at 34.4% (130 of 378 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/ro/

* Translated using Weblate (Romanian)

Currently translated at 38.4% (145 of 378 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/ro/

* Translated using Weblate (Romanian)

Currently translated at 54.0% (204 of 378 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/ro/

* Translated using Weblate (Arabic)

Currently translated at 86.5% (327 of 378 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/ar/

* Translated using Weblate (Romanian)

Currently translated at 54.8% (207 of 378 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/ro/

* Translated using Weblate (Portuguese (Brazil))

Currently translated at 63.2% (239 of 378 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/pt_BR/

* Translated using Weblate (Portuguese)

Currently translated at 82.8% (313 of 378 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/pt/

* Translated using Weblate (Basque)

Currently translated at 94.2% (356 of 378 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/eu/

* Translated using Weblate (Galician)

Currently translated at 100.0% (378 of 378 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/gl/

* Translated using Weblate (Turkish)

Currently translated at 16.9% (64 of 378 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/tr/

* Translated using Weblate (Chinese (Simplified))

Currently translated at 40.5% (153 of 378 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/zh_Hans/

* Translated using Weblate (Polish)

Currently translated at 80.7% (305 of 378 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/pl/

* Translated using Weblate (Chinese (Simplified))

Currently translated at 40.2% (152 of 378 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/zh_Hans/

* Translated using Weblate (Portuguese (Brazil))

Currently translated at 77.5% (293 of 378 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/pt_BR/

* Translated using Weblate (Portuguese)

Currently translated at 88.9% (336 of 378 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/pt/

* Translated using Weblate (Russian)

Currently translated at 96.8% (366 of 378 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/ru/
2019-07-26 15:03:11 +02:00
JC Brand
c4ad02d4e3 New config setting: muc_fetch_members 2019-07-26 13:32:21 +02:00
JC Brand
c5193be44b Add postrelease make recipe to show dev version number in app 2019-07-25 13:45:51 +02:00
JC Brand
9a7dd99889 Ensure python 3.7 is used for sphinx and bump lerna version 2019-07-25 13:24:16 +02:00
JC Brand
fa2d6cca10 Update developer documentation and buildout dependencies 2019-07-25 12:33:46 +02:00
JC Brand
2546622da3 Trigger events when resizing starts 2019-07-25 06:46:05 +02:00
JC Brand
45e19acfb1 Use cursor: pointer instead of href="#" 2019-07-24 14:09:53 +02:00
Stanislav
d9e0b63683 Fix: use JID from credentials when credentials_url is set (#1638)
* Fix: async SetUserJID
2019-07-23 15:26:46 +02:00
JC Brand
643c40f260 Respect auto_login after finishInitialization.
If `auto_login` is false, we shouldn't log in, so we only try to log in when
it is true. Otherwise we still try to restore the BOSH session (if applicable).
2019-07-23 11:51:51 +02:00
JC Brand
18a2c8858a Make attemptNonPreboundSession and autoJoin functions
rename `autoJoin` to `connect`
2019-07-23 10:19:15 +02:00
JC Brand
e4eafe9e91 Simplify attemptNonPreboundSession
- Split between `login` auth and the rest (`external`, `anonymous`, `prebind`)
- It doesn't make sense to pass along credentials when not using `login` auth so avoid that flow.
- It's not necessary to pass the `reconnecting` flag to `attemptNonPreboundSession`
2019-07-23 10:18:47 +02:00
JC Brand
30ad84d386 Update Lerna 2019-07-23 08:14:13 +02:00
JC Brand
9be43ccea7 Don't inform of role change which accompanies an affiliation change
given that it's implicit and can cause confusion
2019-07-22 18:45:30 +02:00
JC Brand
bcbff1b024 Don't assume user had voice before 2019-07-22 16:51:44 +02:00
JC Brand
033b6bd082 Break long words instead of showing a horizontal scrollbar 2019-07-22 16:36:44 +02:00
JC Brand
07f82d6a0d Allow passing of more options to auto_join_rooms 2019-07-22 15:10:59 +02:00
JC Brand
3817f471a0 Two session related fixes.
* Don't set JID resource when logging in anonymously. The resource will be set by the server.
* Don't wipe the `id` from the session when clearing it.
2019-07-22 14:43:30 +02:00
JC Brand
2fca442f57 Also render bottom panel when own occupant is added
So that we can remove the textarea if we're a visitor in a moderated room.
2019-07-12 13:50:39 +02:00
JC Brand
38d1e4e3d2 Bugfix. Sometimes when trimming chats, minimized chats go off screen 2019-07-12 12:50:20 +02:00
JC Brand
2849adf857 Stop debouncing show
Instead optimize in other ways.

Also:
- Don't fade in when `animate` is false.
- `trimChats` now gets called in `afterShown`.
- Add now event `beforeShowingChatView`
2019-07-12 12:42:41 +02:00
JC Brand
3a2bf766a0 Add new test utility waitUntilBookmarksReturned 2019-07-12 10:38:07 +02:00
JC Brand
06717370f1 Provide a traceback when waitUntil times out 2019-07-11 23:42:26 +02:00
JC Brand
a1630b5c1f Replace wait-until-promise with utility method
and bump default timeout

Also let `_converse.api.waitUntil` use it if a function is passed in.
2019-07-11 23:34:27 +02:00
JC Brand
8a98ef87fe Various small fixes. (Unused imports, unused vars etc). 2019-07-11 12:37:17 +02:00
JC Brand
802f2b24f5 converse-muc: Update sendConfiguration to not take callbacks 2019-07-11 11:01:51 +02:00
JC Brand
d95a7987ce Fix linting errors and add @module jsdoc directives 2019-07-11 10:48:52 +02:00
Malcolm
b016aa0f7d FIX OEMO default setting in wrong place (#1476) 2019-07-11 09:11:22 +01:00
JC Brand
8938245cdd Update various dependencies to their latest versions 2019-07-11 09:46:17 +02:00
JC Brand
8a405ee88c Various bugfixes based on the previous refactoring.
These two commit should ideally be one, but I inadvertently pushed to
remote too early.
2019-07-10 16:55:55 +02:00
JC Brand
ded9945ed9 MUC: Don't send XEP-0085 CSNs when we don't have voice
Includes some refactoring:

- Don't send an `active` chat state notification when entering a MUC
  I can't think of a good reason why this might be necessary or desired.
- Move `setChatState` form the view to the model
- Remove unused method `handleChatStateNotification`
- Don't store `role` and `affiliation` for the current user on the
  ChatRoom object, but instead on the ChatRoomOccupant object representing
  the user.
2019-07-10 14:24:00 +02:00
Malcolm
b163d05323 ADD Omemo default support (#1476) 2019-07-10 06:51:41 +01:00
JC Brand
a16c068313 Bugfix. Handle null passed in as attrs to api.rooms.create 2019-07-09 13:45:34 +02:00
JC Brand
168f29cf06 Only call credentials_url when authentication is set to login
Also update to newer strophe.js version which contains a bugfix.
2019-07-09 12:47:09 +02:00
JC Brand
5c88d3e836 Add role and affiliation classes to message DOM element 2019-07-08 13:58:15 +02:00
JC Brand
de1071bd4a Add isModerator method on the occupant model 2019-07-08 13:57:10 +02:00
JC Brand
216a67c165 Only show leave notifications when we're in the MUC
Otherwise when `removeNonMembers` gets called as we reconnect, we get a
long list of erroneous leave notifications.
2019-07-08 13:33:59 +02:00
JC Brand
6bfa69ab3b Bugfix. Wait for members before fetching messages 2019-07-08 13:23:56 +02:00
JC Brand
3ca6ac7f50 Fixes #1524 Don't include own device in OMEMO message
This change reverts the significant part of 1dfdb36d20

I can't say that I understand why libsignal throws `Error: Invalid signature`
when you try to build a session for your own (sending) device, but given that
messages can only be decrypted once, I guess it isn't really necessary
to encrypt for your own device, since you already have the plaintext.

In addition I've added some error handling so that we can recover
gracefully when session building fails for a subset of devices.
2019-07-05 19:21:05 +02:00