Commit Graph

371 Commits

Author SHA1 Message Date
JC Brand
cfd5dad9c5 Use [backbone.vdomview](https://github.com/jcbrand/backbone.vdomview)
For the MUCJoinView and the LoginPanel
2017-11-10 22:01:36 +01:00
JC Brand
ed4c393a9d Create separate view for the MUC join form 2017-11-10 21:37:35 +01:00
JC Brand
a6f2877ed9 Disco API refactoring
This came out of the desire to let `converse-muc` use the API to
determine whether MUC is supported. However, we don't know the entity
JID before hand and I couldn't think of a good way to query all current
and future entities for a feature.

So `converse-muc` still does it's own thing without the API, but some
refactoring came as a result of attempting.
2017-11-10 21:37:35 +01:00
JC Brand
8a4aa4efdd Use a named variable for _.template
This removes the need for `switch (obj)` in the template which is not
allowed in strict mode.

Additionally using a named variable speeds up rendering.
2017-11-05 18:59:29 +01:00
JC Brand
3514d6d56b fixes #316
- Also allow private chats to be opened via URL fragment.
- Make sure to clear the URL fragment when the relevant chat is closed.
2017-10-31 23:11:27 +01:00
JC Brand
985cf6c294 Use global router to open chat rooms 2017-10-31 22:08:06 +01:00
JC Brand
35db952e71 Make openChatRoom a closured function 2017-10-31 22:07:40 +01:00
JC Brand
61ed55dbaa Rename login and register urls 2017-10-31 20:39:44 +01:00
JC Brand
20f3172f5e Add fixme note 2017-10-24 11:07:58 +02:00
JC Brand
724e66d0e5 Initial code for opening a room via URL 2017-09-29 00:07:16 +02:00
JC Brand
80b3692131 More work in removing locales from builds 2017-09-26 18:27:41 +02:00
JC Brand
f0debc61ab Refactor i18n so that only relevant translations are fetched
instead of bundling all translations in the dist file.
2017-09-25 12:49:10 +02:00
JC Brand
937b310733 Refactor login form to make it more reactive. 2017-09-24 00:30:43 +02:00
JC Brand
b9b9689668 Fixes #912 maximize method in converse-minimize fails...
if the `controlbox` is not there.

Also, make `converse-controlbox` and `converse-muc` optional dependencies of
`converse-minimize`.
2017-08-29 12:21:53 +02:00
lduburas
eef483cb4d Fix regarding ChatRoomView.getDefaultNickName() and muc_nickname_from_jid (#911)
* ChatRoomView.getDefaultNickName() when muc_nickname_from_jid  is used

Allows to overridde nickname by plugins when muc_nickname_from_jid is used.

* CHANGES.md updated
2017-08-28 09:27:59 +02:00
JC Brand
32d574039d Translateable strings must not be template literals
xgettext doesn't support them yet, which causes errors in the pot/po files.

https://savannah.gnu.org/bugs/?50920

updates #909
2017-08-23 12:00:49 +02:00
JC Brand
56c5a9c8d0 Move form utilities to form-utils.js 2017-08-16 15:19:41 +02:00
JC Brand
add3b8efb3 utils now no longer depends on jquery. 2017-08-16 09:05:15 +02:00
JC Brand
3afe5eb8f3 Run the lodash converter only once. 2017-08-15 16:46:55 +02:00
JC Brand
e4d95eb794 Don't load lodash.fp in converse-core. It's not being used there. 2017-08-15 16:36:43 +02:00
JC Brand
38f8724dd9 roomslist: Add ability to add or remove bookmarks 2017-08-09 15:50:24 +02:00
JC Brand
805db75e10 Bugfix. Handle case where there's no room data 2017-08-08 16:27:07 +02:00
JC Brand
59edcb2393 muc: Add JID validation to the occupant invite form 2017-07-21 19:53:57 +02:00
JC Brand
de7a1f7545 Check specifically for the Slack identity when working around its quirks 2017-07-21 17:58:46 +02:00
JC Brand
084d9914b0 muc: Refactored how MAM messages are fetched.
Listen for the `afterMessagesFetched` event.
Wait until `discoInitialized` before fetching.
Add `fetchArchivedMessagesIfNecessary` method(s).
2017-07-21 15:09:50 +02:00
JC Brand
7850c38faa disco: Create new plugin converse-disco.
We can now support feature discovery for multiple entities (although we
currently still only query for the user's own XMPP server).
2017-07-21 15:09:50 +02:00
JC Brand
0edb38e2c6 Fixes #896 Consistently use XMPP username in user facing text 2017-07-19 09:17:46 +02:00
JC Brand
f84790e68c muc: Show JID (instead of only server) in room info
Also made some styling changes and tweaked the room head to better
differentiate between the Name and JID of a room.
2017-07-19 08:30:04 +02:00
JC Brand
c012c2c1af Don't show duplicate sent groupchat messages in Slack chat rooms 2017-07-19 08:28:51 +02:00
JC Brand
496d2521fc muc: Show room domain in header.
Also make sure room name gets saved once it's been updated.
2017-07-17 18:07:31 +02:00
JC Brand
ffdd4e25f3 emoji: remember category and skin tone selection 2017-07-16 14:12:17 +02:00
JC Brand
1dfdba0db9 muc: Ignore non-MUC (like error) messages
Noticed that Slack sends error messages back in response to chat state
notifications.

We're not doing anything with them currently and they bloat the sessionStorage
2017-07-16 12:51:20 +02:00
JC Brand
4ea50de927 Use emoji instead of emoticon 2017-07-15 15:14:47 +02:00
JC Brand
67578c9747 Merge branch 'master' into emoji 2017-07-15 07:16:37 +02:00
JC Brand
397927b189 Fix broken tests and update changelog 2017-07-12 09:58:14 +02:00
JC Brand
6ef0536e31 Some work on using es6 promises 2017-07-10 21:14:48 +02:00
JC Brand
9a9eae3fcf Use esnext to auto-generate es2015 syntax 2017-07-10 17:46:22 +02:00
JC Brand
40e7ee1ae6 Initial stab at using ES2015
Mostly replaced ``var`` with ``let`` and ``const``.
Also added a few arrow functions.
2017-07-10 12:49:20 +02:00
JC Brand
2d89589b54 bookmarks: clear the fetched_flag upon logout 2017-07-10 10:43:37 +02:00
JC Brand
5ab1693136 logging: Add deprecation warning for updateSettings
and also use the Strophe.LogLevel levels for logging in general.
2017-07-05 11:33:55 +02:00
JC Brand
f81a94baf1 Move updateSettings to the private API.
Also add an API method for exposing new promises.

Update the plugin and API documentation, specifically concerning the above
changes.
2017-07-05 11:03:13 +02:00
JC Brand
c11a1b40e8 muc: bugfix, presence referring to current user doesn't have a jid attr 2017-06-27 12:56:50 +02:00
JC Brand
ea04b11724 Try to fix what appears to be a timing bug 2017-06-27 09:29:46 +02:00
JC Brand
4e467044d3 Some usability fixes around the toolbar and emojis 2017-06-24 11:34:01 +02:00
JC Brand
70f56b31f4 Merge branch 'master' into emoji 2017-06-24 11:04:19 +02:00
JC Brand
66fd9a9f28 muc: Fix: after reconnecting, already open room didn't receive new messages 2017-06-23 20:19:38 +02:00
JC Brand
36e078c9f6 utils: Rename saveWithFallback to safeSave 2017-06-23 20:17:58 +02:00
JC Brand
86c20ce2a7 muc: When exiting, don't wait for confirmation before cleaning up
During logout we don't have enough time.
2017-06-23 18:22:19 +02:00
JC Brand
02e5921415 Fix problem of stuck/hanging tests on TravisCI 2017-06-19 15:05:22 +02:00
JC Brand
ca53a8d8ef Add support for Emojis 2017-06-17 01:01:52 +02:00
JC Brand
d527f693c2 Updates #890 Destroy and recreate session upon reconnection
This ensures that carbons will be activated again.
2017-06-15 17:30:26 +02:00
JC Brand
9ee5550cde inverse: bugfix, when reloading, hidden auto-joined room was displayed 2017-06-15 16:22:49 +02:00
JC Brand
e29c2f8197 muc: render tab upon chatroom add
So that it shows unread messages upon page reload.
2017-06-15 12:32:33 +02:00
JC Brand
1f82b7dfe4 Create utils method isSameBareJID. Refs: #894 2017-06-14 22:31:44 +02:00
Antonio Zoccoli
ad06c2b9cc Converse ryzen 894 (#895)
* added change #894

* #894 - fix jid comparison in setAffiliationAndRole
2017-06-14 22:20:46 +02:00
JC Brand
6c262f7213 Various small changes to reduce (non-critical) errors during testing 2017-06-14 20:14:45 +02:00
JC Brand
076af0970f Make spinner into a template 2017-06-14 19:43:02 +02:00
JC Brand
2d4159802e Bugfix. Don't override defaults for ChatBox 2017-06-13 18:22:19 +02:00
JC Brand
8191d5e83a muc: Rename `createChatRoom to openChatRoom`
It doesn't always create a new room.
2017-06-13 18:22:19 +02:00
JC Brand
d1bafdb38a Re-render only the tab when num_unread changes. 2017-06-09 23:45:54 +02:00
JC Brand
f9fb13a71d muc: Make defaults a function
otherwise also the prototype's defaults gets overwritten.
2017-06-07 17:47:50 +02:00
JC Brand
b5ecc1fc6a Expose the fp version of lodash via the API 2017-06-07 09:15:22 +02:00
JC Brand
a128a70d41 Discriminate between which unread messages to indicate per tab 2017-06-07 00:55:57 +02:00
JC Brand
5949ca9e36 Show number of unread messages on the "Rooms" tab 2017-06-05 14:52:24 +02:00
JC Brand
86dc3800aa Render nickname form when entering a room via invitation 2017-05-24 17:18:54 +02:00
JC Brand
c83026e5a8 muc: Differentiate between generally unread messages and unread mentions 2017-05-24 08:40:09 +02:00
JC Brand
a4284e48f7 Use proper message handler. Fix typo 2017-05-23 18:49:04 +02:00
JC Brand
7df2d36e42 We now have a separate Backbone.Model for chat rooms
Also... `num_unread` is now updated for groupchat messages in which the user is
mentioned.
2017-05-23 18:40:55 +02:00
JC Brand
5e783e70e4 Lay the groundwork for being able to have separate ChatRoom models 2017-05-23 18:16:47 +02:00
JC Brand
501c9f5e97 muc: Extract code into separate method renderRoomsPanel 2017-05-16 11:55:59 +02:00
JC Brand
3835ab7af6 bookmarks: Don't autojoin rooms prematurely
by first waiting until chatboxes have been fetched as well.
2017-05-08 21:28:56 +02:00
JC Brand
d81d62f98d muc: check for browserStorage attr instead of whether connected 2017-05-08 21:28:56 +02:00
JC Brand
47ca3e64b2 Emit new event roomsPanelRendered 2017-05-08 21:28:56 +02:00
JC Brand
f3d29e016e Show unread messages counter next to roster contacts 2017-04-24 15:57:22 +02:00
JC Brand
bc1fa24315 Show the MUC server in a bookmarked room's info view 2017-04-21 19:05:10 +02:00
JC Brand
6af4480c14 Render disconnect message via template and add padding. 2017-04-21 18:26:59 +02:00
JC Brand
3ea43c6a0f Use noConflict to avoid polluting globale namespace
with lodash and Backbone.
2017-04-21 18:06:27 +02:00
JC Brand
9f28728e61 Updates #849. Don't call when no connection present 2017-04-19 14:47:18 +02:00
JC Brand
1b38967d19 Updates #842 Persistent muc room creation not working 2017-04-13 11:19:24 +00:00
JC Brand
de2f33f333 Send button must be translateable and should type "submit" 2017-04-11 07:32:17 +00:00
JC Brand
d0f9f15d60 Bugfix. Prevent bypassing of password form via bookmark form
Not a security hole, but a UX issue.

Also... don't render artifacts before rendering the nickname form.
2017-04-04 14:45:50 +00:00
Marc Laporte
d83f64bcc9 Improve spelling (#836) 2017-04-04 09:11:55 +02:00
Anshul Singhal
99647438ac Adds the send button at bottom of chatbox (#796)
Fixes #796 New config option: `show_send_button`

* Adds show_send_button setting to docs

* Change log updated

* Improves send button CSS, style fixes and documentation corrections

* Adds missing setting in rendering template for headlines
2017-03-30 12:40:17 +02:00
JC Brand
6e94e11dcc Fixes #820. Inconsistency in displaying room features 2017-03-19 18:23:02 +00:00
JC Brand
9214c81bbc Updated po files. 2017-03-15 11:02:25 +00:00
JC Brand
f1bf5a9654 Fixes #807
- Document `optional_plugin_dependencies`
- Also make `converse-headlines` an optional dependency of `converse-dragresize`
2017-03-08 11:36:46 +00:00
JC Brand
741f2a6b9a Make sure the occupants height is set after transition 2017-03-05 10:33:20 +00:00
JC Brand
e1e20690f0 muc: the original stanza must be emitted
Otherwise other plugins don't know whether the message was forwarded or not.
2017-03-03 14:44:04 +01:00
JC Brand
62c8177142 Bugfix.
After bookmarking a room for which a nickname is required, return to the nickname form.
2017-03-02 23:28:22 +01:00
JC Brand
a5c0d5c451 Wrap long lines. No need for that 2017-03-02 23:06:40 +01:00
JC Brand
a895c91f14 Programmatically set the occupants height
since I couldn't find a way to do this with only CSS.
2017-03-01 08:42:26 +01:00
JC Brand
78865bbccb Don't show the features heading if we don't know of any 2017-02-28 22:34:16 +01:00
JC Brand
a3407bb98b Move MAM specific code to converse-mam.js 2017-02-28 22:34:04 +01:00
JC Brand
dc8cbc6104 3 changes
- immediately show chat box (sometimes fetching features takes long)
- add timeout for fetching features
- don't register scroll handler twice for chat rooms.
2017-02-28 17:25:33 +00:00
JC Brand
bccdedc64f Also show a hint explaining the roomchat status 2017-02-28 06:52:33 +01:00
JC Brand
f20d391ea6 Show chat room occupants' states. 2017-02-28 05:28:09 +00:00
JC Brand
f2f05ff484 MUC: Don't show duplicate join messages. 2017-02-28 05:02:36 +00:00
JC Brand
f8d9368163 MUC: only render and listen to 'scroll' event...
after the cached messages have been fetched.
2017-02-27 21:09:17 +00:00
JC Brand
adeac37b5c Move more features HTML to chatroom_features.html 2017-02-27 17:59:33 +00:00
JC Brand
946a240080 Make sure to show the invite widget
when the room features change.
2017-02-27 17:56:40 +00:00
JC Brand
2998ef818a Chat rooms weren't being scrolled down after page reload 2017-02-25 07:48:28 +00:00
JC Brand
61b2dc7f99 Move MAM code to proper place.
Also, don't query for MAM messages if the chat room doesn't support it.
2017-02-24 20:52:23 +00:00
JC Brand
0d48929bb3 Show join/leave messages in chat rooms. Updates #365 2017-02-24 17:54:45 +00:00
JC Brand
6dfc82da0b Native querying instead of using jquery 2017-02-24 12:00:05 +00:00
JC Brand
2ae2a1b505 Updated a bit to make it clearer. 2017-02-24 12:00:05 +00:00
JC Brand
305559a85c Use sizzle in converse-muc.js 2017-02-24 12:00:05 +00:00
JC Brand
c845d419fe Better way of getting a hold onto the chat room view 2017-02-19 11:03:24 +00:00
JC Brand
4c41ae8fad Render room features separately
So that the occupants list doesn't get wiped.
2017-02-19 11:16:27 +01:00
JC Brand
9817aedea7 No need to set templates on the _converse object.
If it's needed in another plugin, it can simply be `require`'d.
2017-02-19 11:12:26 +01:00
JC Brand
441f7a2a15 Show the chatroom occupants JID in the tooltip
if you're allowed to see it.
2017-02-19 01:08:08 +00:00
JC Brand
a6ca5aad35 Show room features in the sidebar. 2017-02-19 00:39:08 +00:00
JC Brand
10a85336cc Show the description in the heading, not the subject 2017-02-19 00:20:21 +00:00
JC Brand
0a99b9f22a Don't query for room features for restored chat rooms. 2017-02-19 00:20:21 +00:00
JC Brand
efa8776881 By convention keep the render methods immediately after initialize 2017-02-18 10:03:26 +00:00
JC Brand
fe6cb93a63 MUC: don't send out chat hints before join or after leave 2017-02-17 22:17:19 +01:00
JC Brand
a033899946 Fix leaky abstraction of MUC 2017-02-15 20:30:32 +00:00
JC Brand
e52a775430 Bugfix. See below.
"TypeError: this.sendConfiguration(...).then is not a function" when a room is created
2017-02-14 16:55:32 +00:00
JC Brand
bc8e3e1a01 Return a Backbone.View object instead of a wrapper
When returning chat boxes via the API.

We can do this now because these API methods are only available to
(whitelisted) plugins.
2017-02-14 15:10:46 +00:00
JC Brand
fe6a9ca748 Merge converse-api and converse-core
Otherwise `require('converse-core')` can be called, exposing the inner converse
object.
2017-02-14 14:35:52 +00:00
JC Brand
495c6060f9 Allow non-roster contacts to be invited to a chatroom. 2017-02-14 14:35:31 +01:00
JC Brand
d2227c8d44 Replace typeahead with awesomplete.
Much smaller library.
No dependence on jQuery.

Updates #779
2017-02-14 12:26:56 +01:00
JC Brand
3b8431dd7a Revert "Escape interpolated values. Updates #779"
This reverts commit e63607227d.
2017-02-14 07:47:38 +01:00
JC Brand
e63607227d Escape interpolated values. Updates #779 2017-02-14 07:28:04 +01:00
JC Brand
f73a1d3fc0 Don't name the modules.
According to the require.js docs this shouldn't be done.
http://requirejs.org/docs/whyamd.html#namedmodules
2017-02-13 14:37:17 +00:00
JC Brand
85f6a75fed Escape user-generated input to avoid injection attacks 2017-02-13 13:41:37 +00:00
JC Brand
63888dd454 Fix failing tests 2017-02-02 21:55:05 +00:00
JC Brand
0424df9edc Rename the closured converse object to _converse
to indicate that it's private and to differentiate it from the outer "global"
converse object.
2017-02-02 20:43:48 +00:00
JC Brand
83feebb229 Two plugins changes
- Remove the `plugins.remove` API method.
- Throw an error when attempting to register multiple plugins with the same name.
2017-02-02 18:54:15 +00:00
JC Brand
9b48b2d6bd Update plugins to not depend on converse-core
To illustrate that this is not necessary (and also not possible with
non-bundled plugins).
2017-02-02 18:34:13 +00:00
JC Brand
b701c4830f Also use _converse as pluggable object reference. 2017-02-02 18:34:13 +00:00
JC Brand
b7b9711296 Rename the closured converse object to _converse
to indicate that it's private and to differentiate it from the outer "global"
converse object.
2017-02-02 18:34:13 +00:00
JC Brand
4dcb855562 Split API into public and private (plugin only) parts. 2017-02-02 18:30:59 +00:00
JC Brand
77f93a6471 Some initial work on removing jQuery 2017-02-02 18:30:08 +00:00
JC Brand
bcbeb8da6c Case-insensitive matching of moderation commands.
Also add `/subject` as alias to `/topic`
2017-02-02 14:56:56 +01:00
JC Brand
081f075aa9 Add eslint with lodash checking and apply its suggestions 2017-02-01 14:02:18 +01:00
JC Brand
c16dac1453 Rather don't expect join to always return the right context. 2016-12-09 19:15:16 +00:00
JC Brand
0bcf61389f Work around a Prosody bug.
Prosody doesn't handle it if we set the affiliation for multiple JIDs in one
stanza, so we need to send a stanza for each JID.

Refs https://prosody.im/issues/issue/795
2016-12-09 19:11:16 +00:00
JC Brand
37df4ad18c Bugfix. Need to return this. 2016-12-08 14:23:17 +01:00
JC Brand
b2240cfe94 Use $.when to keep track of all outgoing promises
Now that we are sending multiple IQ stanzas when setting affiliations.
We now again have a sendAffiliation method, so we use that.
2016-12-08 07:34:01 +00:00
JC Brand
f5fbf71275 New config setting: muc_disable_moderator_commands 2016-12-07 13:48:47 +00:00
JC Brand
636f02109d Various fixes in the delta algorithm 2016-12-07 13:02:03 +00:00
JC Brand
993c8f1695 We need to send out a separate IQ stanza for each affiliation
At least for Prosody.
2016-12-07 12:43:41 +00:00
JC Brand
54371f0e7d Remove setAffiliation and use the more general purpose setAffiliations 2016-12-07 11:45:51 +00:00
JC Brand
77d3e64f42 Specify the reason (if given) when setting someone's affiliation
This changed required me to go back to an array of maps instead of a single map
to store jids and affiliations.
2016-12-07 11:45:51 +00:00
JC Brand
b516ae51e7 Move code into separate function. 2016-12-07 10:34:02 +00:00
JC Brand
802c9d1f02 Make it configurable how the affiliations delta is computed.
When inviting someone to a members-only room, you only want to add an
affiliation of 'member' if they don't already have any other affiliation.

So we need to ignore the "new" member if they're already on *any* of the lists.
2016-12-06 20:04:08 +00:00
JC Brand
58f07cf115 Change the data structures representing members
Make the delta algorithm simpler. Fixed some delta bugs in the process.
2016-12-06 19:39:16 +00:00
JC Brand
c6767bcdaa Refactor to send out 3 affiliation request stanzas.
One for each affiliation (member, owner, admin).

Unfortunately Prosody doesn't give you correct results if you query for all
three affiliations in one stanza.

We'll have to see whether setting all three in one stanza actually works.
2016-12-06 18:34:54 +00:00
JC Brand
6c725409c2 converse-muc: Only send the delta when setting the member list.
As required by XEP-0045.

This requires that we first fetch the existing member list, compute the delta
and then send that if there is one.
2016-12-06 15:18:33 +00:00
JC Brand
cf42911754 converse-muc: rename wrapping function again and put on converse
So that it can be overridden.
2016-12-05 18:31:58 +00:00