Skip to content

Commit

Permalink
Automatically register/unregister nicknames with MUCs
Browse files Browse the repository at this point in the history
  • Loading branch information
jcbrand committed Dec 23, 2024
1 parent 07a3b44 commit 558afde
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 15 deletions.
17 changes: 13 additions & 4 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 11.0.0 (Unreleased)

### Github Issues
- #122: Set horizontal layout direction based on the language
- #698: Add support for MUC private messages
- #1057: Removed the `mobile` view mode. Instead of setting `view_mode` to `mobile`, set it to `fullscreen`.
Expand All @@ -24,6 +25,8 @@
- #3476: better UI for form "fixed" fields
- #3478: MUC participant status indicator misplaced
- #3529: Unbookmarked channels no longer change their name when clicked with an unread indicator (or text icon)

### Bugfixes
- Fix: MUC occupant list does not sort itself on nicknames or roles changes
- Fix: refresh the MUC sidebar when participants collection is sorted
- Fix: room information not correctly refreshed when modifications are made by other users
Expand All @@ -33,22 +36,28 @@
- Fix: unhandled exception in disconnect function when controlbox is not shown by UI
- Fix: "Click to mention..." title was misplaced in MUC occupant list.
- Fix: removing the "add to contact" button in occupant modal in singleton mode (as there is no roster).
- Fix: trying to use emojis with an uppercase letter breaks the message field.
- Fix: renaming getEmojisByAtrribute to getEmojisByAttribute.

### Changes
- Upgrade to Bootstrap 5
- Add an occupants filter to the MUC sidebar
- Change contacts filter to rename the anachronistic `Online` state to `Available`.
- Enable [reuse_scram_keys](https://conversejs.org/docs/html/configuration.html#reuse-scram-keys) by default.
- New `loadEmojis` hook, to customize emojis at runtime.
- Upgrade to Bootstrap 5
- Add new themes 'Cyberpunk' and 'Nord' and remove the old 'Concord' theme.
- Improved accessibility.
- New "getOccupantActionButtons" hook, so that plugins can add actions on MUC occupants.
- MUC occupants badges: displays short labels, with full label as title.
- Fix: trying to use emojis with an uppercase letter breaks the message field.
- Fix: renaming getEmojisByAtrribute to getEmojisByAttribute.
- New config option [stanza_timeout](https://conversejs.org/docs/html/configuration.html#show-background)

### Default config changes
- Make `fullscreen` the default `view_mode`.
- Set `auto_register_muc_nickname` default to `'unregister'` so that your
nickname is automatically registered with a MUC upon entering and
unregistered upon explicitly leaving the MUC (by closing it).

### Breaking changes:

- Remove the old `_converse.BootstrapModal` in favor of `_converse.BaseModal` which is a web component.
- The connection is no longer available on the `_converse` object. Instead, use `api.connection.get()`.
- Add a new `exports` attribute on the `_converse` object which is meant for
Expand Down
2 changes: 1 addition & 1 deletion docs/source/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ or `electron <http://electron.atom.io/>`_.
auto_register_muc_nickname
--------------------------

* Default: ``false``
* Default: ``unregister``
* Allowed values: ``false``, ``true``, ``'unregister'``

If truthy, Converse will automatically register a user's nickname upon entering
Expand Down
18 changes: 8 additions & 10 deletions src/headless/plugins/muc/muc.js
Original file line number Diff line number Diff line change
Expand Up @@ -1716,17 +1716,15 @@ class MUC extends ModelWithMessages(ColorAwareModel(ChatBoxBase)) {
.c('value').t(nick)
);
} catch (e) {
if (u.isErrorStanza(e)) {
const err = await parseErrorStanza(e);
if (err?.name === 'service-unavailable') {
err_msg = __("Can't register your nickname in this groupchat, it doesn't support registration.");
} else if (err?.name === 'bad-request') {
err_msg = __("Can't register your nickname in this groupchat, invalid data form supplied.");
}
log.error(err_msg);
const err = await parseErrorStanza(e);
if (err?.name === 'service-unavailable') {
log.error("Can't register your nickname in this groupchat, it doesn't support registration.");
} else if (err?.name === 'bad-request') {
log.error("Can't register your nickname in this groupchat, invalid data form supplied.");
} else {
log.error(e);
}
log.error(e);
return err_msg;
throw err;
}
}

Expand Down

0 comments on commit 558afde

Please sign in to comment.