Remove check for @
and for allow_non_roster_messaging
The second especially doesn't make sense and I'm currently not aware of a case headline stanzas with a JIDs containing `@` and with a body exist.
This commit is contained in:
parent
dffcc13dea
commit
eee7ff763e
14
dist/converse.js
vendored
14
dist/converse.js
vendored
@ -66434,13 +66434,8 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|||||||
const from_jid = message.getAttribute('from');
|
const from_jid = message.getAttribute('from');
|
||||||
|
|
||||||
if (utils.isHeadlineMessage(_converse, message)) {
|
if (utils.isHeadlineMessage(_converse, message)) {
|
||||||
if (_.includes(from_jid, '@') && !_converse.allow_non_roster_messaging) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_.isNull(message.querySelector('body'))) {
|
if (_.isNull(message.querySelector('body'))) {
|
||||||
// Avoid creating a chat box if we have nothing to show
|
// Avoid creating a chat box if we have nothing to show inside it.
|
||||||
// inside it.
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66458,12 +66453,13 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|||||||
'stanza': message
|
'stanza': message
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function registerHeadlineHandler() {
|
function registerHeadlineHandler() {
|
||||||
_converse.connection.addHandler(onHeadlineMessage, null, 'message');
|
_converse.connection.addHandler(message => {
|
||||||
|
onHeadlineMessage(message);
|
||||||
|
return true;
|
||||||
|
}, null, 'message');
|
||||||
}
|
}
|
||||||
|
|
||||||
_converse.on('connected', registerHeadlineHandler);
|
_converse.on('connected', registerHeadlineHandler);
|
||||||
|
@ -114,12 +114,8 @@
|
|||||||
/* Handler method for all incoming messages of type "headline". */
|
/* Handler method for all incoming messages of type "headline". */
|
||||||
const from_jid = message.getAttribute('from');
|
const from_jid = message.getAttribute('from');
|
||||||
if (utils.isHeadlineMessage(_converse, message)) {
|
if (utils.isHeadlineMessage(_converse, message)) {
|
||||||
if (_.includes(from_jid, '@') && !_converse.allow_non_roster_messaging) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (_.isNull(message.querySelector('body'))) {
|
if (_.isNull(message.querySelector('body'))) {
|
||||||
// Avoid creating a chat box if we have nothing to show
|
// Avoid creating a chat box if we have nothing to show inside it.
|
||||||
// inside it.
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const chatbox = _converse.chatboxes.create({
|
const chatbox = _converse.chatboxes.create({
|
||||||
@ -131,11 +127,13 @@
|
|||||||
chatbox.createMessage(message, message);
|
chatbox.createMessage(message, message);
|
||||||
_converse.emit('message', {'chatbox': chatbox, 'stanza': message});
|
_converse.emit('message', {'chatbox': chatbox, 'stanza': message});
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function registerHeadlineHandler () {
|
function registerHeadlineHandler () {
|
||||||
_converse.connection.addHandler(onHeadlineMessage, null, 'message');
|
_converse.connection.addHandler(message => {
|
||||||
|
onHeadlineMessage(message);
|
||||||
|
return true;
|
||||||
|
}, null, 'message');
|
||||||
}
|
}
|
||||||
_converse.on('connected', registerHeadlineHandler);
|
_converse.on('connected', registerHeadlineHandler);
|
||||||
_converse.on('reconnected', registerHeadlineHandler);
|
_converse.on('reconnected', registerHeadlineHandler);
|
||||||
|
Loading…
Reference in New Issue
Block a user