Add config setting to disable MUC direct invites.
This commit is contained in:
parent
6258cfa089
commit
854633089d
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
## 1.0.3 (Unreleased)
|
## 1.0.3 (Unreleased)
|
||||||
|
|
||||||
|
- Update the plugin architecture to allow plugins to have optional dependencies [jcbrand]
|
||||||
- Bugfix. Login form doesn't render after logging out, when `auto_reconnect = false` [jcbrand]
|
- Bugfix. Login form doesn't render after logging out, when `auto_reconnect = false` [jcbrand]
|
||||||
- Also indicate new day for the first day's messages. [jcbrand]
|
- Also indicate new day for the first day's messages. [jcbrand]
|
||||||
- Chat bot messages don't appear when they have the same ids as their commands. [jcbrand]
|
- Chat bot messages don't appear when they have the same ids as their commands. [jcbrand]
|
||||||
|
@ -11,6 +12,7 @@
|
||||||
- Don't use sound and desktop notifications for OTR messages (when setting up the session) [jcbrand]
|
- Don't use sound and desktop notifications for OTR messages (when setting up the session) [jcbrand]
|
||||||
- New config option [default_state](https://conversejs.org/docs/html/configuration.html#default_state) [jcbrand]
|
- New config option [default_state](https://conversejs.org/docs/html/configuration.html#default_state) [jcbrand]
|
||||||
- New API method `converse.rooms.close()`
|
- New API method `converse.rooms.close()`
|
||||||
|
- New configuration setting [allow_muc_invites](https://conversejs.org/docs/html/configuration.html#allow-muc-invites) [jcbrand]
|
||||||
- #553 Add processing hints to OTR messages [jcbrand]
|
- #553 Add processing hints to OTR messages [jcbrand]
|
||||||
- #650 Don't ignore incoming messages with same JID as current user (might be MAM archived) [jcbrand]
|
- #650 Don't ignore incoming messages with same JID as current user (might be MAM archived) [jcbrand]
|
||||||
|
|
||||||
|
|
|
@ -141,6 +141,15 @@ allow_muc
|
||||||
Allow multi-user chat (muc) in chatrooms. Setting this to ``false`` will remove
|
Allow multi-user chat (muc) in chatrooms. Setting this to ``false`` will remove
|
||||||
the ``Chatrooms`` tab from the control box.
|
the ``Chatrooms`` tab from the control box.
|
||||||
|
|
||||||
|
allow_muc_invitations
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
* Default: ``true``
|
||||||
|
|
||||||
|
Allows users to be invited to join MUC chat rooms. An "Invite" widget will
|
||||||
|
appear in the sidebar of the chat room where you can type in the JID of a user
|
||||||
|
to invite into the chat room.
|
||||||
|
|
||||||
allow_otr
|
allow_otr
|
||||||
---------
|
---------
|
||||||
|
|
||||||
|
|
|
@ -74,9 +74,11 @@
|
||||||
Features: {
|
Features: {
|
||||||
addClientFeatures: function () {
|
addClientFeatures: function () {
|
||||||
this._super.addClientFeatures.apply(this, arguments);
|
this._super.addClientFeatures.apply(this, arguments);
|
||||||
converse.connection.disco.addFeature('jabber:x:conference'); // Invites
|
if (converse.allow_muc_invitations) {
|
||||||
if (this.allow_muc) {
|
converse.connection.disco.addFeature('jabber:x:conference'); // Invites
|
||||||
this.connection.disco.addFeature(Strophe.NS.MUC);
|
}
|
||||||
|
if (converse.allow_muc) {
|
||||||
|
converse.connection.disco.addFeature(Strophe.NS.MUC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -155,6 +157,7 @@
|
||||||
var converse = this.converse;
|
var converse = this.converse;
|
||||||
// Configuration values for this plugin
|
// Configuration values for this plugin
|
||||||
this.updateSettings({
|
this.updateSettings({
|
||||||
|
allow_muc_invitations: true,
|
||||||
allow_muc: true,
|
allow_muc: true,
|
||||||
auto_join_on_invite: false, // Auto-join chatroom on invite
|
auto_join_on_invite: false, // Auto-join chatroom on invite
|
||||||
auto_join_rooms: [], // List of maps {'jid': 'room@example.org', 'nick': 'WizardKing69' },
|
auto_join_rooms: [], // List of maps {'jid': 'room@example.org', 'nick': 'WizardKing69' },
|
||||||
|
@ -966,11 +969,15 @@
|
||||||
render: function () {
|
render: function () {
|
||||||
this.$el.html(
|
this.$el.html(
|
||||||
converse.templates.chatroom_sidebar({
|
converse.templates.chatroom_sidebar({
|
||||||
|
'allow_muc_invitations': converse.allow_muc_invitations,
|
||||||
'label_invitation': __('Invite'),
|
'label_invitation': __('Invite'),
|
||||||
'label_occupants': __('Occupants')
|
'label_occupants': __('Occupants')
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
return this.initInviteWidget();
|
if (converse.allow_muc_invitations) {
|
||||||
|
return this.initInviteWidget();
|
||||||
|
}
|
||||||
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
onOccupantAdded: function (item) {
|
onOccupantAdded: function (item) {
|
||||||
|
@ -1362,15 +1369,17 @@
|
||||||
};
|
};
|
||||||
converse.on('chatBoxesFetched', autoJoinRooms);
|
converse.on('chatBoxesFetched', autoJoinRooms);
|
||||||
|
|
||||||
var onConnected = function () {
|
if (converse.allow_muc_invitations) {
|
||||||
converse.connection.addHandler(
|
var onConnected = function () {
|
||||||
function (message) {
|
converse.connection.addHandler(
|
||||||
converse.onDirectMUCInvitation(message);
|
function (message) {
|
||||||
return true;
|
converse.onDirectMUCInvitation(message);
|
||||||
}, 'jabber:x:conference', 'message');
|
return true;
|
||||||
};
|
}, 'jabber:x:conference', 'message');
|
||||||
converse.on('connected', onConnected);
|
};
|
||||||
converse.on('reconnected', onConnected);
|
converse.on('connected', onConnected);
|
||||||
|
converse.on('reconnected', onConnected);
|
||||||
|
}
|
||||||
/* ------------------------------------------------------------ */
|
/* ------------------------------------------------------------ */
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
<!-- <div class="occupants"> -->
|
<!-- <div class="occupants"> -->
|
||||||
|
{[ if (allow_muc_invitations) { ]}
|
||||||
<form class="pure-form room-invite">
|
<form class="pure-form room-invite">
|
||||||
<input class="invited-contact" placeholder="{{label_invitation}}" type="text"/>
|
<input class="invited-contact" placeholder="{{label_invitation}}" type="text"/>
|
||||||
</form>
|
</form>
|
||||||
|
{[ } ]}
|
||||||
<p class="occupants-heading">{{label_occupants}}:</p>
|
<p class="occupants-heading">{{label_occupants}}:</p>
|
||||||
<ul class="occupant-list"></ul>
|
<ul class="occupant-list"></ul>
|
||||||
<!-- </div> -->
|
<!-- </div> -->
|
||||||
|
|
Loading…
Reference in New Issue
Block a user