mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 17:24:24 +02:00
cleanup
This commit is contained in:
parent
e3546c38fa
commit
aa74dda9f3
1 changed files with 9 additions and 11 deletions
|
@ -16,6 +16,13 @@
|
||||||
(function () { // BEGIN LOCAL_SCOPE
|
(function () { // BEGIN LOCAL_SCOPE
|
||||||
|
|
||||||
var request = Script.require('request').request;
|
var request = Script.require('request').request;
|
||||||
|
var DEBUG = false;
|
||||||
|
function debug() {
|
||||||
|
if (!DEBUG) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
print([].map.call(arguments, JSON.stringify));
|
||||||
|
}
|
||||||
|
|
||||||
var gotoQmlSource = "TabletAddressDialog.qml";
|
var gotoQmlSource = "TabletAddressDialog.qml";
|
||||||
var buttonName = "GOTO";
|
var buttonName = "GOTO";
|
||||||
|
@ -101,14 +108,6 @@
|
||||||
tablet.screenChanged.connect(onScreenChanged);
|
tablet.screenChanged.connect(onScreenChanged);
|
||||||
|
|
||||||
var stories = {}, pingPong = false;
|
var stories = {}, pingPong = false;
|
||||||
var DEBUG = true; //fixme
|
|
||||||
function debug() {
|
|
||||||
if (!DEBUG) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
print([].map.call(arguments, JSON.stringify));
|
|
||||||
}
|
|
||||||
|
|
||||||
function expire(id) {
|
function expire(id) {
|
||||||
request({
|
request({
|
||||||
uri: location.metaverseServerUrl + '/api/v1/user_stories/' + id,
|
uri: location.metaverseServerUrl + '/api/v1/user_stories/' + id,
|
||||||
|
@ -123,7 +122,7 @@
|
||||||
}
|
}
|
||||||
function pollForAnnouncements() {
|
function pollForAnnouncements() {
|
||||||
// We could bail now if !Account.isLoggedIn(), but what if we someday have system-wide announcments?
|
// We could bail now if !Account.isLoggedIn(), but what if we someday have system-wide announcments?
|
||||||
var actions = DEBUG ? 'snapshot' : 'announcement';
|
var actions = 'announcement';
|
||||||
var count = DEBUG ? 10 : 100;
|
var count = DEBUG ? 10 : 100;
|
||||||
var options = [
|
var options = [
|
||||||
'now=' + new Date().toISOString(),
|
'now=' + new Date().toISOString(),
|
||||||
|
@ -134,7 +133,6 @@
|
||||||
'per_page=' + count
|
'per_page=' + count
|
||||||
];
|
];
|
||||||
var url = location.metaverseServerUrl + '/api/v1/user_stories?' + options.join('&');
|
var url = location.metaverseServerUrl + '/api/v1/user_stories?' + options.join('&');
|
||||||
url = 'https://highfidelity.com/api/v1/user_stories?include_actions=announcement'; //fixme remove
|
|
||||||
request({
|
request({
|
||||||
uri: url
|
uri: url
|
||||||
}, function (error, data) {
|
}, function (error, data) {
|
||||||
|
@ -148,7 +146,7 @@
|
||||||
data.user_stories.forEach(function (story) {
|
data.user_stories.forEach(function (story) {
|
||||||
var stored = stories[story.id], storedOrNew = stored || story;
|
var stored = stories[story.id], storedOrNew = stored || story;
|
||||||
debug('story exists:', !!stored, storedOrNew);
|
debug('story exists:', !!stored, storedOrNew);
|
||||||
if ((storedOrNew.username === Account.username) && (storyOrNew.place_name !== location.placename)) {
|
if ((storedOrNew.username === Account.username) && (storedOrNew.place_name !== location.placename)) {
|
||||||
expire(story.id);
|
expire(story.id);
|
||||||
return; // before marking
|
return; // before marking
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue