Commit Graph

219 Commits

Author SHA1 Message Date
supun19
dd0821076d Groupchat auto-configuration now supports list-multi fields 2019-05-14 15:28:06 +02:00
JC Brand
6193a9dc80 Replace lodash methods with native ones and remove lodash.fp 2019-05-14 12:41:47 +02:00
JC Brand
d98b33de0a Trigger will-connect event inside reconnect method.
Also add docstrings.
2019-05-14 10:31:41 +02:00
JC Brand
4f705369bd Replace _.each and _.map with native methods 2019-05-13 20:16:39 +02:00
JC Brand
ca5b6f9fde Add class on MUC message to indicate author's role 2019-05-13 20:10:48 +02:00
JC Brand
d91a5ca6de Remove alias for xss. Upgrade pluggable.js to version 2.0.1 2019-05-13 18:54:00 +02:00
JC Brand
7a990ae0b9 Fixes #1558, this.get is not a function 2019-05-13 14:37:48 +02:00
JC Brand
84472ab752 Bugfix. npm install converse.js failed
because @converse-headless wasn't available
2019-05-10 15:26:50 +02:00
JC Brand
587dddd81d Update to latest version of Strophe
which logs less on the INFO loglevel
2019-05-10 13:26:30 +02:00
JC Brand
0e7d64818d Add NPM scripts so that we can build dist files 2019-05-10 12:57:30 +02:00
JC Brand
145ee88213 Start handling error presences in MUC model 2019-05-09 12:18:36 +02:00
JC Brand
2526d80464 Change api.disco.supports to resolve to a Boolean
Also add a new API method `api.disco.features.get` for the use-case
where you still want the feature object to be returned.
2019-05-07 10:27:25 +02:00
JC Brand
c3dac272f8 Replace moment with DayJS 2019-05-06 14:27:18 +02:00
JC Brand
9528276be2 Use native Date methods instead of moment
- Use native `getTime` method instead of moment's `valueOf`
- Use toISOString() instead of moment().format()
  This makes the code timezone independent since we're now globally using UTC.
2019-05-06 10:28:03 +02:00
laszlovl
565f7d9f74 Make sure the time attribute for MAM message is parsed through moment
Messages (received directly or via MAM) are stored in a backbone
collection that's kept sorted by the message's "time" attribute.
Various parts of the codebase rely on this behavior.

For regular messages, the time attribute is generated by
`moment().format()`, which generates a timestamp in the browser's
local timezone, for example "...+02:00".

For MAM messages, we would previously copy the "delay.stamp" value
into the "time" attribute verbatim. However, that value is generated
by the server and is unlikely to be in the same timezone locale.

