diff options
author | Friendika <info@friendika.com> | 2011-09-22 04:11:39 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-09-22 04:11:39 -0700 |
commit | d6b446d63ffe589429394b5937b67ec666bbe219 (patch) | |
tree | 3dfe4e641324b68de0bc93729717aa7afe428562 /include/items.php | |
parent | a6edf2f71cdb8640ad9f9bee3f237684bd8530db (diff) | |
download | volse-hubzilla-d6b446d63ffe589429394b5937b67ec666bbe219.tar.gz volse-hubzilla-d6b446d63ffe589429394b5937b67ec666bbe219.tar.bz2 volse-hubzilla-d6b446d63ffe589429394b5937b67ec666bbe219.zip |
starting the big delivery shakeup
Diffstat (limited to 'include/items.php')
-rw-r--r-- | include/items.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/items.php b/include/items.php index b433381a7..da5a18cad 100644 --- a/include/items.php +++ b/include/items.php @@ -1615,13 +1615,18 @@ function lose_follower($importer,$contact,$datarray,$item) { } -function subscribe_to_hub($url,$importer,$contact) { +function subscribe_to_hub($url,$importer,$contact,$submode = 'subscribe') { if(is_array($importer)) { $r = q("SELECT `nickname` FROM `user` WHERE `uid` = %d LIMIT 1", intval($importer['uid']) ); } + + // Diaspora has different message-ids in feeds than they do + // through the direct Diaspora protocol. If we try and use + // the feed, we'll get duplicates. So don't. + if((! count($r)) || $contact['network'] === NETWORK_DIASPORA) return; @@ -1631,7 +1636,7 @@ function subscribe_to_hub($url,$importer,$contact) { $verify_token = ((strlen($contact['hub-verify'])) ? $contact['hub-verify'] : random_string()); - $params= 'hub.mode=subscribe&hub.callback=' . urlencode($push_url) . '&hub.topic=' . urlencode($contact['poll']) . '&hub.verify=async&hub.verify_token=' . $verify_token; + $params= 'hub.mode=' . $hubmode . '&hub.callback=' . urlencode($push_url) . '&hub.topic=' . urlencode($contact['poll']) . '&hub.verify=async&hub.verify_token=' . $verify_token; logger('subscribe_to_hub: subscribing ' . $contact['name'] . ' to hub ' . $url . ' with verifier ' . $verify_token); |