Store the hub that was used for Websub subscription
[phinde.git] / bin / subscribe.php
index 7d05f79a80af930a4b83b0702391691c3e5e5013..9df5b08c484307c6bc692a003aa111ab971e0de3 100755 (executable)
@@ -45,7 +45,7 @@ if ($topic != $url) {
 
 $sub = $subDb->get($topic);
 if ($sub === false) {
 
 $sub = $subDb->get($topic);
 if ($sub === false) {
-    $subDb->create($topic);
+    $subDb->create($topic, $hub);
 } else {
     Log::info(
         'Topic exists already in subscription table with status '
 } else {
     Log::info(
         'Topic exists already in subscription table with status '
@@ -53,6 +53,7 @@ if ($sub === false) {
     );
     Log::info('Renewing subscription...');
     $subDb->renew($sub->sub_id);
     );
     Log::info('Renewing subscription...');
     $subDb->renew($sub->sub_id);
+    $hub = $sub->sub_hub;
 }
 $sub = $subDb->get($topic);
 
 }
 $sub = $subDb->get($topic);