ISO timestamps expressed in different timezones cannot be sorted
lexicographically, breaking the premise of keeping the messages
collection sorted by time.
2019-05-05 15:44:20 +02:00
JC Brand
15b2273631 _converse.api.archive.query now returns a Promise
instead of accepting a callback functions.
2019-05-03 19:47:49 +02:00
JC Brand
8bb852b139 Updates #1554
Room auto-configuration broke if the config form contained fields with type `fixed`
2019-05-03 18:04:03 +02:00
JC Brand
346baa686f Refactor room auto-configuration 2019-05-03 18:01:07 +02:00
JC Brand
273b9584c0 Refactor onMessage to use const instead of let 2019-05-03 14:12:26 +02:00
JC Brand
52ea8d5ab6 Fixes #1550
Legitimate carbons messages blocked due to erroneous forgery check
2019-05-03 14:11:29 +02:00
supun19
eec51f9d62 Doc rooms api (#1551)
* Rooms Api
number of parameters in the documentation was made 2 from 3 as api which is used to open a room with default configuration has only 2 parameters.
2019-05-03 11:38:05 +02:00
JC Brand
d868b9a9f7 Continuously retry to fetch login credentials 2019-05-02 14:53:42 +02:00
JC Brand
ba6de8844e Use Object.keys instead of _.keys 2019-04-29 09:29:40 +02:00
JC Brand
34469425d6 Use Object.assign instead of _.extend 2019-04-29 09:07:15 +02:00
JC Brand
51d0dc8d23 No such method disconnect 2019-04-27 18:09:59 +02:00
JC Brand
b9e5658112 Message deduplication bugfixes and improvements.
- Add a new method to check for dupes based on the message text.
- When checking for dupes based on origin_id, no need to restrict to
  only our own.
2019-04-27 18:09:58 +02:00
JC Brand
66adf03557 Bugfix. Order of operations. 2019-04-24 10:05:18 +02:00
JC Brand
e189acc8c9 Returning nick with credentials_url complicates things too much 2019-04-23 14:53:48 +02:00
JC Brand
741be5cc04 converse-muc: Handle VCards not being available 2019-04-23 12:32:59 +02:00
JC Brand
624cf4f435 Allow nickname to be provided by the credentials_url 2019-04-23 12:06:40 +02:00
JC Brand
cf75946e7b Make fetchLoginCredentials a function 2019-04-23 10:50:48 +02:00
JC Brand
5ead9796cc Set the JID in the session 2019-04-22 14:44:40 +02:00
JC Brand
25a0a898f2 Don't restore a BOSH session without knowing the JID 2019-04-22 14:33:49 +02:00
JC Brand
f8fcdc7eb8 Explicitly log out after each test. 2019-04-22 14:04:21 +02:00
JC Brand
cf32119c53 Make browserStorage key more readable 2019-04-19 11:18:34 +02:00
JC Brand
8bc3aaa224 Upgrade to Webpack 4.28.1 2019-04-18 16:14:51 +02:00
JC Brand
725a382e3b Refactor initialization and defaults for chat boxes
- Let box_id start with char for valid HTML.
- No need to use SHA1 for box id
- No need for the user_id attribute.
- Set nickname when we set the roster contact.

Also...

- _converse.api.contacts.get is now async
- _converse.api.chats.create is now async
2019-04-18 16:14:51 +02:00
JC Brand
d2166ce3dd Remove deprecated API methods
since the next release will be a major one.
2019-04-16 16:57:55 +02:00
JC Brand
ee78ec1333 Add force parameter to _converse.chats.open
This changes the API method's current behavior by not automatically
maximizing (in `overlayed` view mode) or bringing a background chat into
foreground (in `fullscreen` view mode). Instead `force` needs to be set
to `true` for that to happen.
2019-04-16 16:42:15 +02:00
JC Brand
3c988240d1 Don't check for debug mode too early
Otherwise we can't enable it during operation
2019-04-16 13:59:04 +02:00
JC Brand
4eb6df92c6 Bugfix. Controlbox closed state not remembered
in overlay view mode.

Also refactored a bit to put the method, which determines whether a
chatbox may be shown, on the chatbox itself.
2019-04-16 13:38:46 +02:00
JC Brand
1dd2c4ce7b Reconnect if we can't send a message due to dropped connection 2019-04-16 13:01:47 +02:00
JC Brand
b593b8deb6 Fixes #1533
Users can only be muted in moderated rooms
2019-04-11 23:10:57 +02:00
JC Brand
76a7c3fa9b Bugfix. Update to new function which has been renamed. 2019-04-11 20:08:53 +02:00
JC Brand
f84c201437 Hide the textarea when a user is muted in a groupchat 2019-04-11 01:40:16 +02:00
JC Brand
aa90ebd7f0 Bugfix. Don't delete JID or resource...
when an affiliation change presence is received.
2019-04-11 01:39:06 +02:00
JC Brand
234556793f Provide a more user-friendly error message to muted users 2019-04-10 22:03:00 +02:00
JC Brand
f1899d0977 Looser coupling with converse-vcard
To make it easier to remove it without breaking stuff.
2019-04-10 19:35:35 +02:00
JC Brand
d3a80e804f Move converse-caps into the headless build 2019-04-10 19:22:11 +02:00
JC Brand
a75c118a2c Prioritize roster nickname as message and chatbox display name
Set reference to roster contact on the message and chatbox object and
listen for changes to the nickname.

Currently, because chat boxes are fetched and initialized before the
roster, messages and chats are repainted with the correct display name
only later, causing a "flash" effect.

Ideally we would only initialize the chat boxes after the roster
contacts have been fetched, but this is currently not easily possible
because we need the control box to render before everything else.
2019-04-09 17:20:41 +02:00