Add a return value to addDiscordMessages in state.js

This commit is contained in:
chylex 2016-10-25 16:57:32 +02:00
parent 810ef6d343
commit 4087684913

View File

@ -24,6 +24,8 @@ var STATE = (function(){
*/
var SETTINGS = function(){
defineTriggeringProperty(this, "setting", "autoscroll");
defineTriggeringProperty(this, "setting", "afterFirstMsg");
defineTriggeringProperty(this, "setting", "afterSavedMsg");
};
/*
@ -31,6 +33,8 @@ var STATE = (function(){
*/
SETTINGS.prototype._reset = function(){
this._autoscroll = true;
this._afterFirstMsg = "optPause";
this._afterSavedMsg = "optPause";
};
/*
@ -113,11 +117,15 @@ var STATE = (function(){
};
/*
* Adds all messages from the array to the specified channel.
* Adds all messages from the array to the specified channel. Returns true if the savefile was updated.
*/
CLS.prototype.addDiscordMessages = function(channelId, discordMessageArray){
if (this.getSavefile().addMessagesFromDiscord(channelId, discordMessageArray)){
triggerStateChanged("data", "messages");
return true;
}
else{
return false;
}
};