|
@@ -122,13 +122,14 @@ var requests = {
|
|
|
cape: {}
|
|
|
};
|
|
|
|
|
|
-function push_request(userId, type, fun) {
|
|
|
+// add a request for +userId+ and +type+ to the queue
|
|
|
+function push_request(userId, type, callback) {
|
|
|
// avoid special properties (e.g. 'constructor')
|
|
|
var userId_safe = "!" + userId;
|
|
|
if (!requests[type][userId_safe]) {
|
|
|
requests[type][userId_safe] = [];
|
|
|
}
|
|
|
- requests[type][userId_safe].push(fun);
|
|
|
+ requests[type][userId_safe].push(callback);
|
|
|
}
|
|
|
|
|
|
// calls back all queued requests that match userId and type
|
|
@@ -162,7 +163,6 @@ function store_images(rid, userId, cache_details, type, callback) {
|
|
|
logging.debug(rid, "adding to request queue");
|
|
|
push_request(userId, type, callback);
|
|
|
} else {
|
|
|
- // add request to the queue
|
|
|
push_request(userId, type, callback);
|
|
|
|
|
|
networking.get_profile(rid, userId, function(err, profile) {
|