Commit 0957b708 authored by Christoph Scholz's avatar Christoph Scholz Committed by JC Brand

Don't prompt for reason if auto_join_on_invite

parent ce539ac6
......@@ -21,6 +21,7 @@
- #1457: Wrong tooltip shown for "unbookmark" icon
- #1479: Allow file upload by drag & drop also in MUCs
- #1487: New config option [muc_respect_autojoin](https://conversejs.org/docs/html/configuration.html#muc-respect-autojoin)
- #1501: Don't prompt for a reason if [auto_join_on_invite](https://conversejs.org/docs/html/configuration.html#auto-join-on-invite) is `true`
......
......@@ -55708,7 +55708,11 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_6__["default"].plugins
},
promptForInvite(suggestion) {
const reason = prompt(__('You are about to invite %1$s to the groupchat "%2$s". ' + 'You may optionally include a message, explaining the reason for the invitation.', suggestion.text.label, this.model.get('id')));
let reason = '';
if (!_converse.auto_join_on_invite) {
reason = prompt(__('You are about to invite %1$s to the groupchat "%2$s". ' + 'You may optionally include a message, explaining the reason for the invitation.', suggestion.text.label, this.model.get('id')));
}
if (reason !== null) {
this.chatroomview.model.directInvite(suggestion.text.value, reason);
......@@ -363,6 +363,7 @@ auto_join_on_invite
* Default: ``false``
If true, the user will automatically join a chatroom on invite without any confirm.
Also inviting users won't be prompted for a reason.
auto_join_private_chats
......
......@@ -1948,11 +1948,14 @@ converse.plugins.add('converse-muc-views', {
promptForInvite (suggestion) {
const reason = prompt(
__('You are about to invite %1$s to the groupchat "%2$s". '+
'You may optionally include a message, explaining the reason for the invitation.',
suggestion.text.label, this.model.get('id'))
);
let reason = '';
if (!_converse.auto_join_on_invite) {
reason = prompt(
__('You are about to invite %1$s to the groupchat "%2$s". '+
'You may optionally include a message, explaining the reason for the invitation.',
suggestion.text.label, this.model.get('id'))
);
}
if (reason !== null) {
this.chatroomview.model.directInvite(suggestion.text.value, reason);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment