Commit affd08bd authored by Seve's avatar Seve Committed by JC Brand

Send user's hint if any

parent 98fe6062
......@@ -22,9 +22,9 @@
}
function getHint() {
let hint = document.querySelector('.chat-textarea-hint').value;
return hasHint() ? hint : _('Spoiler');
return document.querySelector('.chat-textarea-hint').value;
}
// The following line registers your plugin.
converse.plugins.add("converse-spoilers", {
......@@ -157,14 +157,15 @@
'overrides': {
'ChatBoxView': {
'createMessageStanza': function () {
debugger;
let messageStanza = this.__super__.createMessageStanza.apply(this, arguments);
if (isEditSpoilerMessage()) {
messageStanza.c('spoiler',{'xmlns': 'urn:xmpp:spoiler:0'}, getHint()); //TODO Check for hint or send __('Spoiler');
if (hasHint()){
messageStanza.c('spoiler',{'xmlns': 'urn:xmpp:spoiler:0'}, getHint());
} else {
messageStanza.c('spoiler',{'xmlns': 'urn:xmpp:spoiler:0'});
}
}
alert(messageStanza);
return messageStanza;
}
}
......
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