diff options
author | James Walker <walkah@walkah.net> | 2010-02-22 01:40:03 -0500 |
---|---|---|
committer | James Walker <walkah@walkah.net> | 2010-02-22 01:40:03 -0500 |
commit | 7b2ea7aa224c64cb0e44d4d445e07631a4cfeae3 (patch) | |
tree | adc502f1982cd16ab8e4798e989a2f4f2675c8a7 /plugins/OStatus/OStatusPlugin.php | |
parent | effa4f5d1efffcb52d4a95562e0b4831f7bd3435 (diff) | |
parent | 17ed30dffc1c05259baf2f0387089547e39684d7 (diff) |
Merge remote branch 'statusnet/testing' into testing
Diffstat (limited to 'plugins/OStatus/OStatusPlugin.php')
-rw-r--r-- | plugins/OStatus/OStatusPlugin.php | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php index 24ed23a00..7133e43a3 100644 --- a/plugins/OStatus/OStatusPlugin.php +++ b/plugins/OStatus/OStatusPlugin.php @@ -60,8 +60,6 @@ class OStatusPlugin extends Plugin $m->connect('main/push/callback/:feed', array('action' => 'pushcallback'), array('feed' => '[0-9]+')); - $m->connect('settings/feedsub', - array('action' => 'feedsubsettings')); // Salmon endpoint $m->connect('main/salmon/user/:id', @@ -203,16 +201,18 @@ class OStatusPlugin extends Plugin { $mentioned = $notice->getReplies(); - foreach ($mentioned as $profile) { + foreach ($mentioned as $profile_id) { - $oprofile = Ostatus_profile::staticGet('profile_id', $profile->id); + $oprofile = Ostatus_profile::staticGet('profile_id', $profile_id); if (!empty($oprofile) && !empty($oprofile->salmonuri)) { + common_log(LOG_INFO, "Sending notice '{$notice->uri}' to remote profile '{$oprofile->uri}'."); + // FIXME: this needs to go out in a queue handler $xml = '<?xml version="1.0" encoding="UTF-8" ?>'; - $xml .= $notice->asAtomEntry(); + $xml .= $notice->asAtomEntry(true, true); $salmon = new Salmon(); $salmon->post($oprofile->salmonuri, $xml); @@ -309,6 +309,7 @@ class OStatusPlugin extends Plugin function onCheckSchema() { $schema = Schema::get(); $schema->ensureTable('ostatus_profile', Ostatus_profile::schemaDef()); + $schema->ensureTable('ostatus_source', Ostatus_source::schemaDef()); $schema->ensureTable('feedsub', FeedSub::schemaDef()); $schema->ensureTable('hubsub', HubSub::schemaDef()); return true; @@ -488,4 +489,14 @@ class OStatusPlugin extends Plugin return true; } + + function onStartGetProfileUri($profile, &$uri) + { + $oprofile = Ostatus_profile::staticGet('profile_id', $profile->id); + if (!empty($oprofile)) { + $uri = $oprofile->uri; + return false; + } + return true; + } } |