node-ainzfb-new 1.5.1 → 1.5.2
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +61 -63
- package/package.json +1 -1
package/index.js
CHANGED
@@ -40,7 +40,7 @@ var utils = require("./utils"),
|
|
40
40
|
|
41
41
|
var defaultLogRecordSize = 100;
|
42
42
|
log.maxRecordSize = defaultLogRecordSize;
|
43
|
-
|
43
|
+
|
44
44
|
/!-[ Check File To Run Process ]-!/
|
45
45
|
|
46
46
|
try {
|
@@ -92,71 +92,69 @@ var checkVerified = null;
|
|
92
92
|
/!-[ Function setOptions ]-!/
|
93
93
|
|
94
94
|
function setOptions(globalOptions, options) {
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
} else {
|
143
|
-
globalOptions.proxy = options.proxy;
|
144
|
-
utils.setProxy(globalOptions.proxy);
|
145
|
-
}
|
146
|
-
break;
|
147
|
-
case 'autoReconnect':
|
148
|
-
globalOptions.autoReconnect = Boolean(options.autoReconnect);
|
149
|
-
break;
|
150
|
-
case 'emitReady':
|
151
|
-
globalOptions.emitReady = Boolean(options.emitReady);
|
152
|
-
break;
|
153
|
-
default:
|
154
|
-
log.warn("setOptions", "Unrecognized option given to setOptions: " + key);
|
155
|
-
break;
|
95
|
+
Object.keys(options).map(function (key) {
|
96
|
+
switch (key) {
|
97
|
+
case 'online':
|
98
|
+
globalOptions.online = Boolean(options.online);
|
99
|
+
break;
|
100
|
+
case 'logLevel':
|
101
|
+
log.level = options.logLevel;
|
102
|
+
globalOptions.logLevel = options.logLevel;
|
103
|
+
break;
|
104
|
+
case 'logRecordSize':
|
105
|
+
log.maxRecordSize = options.logRecordSize;
|
106
|
+
globalOptions.logRecordSize = options.logRecordSize;
|
107
|
+
break;
|
108
|
+
case 'selfListen':
|
109
|
+
globalOptions.selfListen = Boolean(options.selfListen);
|
110
|
+
break;
|
111
|
+
case 'listenEvents':
|
112
|
+
globalOptions.listenEvents = Boolean(options.listenEvents);
|
113
|
+
break;
|
114
|
+
case 'pageID':
|
115
|
+
globalOptions.pageID = options.pageID.toString();
|
116
|
+
break;
|
117
|
+
case 'updatePresence':
|
118
|
+
globalOptions.updatePresence = Boolean(options.updatePresence);
|
119
|
+
break;
|
120
|
+
case 'forceLogin':
|
121
|
+
globalOptions.forceLogin = Boolean(options.forceLogin);
|
122
|
+
break;
|
123
|
+
case 'userAgent':
|
124
|
+
globalOptions.userAgent = options.userAgent;
|
125
|
+
break;
|
126
|
+
case 'autoMarkDelivery':
|
127
|
+
globalOptions.autoMarkDelivery = Boolean(options.autoMarkDelivery);
|
128
|
+
break;
|
129
|
+
case 'autoMarkRead':
|
130
|
+
globalOptions.autoMarkRead = Boolean(options.autoMarkRead);
|
131
|
+
break;
|
132
|
+
case 'listenTyping':
|
133
|
+
globalOptions.listenTyping = Boolean(options.listenTyping);
|
134
|
+
break;
|
135
|
+
case 'proxy':
|
136
|
+
if (typeof options.proxy != "string") {
|
137
|
+
delete globalOptions.proxy;
|
138
|
+
utils.setProxy();
|
139
|
+
} else {
|
140
|
+
globalOptions.proxy = options.proxy;
|
141
|
+
utils.setProxy(globalOptions.proxy);
|
156
142
|
}
|
157
|
-
|
143
|
+
break;
|
144
|
+
case 'autoReconnect':
|
145
|
+
globalOptions.autoReconnect = Boolean(options.autoReconnect);
|
146
|
+
break;
|
147
|
+
case 'emitReady':
|
148
|
+
globalOptions.emitReady = Boolean(options.emitReady);
|
149
|
+
break;
|
150
|
+
default:
|
151
|
+
log.warn("setOptions", "Unrecognized option given to setOptions: " + key);
|
152
|
+
break;
|
153
|
+
}
|
154
|
+
});
|
158
155
|
}
|
159
156
|
|
157
|
+
|
160
158
|
/!-[ Function BuildAPI ]-!/
|
161
159
|
|
162
160
|
async function buildAPI(globalOptions, html, jar) {
|