Send user's hint if any
This commit is contained in:
parent
98fe606222
commit
affd08bdaa
@ -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;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user