]> git.mxchange.org Git - friendica-addons.git/blobdiff - diaspora/diaspora.php
Reduce the opacity of the network settings icon when disabled.
[friendica-addons.git] / diaspora / diaspora.php
index c9eb337d2a1c6699b8f04fab4bad408ecc6830d7..dfefff71a619037a8d5c37a3ee5120fd833a2dc4 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);
 
@@ -117,8 +119,8 @@ function diaspora_settings(&$a,&$s) {
        /* Get the current state of our config variables */
 
        $enabled = get_pconfig(local_user(),'diaspora','post');
-
        $checked = (($enabled) ? ' checked="checked" ' : '');
+       $css = (($enabled) ? '' : '-disabled');
 
        $def_enabled = get_pconfig(local_user(),'diaspora','post_by_default');
 
@@ -144,11 +146,11 @@ function diaspora_settings(&$a,&$s) {
        /* Add some HTML to the existing form */
 
        $s .= '<span id="settings_diaspora_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_diaspora_expanded\'); openClose(\'settings_diaspora_inflated\');">';
-       $s .= '<h3>' . t('Diaspora Export') . '</h3>';
+       $s .= '<img class="connector'.$css.'" src="images/diaspora-logo.png" /><h3 class="connector">'. t('Diaspora Export').'</h3>';
        $s .= '</span>';
        $s .= '<div id="settings_diaspora_expanded" class="settings-block" style="display: none;">';
        $s .= '<span class="fakelink" onclick="openClose(\'settings_diaspora_expanded\'); openClose(\'settings_diaspora_inflated\');">';
-       $s .= '<h3>' . t('Diaspora Export') . '</h3>';
+       $s .= '<img class="connector'.$css.'" src="images/diaspora-logo.png" /><h3 class="connector">'. t('Diaspora Export').'</h3>';
        $s .= '</span>';
 
        if ($status) {
@@ -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) {