mirror of
https://github.com/DoctorMcKay/node-steamcommunity.git
synced 2025-01-31 03:22:31 +08:00
Ignore chat friendstate responses if we no longer care
This commit is contained in:
parent
03e0a1bdac
commit
5875f47ebc
@ -158,7 +158,7 @@ SteamCommunity.prototype._chatPoll = function() {
|
|||||||
},
|
},
|
||||||
"json": true
|
"json": true
|
||||||
}, function(err, response, body) {
|
}, function(err, response, body) {
|
||||||
if(self.chatState == SteamCommunity.ChatState.Offline) {
|
if (self.chatState == SteamCommunity.ChatState.Offline) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -219,12 +219,20 @@ SteamCommunity.prototype._relogWebChat = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
SteamCommunity.prototype._chatUpdatePersona = function(steamID) {
|
SteamCommunity.prototype._chatUpdatePersona = function(steamID) {
|
||||||
|
if (!this.chatFriends || self.chatState == SteamCommunity.ChatState.Offline) {
|
||||||
|
return; // we no longer care
|
||||||
|
}
|
||||||
|
|
||||||
this.emit('debug', 'Updating persona data for ' + steamID);
|
this.emit('debug', 'Updating persona data for ' + steamID);
|
||||||
var self = this;
|
var self = this;
|
||||||
this.httpRequest({
|
this.httpRequest({
|
||||||
"uri": "https://steamcommunity.com/chat/friendstate/" + steamID.accountid,
|
"uri": "https://steamcommunity.com/chat/friendstate/" + steamID.accountid,
|
||||||
"json": true
|
"json": true
|
||||||
}, function(err, response, body) {
|
}, function(err, response, body) {
|
||||||
|
if (!self.chatFriends || self.chatState == SteamCommunity.ChatState.Offline) {
|
||||||
|
return; // welp
|
||||||
|
}
|
||||||
|
|
||||||
if(err || response.statusCode != 200) {
|
if(err || response.statusCode != 200) {
|
||||||
self.emit('debug', 'Chat update persona error: ' + (err ? err.message : "HTTP error " + response.statusCode));
|
self.emit('debug', 'Chat update persona error: ' + (err ? err.message : "HTTP error " + response.statusCode));
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user