]> git.mxchange.org Git - friendica-addons.git/commitdiff
Diaspora: The hostname is now send, so that at Diaspora there is a line telling ...
authorMichael Vogel <icarus@dabo.de>
Tue, 22 Apr 2014 13:28:23 +0000 (15:28 +0200)
committerMichael Vogel <icarus@dabo.de>
Tue, 22 Apr 2014 13:28:23 +0000 (15:28 +0200)
diaspora/diasphp.php
diaspora/diaspora.php
fbsync/fbsync.php

index cb7a13cc7fe0323eabfcab63a8ec9275492c303d..589a581010495aaf6b9bb9ac86edc878875d0eca 100644 (file)
@@ -61,11 +61,12 @@ class Diasphp {
                return $this;
        }
 
-       function post($text) {
+       function post($text, $provider = "diasphp") {
                // post-daten vorbereiten
                $datatopost = json_encode(array(
                                'aspect_ids' => 'public',
-                               'status_message' => array('text' => $text)
+                               'status_message' => array('text' => $text,
+                                                       'provider_display_name' => $provider)
                ));
 
                // header vorbereiten
index c9eb337d2a1c6699b8f04fab4bad408ecc6830d7..45b59cc0e7c807f74a1b0c44b1532b7ea1c86492 100755 (executable)
@@ -39,6 +39,8 @@ function diaspora_jot_nets(&$a,&$b) {
 }
 
 function diaspora_queue_hook(&$a,&$b) {
+       $hostname = $a->get_hostname();
+
        $qi = q("SELECT * FROM `queue` WHERE `network` = '%s'",
                dbesc(NETWORK_DIASPORA2)
        );
@@ -85,7 +87,7 @@ function diaspora_queue_hook(&$a,&$b) {
                                logger('diaspora_queue: try to log in '.$diaspora_username, LOGGER_DEBUG);
                                $conn->login($diaspora_username, $diaspora_password);
                                logger('diaspora_queue: try to send '.$body, LOGGER_DEBUG);
-                               $conn->post($post);
+                               $conn->post($post, $hostname);
 
                                 logger('diaspora_queue: send '.$userdata['uid'].' success', LOGGER_DEBUG);
 
@@ -233,6 +235,7 @@ function diaspora_post_local(&$a,&$b) {
 
 
 function diaspora_send(&$a,&$b) {
+       $hostname = $a->get_hostname();
 
        logger('diaspora_send: invoked');
 
@@ -303,7 +306,7 @@ function diaspora_send(&$a,&$b) {
                        logger('diaspora_send: try to send '.$body, LOGGER_DEBUG);
 
                        //throw new Exception('Test');
-                       $conn->post($body);
+                       $conn->post($body, $hostname);
 
                        logger('diaspora_send: success');
                } catch (Exception $e) {
index d05d6e427feb1d0ad56e870ebd8739890573aa28..f6310ccfe63940611164e6a05934f0889dccc444 100644 (file)
@@ -177,7 +177,7 @@ function fbsync_cron($a,$b) {
                }
        }
 
-       logger('fbsync: cron_end');
+       logger('fbsync_cron: cron_end');
 
        set_config('fbsync','last_poll', time());
 }