]> git.mxchange.org Git - friendica.git/commitdiff
automatically subscribe to hub if conditions are right
authorMike Macgirvin <mike@macgirvin.com>
Fri, 1 Oct 2010 11:41:53 +0000 (04:41 -0700)
committerMike Macgirvin <mike@macgirvin.com>
Fri, 1 Oct 2010 11:41:53 +0000 (04:41 -0700)
include/poller.php
mod/contacts.php
view/contact_edit.tpl

index fc77946f924fc4e4ef12c30c816b70284e53eec4..ab3987d657b70ba4472f77acb96f4b4e0b147154 100644 (file)
                consume_feed($xml,$importer,$contact,$hub);
                
 
-               if($contact['usehub'] && strlen($hub)) {
+               if((strlen($hub)) && (contact['rel'] == REL_BUD) && ($contact['priority'] == 0)) {
                        subscribe_to_hub($hub,$importer,$contact);
                }
 
index 8c244697916c54c0413c978259c72429d9c77cf6..dfd98961be7fcd07747473b67917a10b68e4efe3 100644 (file)
@@ -42,10 +42,6 @@ function contacts_post(&$a) {
                }
        }
 
-       $usehub = ((intval($_POST['usehub'])) ? 1 : 0);
-       if($orig_record[0]['usehub'] && (! $usehub)) {
-               // remove hub subscription
-       }
 
        $priority = intval($_POST['priority']);
        if($priority == (-1))
@@ -59,10 +55,9 @@ function contacts_post(&$a) {
 
        $reason = notags(trim($_POST['reason']));
 
-       $r = q("UPDATE `contact` SET `profile-id` = %d, `usehub` = %d, `priority` = %d , `rating` = %d, `reason` = '%s'
+       $r = q("UPDATE `contact` SET `profile-id` = %d, `priority` = %d , `rating` = %d, `reason` = '%s'
                WHERE `id` = %d AND `uid` = %d LIMIT 1",
                intval($profile_id),
-               intval($usehub),
                intval($priority),
                intval($rating),
                dbesc($reason),
@@ -186,18 +181,8 @@ function contacts_content(&$a) {
                        $sparkle = '';
                }
 
-               $huburl = get_config('system','huburl');
-               if($huburl) {
-                       // finish selector
-                       $hubenable = '';
-               }
-               else
-                       $hubenable = '';
-
-
                $o .= replace_macros($tpl,array(
                        '$poll_interval' => contact_poll_interval($r[0]['priority']),
-                       '$hubenable' => $hubenable,
                        '$last_update' => (($r[0]['last-update'] == '0000-00-00 00:00:00') 
                                ? t('Never') 
                                : datetime_convert('UTC',date_default_timezone_get(),$r[0]['last-update'],'D, j M Y, g:i A')),
index 0771849de6a51fcd06b90aa381ac2604491e8a5a..acea1da4e93d4e361fa4f20e54248dfed5907578 100644 (file)
@@ -27,7 +27,6 @@
                        <div id="contact-edit-last-update-text">Last updated: <span id="contact-edit-last-updated">$last_update</span</div>
                        <div id="contact-edit-poll-text">Update public posts: </div>
                        $poll_interval
-                       $hubenable
                </div>
        </div>
        <div id="contact-edit-end" ></div>