Browse Source

better handling of dead contacts

pull/335/head
friendica 10 years ago
parent
commit
be090cc851
  1. 2
      boot.php
  2. 4
      include/Contact.php
  3. 5
      include/onepoll.php
  4. 2
      mod/contacts.php
  5. 140
      util/messages.po
  6. 3
      view/contact_edit.tpl

2
boot.php

@ -10,7 +10,7 @@ require_once('include/nav.php');
require_once('include/cache.php');
define ( 'FRIENDICA_PLATFORM', 'Friendica');
define ( 'FRIENDICA_VERSION', '3.0.1373' );
define ( 'FRIENDICA_VERSION', '3.0.1374' );
define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
define ( 'DB_UPDATE_VERSION', 1149 );

4
include/Contact.php

@ -139,6 +139,10 @@ function terminate_friendship($user,$self,$contact) {
if(! function_exists('mark_for_death')) {
function mark_for_death($contact) {
if($contact['archive'])
return;
if($contact['term-date'] == '0000-00-00 00:00:00') {
q("UPDATE `contact` SET `term-date` = '%s' WHERE `id` = %d LIMIT 1",
dbesc(datetime_convert()),

5
include/onepoll.php

@ -139,15 +139,18 @@ function onepoll_run($argv, $argc){
. '&perm=' . $perm ;
$handshake_xml = fetch_url($url);
$html_code = $a->get_curl_code();
logger('onepoll: handshake with url ' . $url . ' returns xml: ' . $handshake_xml, LOGGER_DATA);
if(! $handshake_xml) {
if((! strlen($handshake_xml)) || ($html_code >= 400) || (! $html_code)) {
logger("poller: $url appears to be dead - marking for death ");
// dead connection - might be a transient event, or this might
// mean the software was uninstalled or the domain expired.
// Will keep trying for one month.
mark_for_death($contact);
// set the last-update so we don't keep polling

2
mod/contacts.php

@ -335,6 +335,7 @@ function contacts_content(&$a) {
$tab_tpl = get_markup_template('common_tabs.tpl');
$tab_str = replace_macros($tab_tpl, array('$tabs' => $tabs));
$lost_contact = (($contact['archive'] && $contact['term-date'] != '0000-00-00 00:00:00' && $contact['term-date'] < datetime_convert('','','now')) ? t('Communications lost with this contact!') : '');
$o .= replace_macros($tpl,array(
'$header' => t('Contact Editor'),
@ -359,6 +360,7 @@ function contacts_content(&$a) {
'$poll_interval' => contact_poll_interval($contact['priority'],(! $poll_enabled)),
'$poll_enabled' => $poll_enabled,
'$lastupdtext' => t('Last update:'),
'$lost_contact' => $lost_contact,
'$updpub' => t('Update public posts'),
'$last_update' => $last_update,
'$udnow' => t('Update now'),

140
util/messages.po

@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: 3.0.1373\n"
"Project-Id-Version: 3.0.1374\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-13 16:24-0700\n"
"POT-Creation-Date: 2012-06-14 10:00-0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -54,7 +54,7 @@ msgstr ""
#: ../../mod/follow.php:9 ../../mod/display.php:138 ../../mod/profiles.php:7
#: ../../mod/profiles.php:385 ../../mod/delegate.php:6
#: ../../mod/suggest.php:28 ../../mod/invite.php:13 ../../mod/invite.php:81
#: ../../mod/dfrn_confirm.php:53 ../../addon/facebook/facebook.php:503
#: ../../mod/dfrn_confirm.php:53 ../../addon/facebook/facebook.php:507
#: ../../addon/dav/layout.fnk.php:353 ../../include/items.php:3387
#: ../../index.php:299
msgid "Permission denied."
@ -133,7 +133,7 @@ msgstr ""
#: ../../mod/group.php:85 ../../mod/message.php:216 ../../mod/admin.php:420
#: ../../mod/admin.php:656 ../../mod/admin.php:792 ../../mod/admin.php:991
#: ../../mod/admin.php:1078 ../../mod/profiles.php:554
#: ../../mod/invite.php:119 ../../addon/facebook/facebook.php:605
#: ../../mod/invite.php:119 ../../addon/facebook/facebook.php:609
#: ../../addon/snautofollow/snautofollow.php:64
#: ../../addon/yourls/yourls.php:76 ../../addon/ljpost/ljpost.php:93
#: ../../addon/nsfw/nsfw.php:57 ../../addon/planets/planets.php:158
@ -141,7 +141,8 @@ msgstr ""
#: ../../addon/randplace/randplace.php:177 ../../addon/dwpost/dwpost.php:93
#: ../../addon/drpost/drpost.php:110 ../../addon/startpage/startpage.php:92
#: ../../addon/geonames/geonames.php:187 ../../addon/oembed.old/oembed.php:41
#: ../../addon/impressum/impressum.php:82 ../../addon/blockem/blockem.php:57
#: ../../addon/impressum/impressum.php:82
#: ../../addon/notimeline/notimeline.php:64 ../../addon/blockem/blockem.php:57
#: ../../addon/qcomment/qcomment.php:61
#: ../../addon/openstreetmap/openstreetmap.php:70
#: ../../addon/libertree/libertree.php:90 ../../addon/mathjax/mathjax.php:42
@ -1715,8 +1716,8 @@ msgstr ""
#: ../../mod/lostpass.php:45 ../../mod/lostpass.php:107
#: ../../mod/register.php:90 ../../mod/register.php:144
#: ../../mod/regmod.php:54 ../../mod/dfrn_confirm.php:752
#: ../../addon/facebook/facebook.php:688
#: ../../addon/facebook/facebook.php:1178
#: ../../addon/facebook/facebook.php:692
#: ../../addon/facebook/facebook.php:1182
#: ../../addon/public_server/public_server.php:62
#: ../../addon/testdrive/testdrive.php:67 ../../include/items.php:2792
#: ../../boot.php:703
@ -1864,7 +1865,7 @@ msgstr ""
msgid "Private forum has no privacy permissions and no default privacy group."
msgstr ""
#: ../../mod/settings.php:484 ../../addon/facebook/facebook.php:488
#: ../../mod/settings.php:484 ../../addon/facebook/facebook.php:492
#: ../../addon/impressum/impressum.php:77
#: ../../addon/openstreetmap/openstreetmap.php:80
#: ../../addon/mathjax/mathjax.php:66 ../../addon/piwik/piwik.php:105
@ -2409,7 +2410,7 @@ msgid "Personal Notes"
msgstr ""
#: ../../mod/notes.php:63 ../../mod/filer.php:30
#: ../../addon/facebook/facebook.php:756
#: ../../addon/facebook/facebook.php:760
#: ../../addon/privacy_image_cache/privacy_image_cache.php:185
#: ../../addon/dav/layout.fnk.php:384 ../../include/text.php:652
msgid "Save"
@ -2768,7 +2769,7 @@ msgid "People Search"
msgstr ""
#: ../../mod/like.php:185 ../../mod/like.php:259 ../../mod/tagger.php:70
#: ../../addon/facebook/facebook.php:1572
#: ../../addon/facebook/facebook.php:1576
#: ../../addon/communityhome/communityhome.php:158
#: ../../addon/communityhome/communityhome.php:167
#: ../../view/theme/diabook/theme.php:565
@ -2778,7 +2779,7 @@ msgstr ""
msgid "status"
msgstr ""
#: ../../mod/like.php:202 ../../addon/facebook/facebook.php:1576
#: ../../mod/like.php:202 ../../addon/facebook/facebook.php:1580
#: ../../addon/communityhome/communityhome.php:172
#: ../../view/theme/diabook/theme.php:579 ../../include/diaspora.php:1687
#: ../../include/conversation.php:65
@ -4254,83 +4255,83 @@ msgstr ""
msgid "%1$s has joined %2$s"
msgstr ""
#: ../../addon/facebook/facebook.php:509
#: ../../addon/facebook/facebook.php:513
msgid "Facebook disabled"
msgstr ""
#: ../../addon/facebook/facebook.php:514
#: ../../addon/facebook/facebook.php:518
msgid "Updating contacts"
msgstr ""
#: ../../addon/facebook/facebook.php:537
#: ../../addon/facebook/facebook.php:541
msgid "Facebook API key is missing."
msgstr ""
#: ../../addon/facebook/facebook.php:544
#: ../../addon/facebook/facebook.php:548
msgid "Facebook Connect"
msgstr ""
#: ../../addon/facebook/facebook.php:550
#: ../../addon/facebook/facebook.php:554
msgid "Install Facebook connector for this account."
msgstr ""
#: ../../addon/facebook/facebook.php:557
#: ../../addon/facebook/facebook.php:561
msgid "Remove Facebook connector"
msgstr ""
#: ../../addon/facebook/facebook.php:562
#: ../../addon/facebook/facebook.php:566
msgid ""
"Re-authenticate [This is necessary whenever your Facebook password is "
"changed.]"
msgstr ""
#: ../../addon/facebook/facebook.php:569
#: ../../addon/facebook/facebook.php:573
msgid "Post to Facebook by default"
msgstr ""
#: ../../addon/facebook/facebook.php:575
#: ../../addon/facebook/facebook.php:579
msgid ""
"Facebook friend linking has been disabled on this site. The following "
"settings will have no effect."
msgstr ""
#: ../../addon/facebook/facebook.php:579
#: ../../addon/facebook/facebook.php:583
msgid ""
"Facebook friend linking has been disabled on this site. If you disable it, "
"you will be unable to re-enable it."
msgstr ""
#: ../../addon/facebook/facebook.php:582
#: ../../addon/facebook/facebook.php:586
msgid "Link all your Facebook friends and conversations on this website"
msgstr ""
#: ../../addon/facebook/facebook.php:584
#: ../../addon/facebook/facebook.php:588
msgid ""
"Facebook conversations consist of your <em>profile wall</em> and your friend "
"<em>stream</em>."
msgstr ""
#: ../../addon/facebook/facebook.php:585
#: ../../addon/facebook/facebook.php:589
msgid "On this website, your Facebook friend stream is only visible to you."
msgstr ""
#: ../../addon/facebook/facebook.php:586
#: ../../addon/facebook/facebook.php:590
msgid ""
"The following settings determine the privacy of your Facebook profile wall "
"on this website."
msgstr ""
#: ../../addon/facebook/facebook.php:590
#: ../../addon/facebook/facebook.php:594
msgid ""
"On this website your Facebook profile wall conversations will only be "
"visible to you"
msgstr ""
#: ../../addon/facebook/facebook.php:595
#: ../../addon/facebook/facebook.php:599
msgid "Do not import your Facebook profile wall conversations"
msgstr ""
#: ../../addon/facebook/facebook.php:597
#: ../../addon/facebook/facebook.php:601
msgid ""
"If you choose to link conversations and leave both of these boxes unchecked, "
"your Facebook profile wall will be merged with your profile wall on this "
@ -4338,120 +4339,120 @@ msgid ""
"who may see the conversations."
msgstr ""
#: ../../addon/facebook/facebook.php:602
#: ../../addon/facebook/facebook.php:606
msgid "Comma separated applications to ignore"
msgstr ""
#: ../../addon/facebook/facebook.php:686
#: ../../addon/facebook/facebook.php:690
msgid "Problems with Facebook Real-Time Updates"
msgstr ""
#: ../../addon/facebook/facebook.php:714
#: ../../addon/facebook/facebook.php:718
#: ../../include/contact_selectors.php:81
msgid "Facebook"
msgstr ""
#: ../../addon/facebook/facebook.php:715
#: ../../addon/facebook/facebook.php:719
msgid "Facebook Connector Settings"
msgstr ""
#: ../../addon/facebook/facebook.php:730
#: ../../addon/facebook/facebook.php:734
msgid "Facebook API Key"
msgstr ""
#: ../../addon/facebook/facebook.php:740
#: ../../addon/facebook/facebook.php:744
msgid ""
"Error: it appears that you have specified the App-ID and -Secret in your ."
"htconfig.php file. As long as they are specified there, they cannot be set "
"using this form.<br><br>"
msgstr ""
#: ../../addon/facebook/facebook.php:745
#: ../../addon/facebook/facebook.php:749
msgid ""
"Error: the given API Key seems to be incorrect (the application access token "
"could not be retrieved)."
msgstr ""
#: ../../addon/facebook/facebook.php:747
#: ../../addon/facebook/facebook.php:751
msgid "The given API Key seems to work correctly."
msgstr ""
#: ../../addon/facebook/facebook.php:749
#: ../../addon/facebook/facebook.php:753
msgid ""
"The correctness of the API Key could not be detected. Somthing strange's "
"going on."
msgstr ""
#: ../../addon/facebook/facebook.php:752
#: ../../addon/facebook/facebook.php:756
msgid "App-ID / API-Key"
msgstr ""
#: ../../addon/facebook/facebook.php:753
#: ../../addon/facebook/facebook.php:757
msgid "Application secret"
msgstr ""
#: ../../addon/facebook/facebook.php:754
#: ../../addon/facebook/facebook.php:758
#, php-format
msgid "Polling Interval in minutes (minimum %1$s minutes)"
msgstr ""
#: ../../addon/facebook/facebook.php:755
#: ../../addon/facebook/facebook.php:759
msgid ""
"Synchronize comments (no comments on Facebook are missed, at the cost of "
"increased system load)"
msgstr ""
#: ../../addon/facebook/facebook.php:759
#: ../../addon/facebook/facebook.php:763
msgid "Real-Time Updates"
msgstr ""
#: ../../addon/facebook/facebook.php:763
#: ../../addon/facebook/facebook.php:767
msgid "Real-Time Updates are activated."
msgstr ""
#: ../../addon/facebook/facebook.php:764
#: ../../addon/facebook/facebook.php:768
msgid "Deactivate Real-Time Updates"
msgstr ""
#: ../../addon/facebook/facebook.php:766
#: ../../addon/facebook/facebook.php:770
msgid "Real-Time Updates not activated."
msgstr ""
#: ../../addon/facebook/facebook.php:766
#: ../../addon/facebook/facebook.php:770
msgid "Activate Real-Time Updates"
msgstr ""
#: ../../addon/facebook/facebook.php:785 ../../addon/dav/layout.fnk.php:360
#: ../../addon/facebook/facebook.php:789 ../../addon/dav/layout.fnk.php:360
msgid "The new values have been saved."
msgstr ""
#: ../../addon/facebook/facebook.php:809
#: ../../addon/facebook/facebook.php:813
msgid "Post to Facebook"
msgstr ""
#: ../../addon/facebook/facebook.php:907
#: ../../addon/facebook/facebook.php:911
msgid ""
"Post to Facebook cancelled because of multi-network access permission "
"conflict."
msgstr ""
#: ../../addon/facebook/facebook.php:1127
#: ../../addon/facebook/facebook.php:1131
msgid "View on Friendica"
msgstr ""
#: ../../addon/facebook/facebook.php:1160
#: ../../addon/facebook/facebook.php:1164
msgid "Facebook post failed. Queued for retry."
msgstr ""
#: ../../addon/facebook/facebook.php:1200
#: ../../addon/facebook/facebook.php:1204
msgid "Your Facebook connection became invalid. Please Re-authenticate."
msgstr ""
#: ../../addon/facebook/facebook.php:1201
#: ../../addon/facebook/facebook.php:1205
msgid "Facebook connection became invalid"
msgstr ""
#: ../../addon/facebook/facebook.php:1202
#: ../../addon/facebook/facebook.php:1206
#, php-format
msgid ""
"Hi %1$s,\n"
@ -5165,6 +5166,18 @@ msgstr ""
msgid "Report Bug"
msgstr ""
#: ../../addon/notimeline/notimeline.php:32
msgid "No Timeline settings updated."
msgstr ""
#: ../../addon/notimeline/notimeline.php:56
msgid "No Timeline Settings"
msgstr ""
#: ../../addon/notimeline/notimeline.php:58
msgid "Disable Archive selector on profile wall"
msgstr ""
#: ../../addon/blockem/blockem.php:51
msgid "\"Blockem\" Settings"
msgstr ""
@ -6980,7 +6993,8 @@ msgid "%1$s commented on [url=%2$s]your %3$s[/url]"
msgstr ""
#: ../../include/enotify.php:98
msgid "[Friendica:Notify] Comment to conversation #%1$d by %1$s"
#, php-format
msgid "[Friendica:Notify] Comment to conversation #%1$d by %2$s"
msgstr ""
#: ../../include/enotify.php:99
@ -7001,7 +7015,7 @@ msgstr ""
#: ../../include/enotify.php:111
#, php-format
msgid "%1$s posted to your profile wall at %1$s"
msgid "%1$s posted to your profile wall at %2$s"
msgstr ""
#: ../../include/enotify.php:113
@ -7153,7 +7167,7 @@ msgstr ""
msgid "You have a new follower at "
msgstr ""
#: ../../include/items.php:3456
#: ../../include/items.php:3452
msgid "Archives"
msgstr ""
@ -7256,29 +7270,29 @@ msgstr ""
msgid "stopped following"
msgstr ""
#: ../../include/Contact.php:203 ../../include/conversation.php:842
#: ../../include/Contact.php:214 ../../include/conversation.php:842
msgid "View Status"
msgstr ""
#: ../../include/Contact.php:204 ../../include/conversation.php:843
#: ../../include/Contact.php:215 ../../include/conversation.php:843
msgid "View Profile"
msgstr ""
#: ../../include/Contact.php:205 ../../include/conversation.php:844
#: ../../include/Contact.php:216 ../../include/conversation.php:844
msgid "View Photos"
msgstr ""
#: ../../include/Contact.php:206 ../../include/Contact.php:219
#: ../../include/Contact.php:217 ../../include/Contact.php:230
#: ../../include/conversation.php:845
msgid "Network Posts"
msgstr ""
#: ../../include/Contact.php:207 ../../include/Contact.php:219
#: ../../include/Contact.php:218 ../../include/Contact.php:230
#: ../../include/conversation.php:846
msgid "Edit Contact"
msgstr ""
#: ../../include/Contact.php:208 ../../include/Contact.php:219
#: ../../include/Contact.php:219 ../../include/Contact.php:230
#: ../../include/conversation.php:847
msgid "Send PM"
msgstr ""

3
view/contact_edit.tpl

@ -17,6 +17,9 @@
<ul>
<li><div id="contact-edit-rel">$relation_text</div></li>
<li><div id="contact-edit-nettype">$nettype</div></li>
{{ if $lost_contact }}
<li><div id="lost-contact-message">$lost_contact</div></li>
{{ endif }}
{{ if $insecure }}
<li><div id="insecure-message">$insecure</div></li>
{{ endif }}

Loading…
Cancel
Save