});
req.go();
},
- getFeedInfo: function() {
+ getStatus: function() {
if (!blerg.API.loggedIn)
throw new Error('Cannot request feed status when not logged in');
var req = new enyo.Ajax({
- url: baseURL + '/feedinfo',
+ url: baseURL + '/status',
method: 'POST',
postBody: {
username: blerg.API.username
}
});
req.response(this, function(inSender, inResponse) {
- this.bubble('onFeedInfo', inResponse);
+ this.bubble('onStatus', inResponse);
+ });
+ req.go();
+ },
+ clearStatus: function(type) {
+ if (!blerg.API.loggedIn)
+ throw new Error('Cannot request feed status when not logged in');
+
+ if (!(type == 'feed' || type == 'mentioned'))
+ throw new Error('Invalid status clear type: ' + type);
+
+ var req = new enyo.Ajax({
+ url: baseURL + '/status',
+ method: 'POST',
+ postBody: {
+ username: blerg.API.username,
+ clear: type
+ }
+ });
+ req.response(this, function(inSender, inResponse) {
+ inResponse.type = type;
+ this.bubble('onClearStatus', inResponse);
});
req.go();
},
},
getSubscriptionStatus: function(username) {
var req = new enyo.Ajax({
- url: baseURL + '/feedinfo/' + username,
+ url: baseURL + '/status/' + username,
method: 'POST',
postBody: {
username: blerg.API.username