2014-09-20 10:55:41 +09:00
|
|
|
Meteor.methods({
|
|
|
|
phoneHome: function () {
|
2015-03-28 18:30:26 +09:00
|
|
|
|
2014-09-20 10:55:41 +09:00
|
|
|
var url = 'http://version.telescopeapp.org/';
|
|
|
|
|
2014-09-20 10:59:20 +09:00
|
|
|
var params = {
|
|
|
|
currentVersion: telescopeVersion,
|
2015-03-28 18:30:26 +09:00
|
|
|
siteTitle: Settings.get('title'),
|
2014-09-20 10:59:20 +09:00
|
|
|
siteUrl: getSiteUrl(),
|
|
|
|
users: Meteor.users.find().count(),
|
|
|
|
posts: Posts.find().count(),
|
|
|
|
comments: Comments.find().count()
|
|
|
|
}
|
|
|
|
|
2014-09-20 10:55:41 +09:00
|
|
|
if(Meteor.user() && isAdmin(Meteor.user())){
|
|
|
|
|
|
|
|
this.unblock();
|
|
|
|
try {
|
|
|
|
var result = HTTP.get(url, {
|
2014-09-20 10:59:20 +09:00
|
|
|
params: params
|
2014-09-20 10:55:41 +09:00
|
|
|
})
|
|
|
|
return result;
|
|
|
|
} catch (e) {
|
|
|
|
// Got a network error, time-out or HTTP error in the 400 or 500 range.
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2015-03-28 18:30:26 +09:00
|
|
|
})
|