Browse Source

New OStatus implementation

pull/3010/head
Michael Vogel 5 years ago
committed by Roland Haeder
parent
commit
f2ce7f51cd
No known key found for this signature in database GPG Key ID: B72F8185C6C7BD78
6 changed files with 1786 additions and 7 deletions
  1. +3
    -3
      include/items.php
  2. +1
    -1
      include/notifier.php
  3. +1
    -0
      include/ostatus.php
  4. +1778
    -0
      include/ostatus2.php
  5. +1
    -1
      include/pubsubpublish.php
  6. +2
    -2
      mod/salmon.php

+ 3
- 3
include/items.php View File

@ -383,9 +383,9 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa
// Converting the plink
if ($arr['network'] == NETWORK_OSTATUS) {
if (isset($arr['plink']))
$arr['plink'] = ostatus_convert_href($arr['plink']);
$arr['plink'] = ostatus::convert_href($arr['plink']);
elseif (isset($arr['uri']))
$arr['plink'] = ostatus_convert_href($arr['uri']);
$arr['plink'] = ostatus::convert_href($arr['uri']);
}
if(x($arr, 'gravity'))
@ -1243,7 +1243,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
//$tempfile = tempnam(get_temppath(), "ostatus2");
//file_put_contents($tempfile, $xml);
logger("Consume OStatus messages ", LOGGER_DEBUG);
ostatus_import($xml,$importer,$contact, $hub);
ostatus::import($xml,$importer,$contact, $hub);
}
return;
}


+ 1
- 1
include/notifier.php View File

@ -223,7 +223,7 @@ function notifier_run(&$argv, &$argc){
if(! ($mail || $fsuggest || $relocate)) {
$slap = ostatus_salmon($target_item,$owner);
$slap = ostatus::salmon($target_item,$owner);
require_once('include/group.php');


+ 1
- 0
include/ostatus.php View File

@ -12,6 +12,7 @@ require_once("include/Scrape.php");
require_once("include/follow.php");
require_once("include/api.php");
require_once("mod/proxy.php");
require_once("include/ostatus2.php");
define('OSTATUS_DEFAULT_POLL_INTERVAL', 30); // given in minutes
define('OSTATUS_DEFAULT_POLL_TIMEFRAME', 1440); // given in minutes


+ 1778
- 0
include/ostatus2.php
File diff suppressed because it is too large
View File


+ 1
- 1
include/pubsubpublish.php View File

@ -16,7 +16,7 @@ function handle_pubsubhubbub() {
logger("Generate feed for user ".$rr['nickname']." - last updated ".$rr['last_update'], LOGGER_DEBUG);
$params = ostatus_feed($a, $rr['nickname'], $rr['last_update']);
$params = ostatus::feed($a, $rr['nickname'], $rr['last_update']);
$hmac_sig = hash_hmac("sha1", $params, $rr['secret']);
$headers = array("Content-type: application/atom+xml",


+ 2
- 2
mod/salmon.php View File

@ -84,7 +84,7 @@ function salmon_post(&$a) {
// decode the data
$data = base64url_decode($data);
$author = ostatus_salmon_author($data,$importer);
$author = ostatus::salmon_author($data,$importer);
$author_link = $author["author-link"];
if(! $author_link) {
@ -181,7 +181,7 @@ function salmon_post(&$a) {
$contact_rec = ((count($r)) ? $r[0] : null);
ostatus_import($data,$importer,$contact_rec, $hub);
ostatus::import($data,$importer,$contact_rec, $hub);
http_status_exit(200);
}

Loading…
Cancel
Save