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

Send user's hint if any

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