diff options
author | Brion Vibber <brion@pobox.com> | 2010-02-11 20:12:48 +0000 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-02-11 20:12:48 +0000 |
commit | 1773d12a24d2720cdb6c1b517999cac1f708b355 (patch) | |
tree | a16c084b4c88e9a4e788b695e719472e0f62eeb2 | |
parent | 21bfbc43ad026afdab4040713805913000fef626 (diff) |
OStatus: save Salmon postback URI in feed subscription info, if provided. Will need it for sub/unsub postbacks and other notifications.
-rw-r--r-- | plugins/OStatus/classes/Feedinfo.php | 9 | ||||
-rw-r--r-- | plugins/OStatus/lib/feedmunger.php | 11 |
2 files changed, 16 insertions, 4 deletions
diff --git a/plugins/OStatus/classes/Feedinfo.php b/plugins/OStatus/classes/Feedinfo.php index e71b0cfa0..5b8a9039a 100644 --- a/plugins/OStatus/classes/Feedinfo.php +++ b/plugins/OStatus/classes/Feedinfo.php @@ -93,11 +93,12 @@ class Feedinfo extends Memcached_DataObject 'group_id' => DB_DATAOBJECT_INT, 'feeduri' => DB_DATAOBJECT_STR + DB_DATAOBJECT_NOTNULL, 'homeuri' => DB_DATAOBJECT_STR + DB_DATAOBJECT_NOTNULL, - 'huburi' => DB_DATAOBJECT_STR + DB_DATAOBJECT_NOTNULL, + 'huburi' => DB_DATAOBJECT_STR, 'secret' => DB_DATAOBJECT_STR, 'verify_token' => DB_DATAOBJECT_STR, 'sub_start' => DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME, 'sub_end' => DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME, + 'salmonuri' => DB_DATAOBJECT_STR, 'created' => DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME + DB_DATAOBJECT_NOTNULL, 'lastupdate' => DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME + DB_DATAOBJECT_NOTNULL); } @@ -119,8 +120,8 @@ class Feedinfo extends Memcached_DataObject 255, false, 'UNI'), new ColumnDef('homeuri', 'varchar', 255, false), - new ColumnDef('huburi', 'varchar', - 255, false), + new ColumnDef('huburi', 'text', + null, true), new ColumnDef('verify_token', 'varchar', 32, true), new ColumnDef('secret', 'varchar', @@ -129,6 +130,8 @@ class Feedinfo extends Memcached_DataObject null, true), new ColumnDef('sub_end', 'datetime', null, true), + new ColumnDef('salmonuri', 'text', + null, true), new ColumnDef('created', 'datetime', null, false), new ColumnDef('lastupdate', 'datetime', diff --git a/plugins/OStatus/lib/feedmunger.php b/plugins/OStatus/lib/feedmunger.php index 7f223cb20..25b0a0931 100644 --- a/plugins/OStatus/lib/feedmunger.php +++ b/plugins/OStatus/lib/feedmunger.php @@ -89,6 +89,10 @@ class FeedMunger $feedinfo->feeduri = $this->url; $feedinfo->homeuri = $this->feed->link; $feedinfo->huburi = $this->getHubLink(); + $salmon = $this->getSalmonLink(); + if ($salmon) { + $feedinfo->salmonuri = $salmon; + } return $feedinfo; } @@ -154,7 +158,12 @@ class FeedMunger { return $this->getAtomLink($this->feed, array('rel' => 'hub')); } - + + function getSalmonLink() + { + return $this->getAtomLink($this->feed, array('rel' => 'salmon')); + } + function getSelfLink() { return $this->getAtomLink($this->feed, array('rel' => 'self')); |