/*extra*/ null,
/*auto_increment*/ true),
new ColumnDef('profile_id', 'integer',
- null, true),
+ null, true, 'UNI'),
new ColumnDef('group_id', 'integer',
- null, true),
+ null, true, 'UNI'),
new ColumnDef('feeduri', 'varchar',
255, false, 'UNI'),
new ColumnDef('homeuri', 'varchar',
function keyTypes()
{
- return array('id' => 'K', 'feeduri' => 'U'); // @fixme we'll need a profile_id key at least
+ return array('id' => 'K', 'profile_id' => 'U', 'group_id' => 'U', 'feeduri' => 'U');
}
function sequenceKey()
/**
* Send a subscription request to the hub for this feed.
- * The hub will later send us a confirmation POST to /feedsub/callback.
+ * The hub will later send us a confirmation POST to /main/push/callback.
*
* @return bool true on success, false on failure
*/
- public function subscribe()
+ public function subscribe($mode='subscribe')
{
if (common_config('feedsub', 'nohub')) {
// Fake it! We're just testing remote feeds w/o hubs.
try {
$callback = common_local_url('pushcallback', array('feed' => $this->id));
$headers = array('Content-Type: application/x-www-form-urlencoded');
- $post = array('hub.mode' => 'subscribe',
+ $post = array('hub.mode' => $mode,
'hub.callback' => $callback,
'hub.verify' => 'async',
'hub.verify_token' => $this->verify_token,
}
}
+ /**
+ * Send an unsubscription request to the hub for this feed.
+ * The hub will later send us a confirmation POST to /main/push/callback.
+ *
+ * @return bool true on success, false on failure
+ */
+ public function unsubscribe() {
+ return $this->subscribe('unsubscribe');
+ }
+
/**
* Read and post notices for updates from the feed.
* Currently assumes that all items in the feed are new,