X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FOStatus%2FOStatusPlugin.php;h=7133e43a3cb211d3a2d9b1d1cd3d568ef9aa9a97;hb=2f65fa646acc9a0739e779de9e472b9957c2e7eb;hp=ec6f3f3b0ad43fd7fda7a057996273f679725edf;hpb=a0b64663be096ef0e2e1a9abd98a2dd45aa6657e;p=quix0rs-gnu-social.git diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php index ec6f3f3b0a..7133e43a3c 100644 --- a/plugins/OStatus/OStatusPlugin.php +++ b/plugins/OStatus/OStatusPlugin.php @@ -24,6 +24,8 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } +set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) . '/extlib/'); + class FeedSubException extends Exception { } @@ -205,10 +207,12 @@ class OStatusPlugin extends Plugin 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 .= $notice->asAtomEntry(); + $xml .= $notice->asAtomEntry(true, true); $salmon = new Salmon(); $salmon->post($oprofile->salmonuri, $xml); @@ -305,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; @@ -484,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; + } }