]> git.mxchange.org Git - friendica-addons.git/blobdiff - discourse/discourse.php
fix $_POST variable
[friendica-addons.git] / discourse / discourse.php
index 5e64c173e691eea04d7bbc0214137a58170ad9f1..f52edb9fb74597294cc1aa9127aead42e850e6ba 100644 (file)
@@ -106,7 +106,7 @@ function discourse_email_getmessage(App $a, &$message)
        }
 
        // Remove the title on comments, they don't serve any purpose there
-       if ($message['item']['parent-uri'] != $message['item']['uri']) {
+       if ($message['item']['thr-parent'] != $message['item']['uri']) {
                unset($message['item']['title']);
        }
 }
@@ -114,7 +114,7 @@ function discourse_email_getmessage(App $a, &$message)
 function discourse_fetch_post($host, $topic, $pid)
 {
        $url = $host . '/t/' . $topic . '/' . $pid . '.json';
-       $curlResult = DI::httpRequest()->curl($url);
+       $curlResult = DI::httpRequest()->get($url);
        if (!$curlResult->isSuccess()) {
                Logger::info('No success', ['url' => $url]);
                return false;
@@ -151,7 +151,7 @@ function discourse_fetch_post_from_api(&$message, $post, $host)
 {
        $hostaddr = 'https://' . $host;
        $url = $hostaddr . '/posts/' . $post . '.json';
-       $curlResult = DI::httpRequest()->curl($url);
+       $curlResult = DI::httpRequest()->get($url);
        if (!$curlResult->isSuccess()) {
                return false;
        }
@@ -203,7 +203,7 @@ function discourse_get_user($post, $hostaddr)
                $avatar = $contact['photo'];
                unset($contact['photo']);
                DBA::update('contact', $contact, ['id' => $contact['id']]);
-               Contact::updateAvatar($avatar, 0, $contact['id']);
+               Contact::updateAvatar($contact['id'], $avatar);
                $contact['photo'] = $avatar;
        }