fix /nick command not working
This commit is contained in:
parent
1598640c80
commit
8701708b53
@ -24,6 +24,7 @@
|
||||
- Use the MUC stanza id when sending XEP-0333 markers
|
||||
- Add support for rendering unfurls via [mod_ogp](https://modules.prosody.im/mod_ogp.html)
|
||||
- Add a Description Of A Project (DOAP) file
|
||||
- #2497: Bugfix /nick command is not working
|
||||
|
||||
### Breaking Changes
|
||||
|
||||
|
@ -2271,7 +2271,7 @@ const ChatRoomMixin = {
|
||||
data.message = _converse.muc.info_messages[code];
|
||||
} else if (!is_self && ACTION_INFO_CODES.includes(code)) {
|
||||
const nick = Strophe.getResourceFromJid(stanza.getAttribute('from'));
|
||||
const item = stanza.querySelector(`x[xmlns="${Strophe.NS.MUC_USER}"] item`);
|
||||
const item = sizzle(`x[xmlns="${Strophe.NS.MUC_USER}"] item`, stanza).pop();
|
||||
data.actor = item ? item.querySelector('actor')?.getAttribute('nick') : undefined;
|
||||
data.reason = item ? item.querySelector('reason')?.textContent : undefined;
|
||||
data.message = this.getActionInfoMessage(code, nick, data.actor);
|
||||
@ -2281,7 +2281,7 @@ const ChatRoomMixin = {
|
||||
if (is_self && code === '210') {
|
||||
nick = Strophe.getResourceFromJid(stanza.getAttribute('from'));
|
||||
} else if (is_self && code === '303') {
|
||||
nick = stanza.querySelector(`x[xmlns="${Strophe.NS.MUC_USER}"] item`).getAttribute('nick');
|
||||
nick = sizzle(`x[xmlns="${Strophe.NS.MUC_USER}"] item`, stanza).pop().getAttribute('nick');
|
||||
}
|
||||
this.save('nick', nick);
|
||||
data.message = __(_converse.muc.new_nickname_messages[code], nick);
|
||||
|
Loading…
Reference in New Issue
Block a user