Converse upstream WIP.

This commit is contained in:
John Livingston
2024-07-15 14:20:44 +02:00
parent d0ab3d94ae
commit 6218d65b72
5 changed files with 12 additions and 14 deletions

View File

@ -117,7 +117,7 @@ export const livechatSpecificsPlugin = {
},
overrides: {
ChatRoom: {
getActionInfoMessage: function (this: any, code: string, nick: string, actor: any): any {
getActionInfoMessage: function getActionInfoMessage (this: any, code: string, nick: string, actor: any): any {
if (code === '303') {
// When there is numerous anonymous users joining at the same time,
// they can all change their nicknames at the same time, generating a log of action messages.
@ -130,6 +130,12 @@ export const livechatSpecificsPlugin = {
}
}
return this.__super__.getActionInfoMessage(code, nick, actor)
},
canPostMessages: function canPostMessages (this: any) {
// ConverseJS does not handle properly the visitor role in unmoderated rooms.
// See https://github.com/conversejs/converse.js/issues/3428 for more info.
// FIXME: if #3428 is fixed, remove this override.
return this.isEntered() && this.getOwnRole() !== 'visitor'
}
},
ChatRoomMessage: {