Fixed some caching issues and list issue

When leaving a server, it is now removed from the known list. Also, the
list "removeElement" function is improved to actually work!
This commit is contained in:
hydrabolt
2015-08-12 23:33:27 +01:00
parent f306d7bd5e
commit 5fc8a096c1
2 changed files with 13 additions and 12 deletions

View File

@@ -238,17 +238,18 @@ exports.Client.prototype.createServer = function( _name, _region, cb ) {
}
exports.Client.prototype.leaveServer = function( server, cb ){
exports.Client.prototype.leaveServer = function( server, cb ) {
var client = this;
request
.del( Endpoints.SERVERS + "/" + server.id)
.del( Endpoints.SERVERS + "/" + server.id )
.set( "authorization", client.token )
.end( function(err, res){
.end( function( err, res ) {
if ( !res.ok ) {
cb( err );
} else {
client.serverList.removeElement( server );
cb( null );
}
} );
@@ -277,7 +278,7 @@ exports.Client.prototype.createInvite = function( channel, options, cb ) {
if ( !res.ok ) {
cb( err );
} else {
cb( false, new Invite(res.body) );
cb( false, new Invite( res.body ) );
}
} )