Commit Graph

166 Commits

Author SHA1 Message Date
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
JC Brand
376c50fbc8 When inviting to a members-only room, first add to user to the member-list 2016-12-05 15:06:20 +00:00
JC Brand
088eb03b54 Immediately hide chat room on close.
Also, use sendPresence from latest strophe so that we have a timeout in case a
responding presence never comes.
2016-12-05 10:49:51 +00:00
JC Brand
7ad39cfdb9 Fetch the room information before opening the room. 2016-12-05 06:07:01 +00:00
JC Brand
5b944f9e5f Fixes #737: translations weren't being applied. 2016-12-04 16:53:35 +00:00
JC Brand
81e3cb976c converse-muc: Show a spinner while fetching the config form 2016-12-04 15:11:09 +00:00