Timeout api, and fixes it lead to

- timeout on api-calls with Retry-After present in header
- Fixed issue where when server restarts you are sometimes logged out for some reason
- README updates
This commit is contained in:
Kasper Rynning-Tønnesen
2018-03-01 14:55:23 +01:00
parent a6083d3402
commit 9839c0bdda
15 changed files with 225 additions and 153 deletions

View File

@@ -77,10 +77,18 @@ function skip(list, guid, coll, offline, socket) {
if(list !== undefined && list !== null && list !== "")
{
if(coll == "" || coll == undefined || coll == null) {
socket.emit("update_required");
return;
if(coll == undefined && list.hasOwnProperty('channel')) coll = list.channel;
if(coll !== undefined) {
try {
coll = list.channel;
if(coll.length == 0) return;
coll = emojiStrip(coll).toLowerCase();
coll = coll.replace("_", "");
coll = encodeURIComponent(coll).replace(/\W/g, '');
coll = filter.clean(coll);
} catch(e) {
return;
}
}
if(typeof(list.pass) != "string" || typeof(list.id) != "string" ||
typeof(list.channel) != "string" || typeof(list.userpass) != "string") {