Merge pull request #8244 from MrPetovan/task/8234-add-ap-to-dfrn-request

Add ActivityPub in the protocol list in dfrn_request
This commit is contained in:
Michael Vogel 2020-02-09 06:50:40 +01:00 committed by GitHub
commit 1400e99618
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 118 additions and 302 deletions

View file

@ -626,28 +626,21 @@ function dfrn_request_content(App $a)
$tpl = Renderer::getMarkupTemplate('auto_request.tpl'); $tpl = Renderer::getMarkupTemplate('auto_request.tpl');
} }
$page_desc = DI::l10n()->t("Please enter your 'Identity Address' from one of the following supported communications networks:");
$invite_desc = DI::l10n()->t('If you are not yet a member of the free social web, <a href="%s">follow this link to find a public Friendica site and join us today</a>.', Search::getGlobalDirectory() . '/servers');
$o = Renderer::replaceMacros($tpl, [ $o = Renderer::replaceMacros($tpl, [
'$header' => DI::l10n()->t('Friend/Connection Request'), '$header' => DI::l10n()->t('Friend/Connection Request'),
'$desc' => DI::l10n()->t('Examples: jojo@demo.friendica.com, http://demo.friendica.com/profile/jojo, testuser@gnusocial.de'), '$page_desc' => DI::l10n()->t('Enter your Webfinger address (user@domain.tld) or profile URL here. If this isn\'t supported by your system (for example it doesn\'t work with Diaspora), you have to subscribe to <strong>%s</strong> directly on your system', $target_addr),
'$pls_answer' => DI::l10n()->t('Please answer the following:'), '$invite_desc' => DI::l10n()->t('If you are not yet a member of the free social web, <a href="%s">follow this link to find a public Friendica node and join us today</a>.', Search::getGlobalDirectory() . '/servers'),
'$does_know_you' => ['knowyou', DI::l10n()->t('Does %s know you?', $a->profile['name'])], '$your_address' => DI::l10n()->t('Your Webfinger address or profile URL:'),
'$add_note' => DI::l10n()->t('Add a personal note:'), '$pls_answer' => DI::l10n()->t('Please answer the following:'),
'$page_desc' => $page_desc, '$submit' => DI::l10n()->t('Submit Request'),
'$friendica' => DI::l10n()->t('Friendica'), '$cancel' => DI::l10n()->t('Cancel'),
'$statusnet' => DI::l10n()->t("GNU Social \x28Pleroma, Mastodon\x29"),
'$diaspora' => DI::l10n()->t("Diaspora \x28Socialhome, Hubzilla\x29"), '$request' => 'dfrn_request/' . $a->argv[1],
'$diasnote' => DI::l10n()->t(' - please do not use this form. Instead, enter %s into your Diaspora search bar.', $target_addr), '$name' => $a->profile['name'],
'$your_address' => DI::l10n()->t('Your Identity Address:'), '$myaddr' => $myaddr,
'$invite_desc' => $invite_desc,
'$submit' => DI::l10n()->t('Submit Request'), '$does_know_you' => ['knowyou', DI::l10n()->t('%s knows me', $a->profile['name'])],
'$cancel' => DI::l10n()->t('Cancel'), '$addnote_field' => ['dfrn-request-message', DI::l10n()->t('Add a personal note:')],
'$nickname' => $a->argv[1],
'$name' => $a->profile['name'],
'$myaddr' => $myaddr
]); ]);
return $o; return $o;
} }

View file

@ -163,29 +163,22 @@ function follow_content(App $a)
$o = Renderer::replaceMacros($tpl, [ $o = Renderer::replaceMacros($tpl, [
'$header' => DI::l10n()->t('Connect/Follow'), '$header' => DI::l10n()->t('Connect/Follow'),
'$desc' => '',
'$pls_answer' => DI::l10n()->t('Please answer the following:'), '$pls_answer' => DI::l10n()->t('Please answer the following:'),
'$does_know_you' => ['knowyou', DI::l10n()->t('Does %s know you?', $ret['name'])],
'$add_note' => DI::l10n()->t('Add a personal note:'),
'$page_desc' => '',
'$friendica' => '',
'$statusnet' => '',
'$diaspora' => '',
'$diasnote' => '',
'$your_address' => DI::l10n()->t('Your Identity Address:'), '$your_address' => DI::l10n()->t('Your Identity Address:'),
'$invite_desc' => '', '$url_label' => DI::l10n()->t('Profile URL'),
'$emailnet' => '', '$keywords_label'=> DI::l10n()->t('Tags:'),
'$submit' => $submit, '$submit' => $submit,
'$cancel' => DI::l10n()->t('Cancel'), '$cancel' => DI::l10n()->t('Cancel'),
'$nickname' => '',
'$request' => $request,
'$name' => $ret['name'], '$name' => $ret['name'],
'$url' => $ret['url'], '$url' => $ret['url'],
'$zrl' => Profile::zrl($ret['url']), '$zrl' => Profile::zrl($ret['url']),
'$url_label' => DI::l10n()->t('Profile URL'),
'$myaddr' => $myaddr, '$myaddr' => $myaddr,
'$request' => $request,
'$keywords' => $r[0]['keywords'], '$keywords' => $r[0]['keywords'],
'$keywords_label'=> DI::l10n()->t('Tags:')
'$does_know_you' => ['knowyou', DI::l10n()->t('Does %s know you?', $ret['name'])],
'$addnote_field' => ['dfrn-request-message', DI::l10n()->t('Add a personal note:')],
]); ]);
DI::page()['aside'] = ''; DI::page()['aside'] = '';

View file

@ -406,9 +406,10 @@ function settings_post(App $a)
Worker::add(PRIORITY_LOW, 'AddContact', $_SESSION['uid'], $csvRow[0]); Worker::add(PRIORITY_LOW, 'AddContact', $_SESSION['uid'], $csvRow[0]);
} }
} }
info(DI::l10n()->t('Importing Contacts done')); info(DI::l10n()->t('Importing Contacts done'));
// delete temp file // delete temp file
unlink($filename); unlink($_FILES['importcontact-filename']['tmp_name']);
} }
} }
} }
@ -791,8 +792,8 @@ function settings_content(App $a)
Hook::callAll('connector_settings', $settings_connectors); Hook::callAll('connector_settings', $settings_connectors);
if (is_site_admin()) { if (is_site_admin()) {
$diasp_enabled = DI::l10n()->t('Built-in support for %s connectivity is %s', DI::l10n()->t('Diaspora'), ((DI::config()->get('system', 'diaspora_enabled')) ? DI::l10n()->t('enabled') : DI::l10n()->t('disabled'))); $diasp_enabled = DI::l10n()->t('Built-in support for %s connectivity is %s', DI::l10n()->t('Diaspora (Socialhome, Hubzilla)'), ((DI::config()->get('system', 'diaspora_enabled')) ? DI::l10n()->t('enabled') : DI::l10n()->t('disabled')));
$ostat_enabled = DI::l10n()->t('Built-in support for %s connectivity is %s', DI::l10n()->t("GNU Social \x28OStatus\x29"), ((DI::config()->get('system', 'ostatus_disabled')) ? DI::l10n()->t('disabled') : DI::l10n()->t('enabled'))); $ostat_enabled = DI::l10n()->t('Built-in support for %s connectivity is %s', DI::l10n()->t('OStatus (GNU Social)'), ((DI::config()->get('system', 'ostatus_disabled')) ? DI::l10n()->t('disabled') : DI::l10n()->t('enabled')));
} else { } else {
$diasp_enabled = ""; $diasp_enabled = "";
$ostat_enabled = ""; $ostat_enabled = "";

View file

@ -1,60 +1,27 @@
<h1>{{$header}}</h1> <h1>{{$header}}</h1>
{{if $myaddr == ""}} <form action="{{$request}}" method="post">
<p id="dfrn-request-intro"> <dl>
{{$page_desc}}<br /> <dt>{{$url_label}}</dt>
<ul id="dfrn-request-networks"> <dd><a target="blank" href="{{$zrl}}">{{$url}}</a></dd>
<li><a href="http://friendi.ca" title="{{$friendica}}">{{$friendica}}</a></li> {{if $keywords}}
<li><a href="https://diasporafoundation.org" title="{{$diaspora}}">{{$diaspora}}</a> {{$diasnote}}</li> <dt>{{$keywords_label}}</dt>
<li><a href="https://gnu.io/social/" title="{{$statusnet}}" >{{$statusnet}}</a></li> <dd>{{$keywords}}</dd>
</ul>
</p>
<p>
{{$invite_desc nofilter}}
</p>
<p>
{{$desc nofilter}}
</p>
{{/if}} {{/if}}
</dl>
{{if $request}} <div id="dfrn-request-url-wrapper">
<form action="{{$request}}" method="post" /> <label id="dfrn-url-label" for="dfrn-url">{{$your_address}}</label>
{{else}} {{$myaddr}}
<form action="dfrn_request/{{$nickname}}" method="post" /> <input type="hidden" name="dfrn_url" id="dfrn-url" value="{{$myaddr}}">
{{/if}} <input type="hidden" name="url" id="url" value="{{$url}}">
<div id="dfrn-request-url-end"></div>
{{if $photo}} </div>
<img src="{{$photo}}" alt="" id="dfrn-request-photo">
{{/if}}
{{if $url}}<dl><dt>{{$url_label}}</dt><dd><a target="blank" href="{{$zrl}}">{{$url}}</a></dd></dl>{{/if}}
{{if $location}}<dl><dt>{{$location_label}}</dt><dd>{{$location}}</dd></dl>{{/if}}
{{if $keywords}}<dl><dt>{{$keywords_label}}</dt><dd>{{$keywords}}</dd></dl>{{/if}}
{{if $about}}<dl><dt>{{$about_label}}</dt><dd>{{$about nofilter}}</dd></dl>{{/if}}
<div id="dfrn-request-url-wrapper" >
<label id="dfrn-url-label" for="dfrn-url" >{{$your_address}}</label>
{{if $myaddr}}
{{$myaddr}}
<input type="hidden" name="dfrn_url" id="dfrn-url" value="{{$myaddr}}" />
{{else}}
<input type="text" name="dfrn_url" id="dfrn-url" size="32" value="{{$myaddr}}" />
{{/if}}
{{if $url}}
<input type="hidden" name="url" id="url" value="{{$url}}" />
{{/if}}
<div id="dfrn-request-url-end"></div>
</div>
<div id="dfrn-request-info-wrapper" >
</div>
<div id="dfrn-request-submit-wrapper"> <div id="dfrn-request-submit-wrapper">
{{if $submit}} {{if $submit}}
<input type="submit" name="submit" id="dfrn-request-submit-button" value="{{$submit}}" /> <input type="submit" name="submit" id="dfrn-request-submit-button" value="{{$submit}}">
{{/if}} {{/if}}
<input type="submit" name="cancel" id="dfrn-request-cancel-button" value="{{$cancel}}" /> <input type="submit" name="cancel" id="dfrn-request-cancel-button" value="{{$cancel}}">
</div> </div>
</form> </form>

View file

@ -1,90 +1,38 @@
<h1>{{$header}}</h1> <h1>{{$header}}</h1>
{{if $myaddr}} {{if !$myaddr}}
{{else}}
<p id="dfrn-request-intro"> <p id="dfrn-request-intro">
{{$page_desc}}<br /> {{$page_desc nofilter}}
<ul id="dfrn-request-networks">
<li><a href="http://friendi.ca" title="{{$friendica}}">{{$friendica}}</a></li>
<li><a href="https://diasporafoundation.org" title="{{$diaspora}}">{{$diaspora}}</a> {{$diasnote}}</li>
<li><a href="https://gnu.io/social/" title="{{$statusnet}}" >{{$statusnet}}</a></li>
</ul>
{{$invite_desc nofilter}}
</p> </p>
<p> <p>
{{$desc nofilter}} {{$invite_desc nofilter}}
</p> </p>
{{/if}} {{/if}}
{{if $request}}
<form action="{{$request}}" method="post"> <form action="{{$request}}" method="post">
{{else}} <div id="dfrn-request-url-wrapper">
<form action="dfrn_request/{{$nickname}}" method="post"> <label id="dfrn-url-label" for="dfrn-url">{{$your_address}}</label>
{{/if}} {{if $myaddr}}
{{if $photo}}
<img src="{{$photo}}" alt="" id="dfrn-request-photo" />
{{/if}}
{{if $url}}<dl><dt>{{$url_label}}</dt><dd><a target="blank" href="{{$zrl}}">{{$url}}</a></dd></dl>{{/if}}
{{if $location}}<dl><dt>{{$location_label}}</dt><dd>{{$location}}</dd></dl>{{/if}}
{{if $keywords}}<dl><dt>{{$keywords_label}}</dt><dd>{{$keywords}}</dd></dl>{{/if}}
{{if $about}}<dl><dt>{{$about_label}}</dt><dd>{{$about nofilter}}</dd></dl>{{/if}}
<div id="dfrn-request-url-wrapper" >
<label id="dfrn-url-label" for="dfrn-url" >{{$your_address}}</label>
{{if $myaddr}}
{{$myaddr}} {{$myaddr}}
<input type="hidden" name="dfrn_url" id="dfrn-url" size="32" value="{{$myaddr}}" /> <input type="hidden" name="dfrn_url" id="dfrn-url" value="{{$myaddr}}">
{{else}} {{else}}
<input type="text" name="dfrn_url" id="dfrn-url" size="32" value="{{$myaddr}}" /> <input type="text" name="dfrn_url" id="dfrn-url" size="32" value="{{$myaddr}}">
{{/if}} {{/if}}
{{if $url}} <div id="dfrn-request-url-end"></div>
<input type="hidden" name="url" id="url" value="{{$url}}" />
{{/if}}
<div id="dfrn-request-url-end"></div>
</div>
<p id="dfrn-request-options">
{{$pls_answer}}
</p>
<div id="dfrn-request-info-wrapper" >
{{include file="field_checkbox.tpl" field=$does_know_you}}
<!--
<p id="doiknowyou">
{{$does_know}}
</p>
<div id="dfrn-request-know-yes-wrapper">
<label id="dfrn-request-knowyou-yes-label" for="dfrn-request-knowyouyes">{{$yes}}</label>
<input type="radio" name="knowyou" id="knowyouyes" value="1" />
<div id="dfrn-request-knowyou-break" ></div>
</div>
<div id="dfrn-request-know-no-wrapper">
<label id="dfrn-request-knowyou-no-label" for="dfrn-request-knowyouno">{{$no}}</label>
<input type="radio" name="knowyou" id="knowyouno" value="0" checked="checked" />
<div id="dfrn-request-knowyou-end"></div>
</div>
-->
<p id="dfrn-request-message-desc">
{{$add_note}}
</p>
<div id="dfrn-request-message-wrapper">
<textarea name="dfrn-request-message" rows="4" cols="64" ></textarea>
</div> </div>
<p id="dfrn-request-options">
{{$pls_answer}}
</p>
</div> <div id="dfrn-request-info-wrapper">
{{include file="field_checkbox.tpl" field=$does_know_you}}
{{include file="field_textarea.tpl" field=$addnote_field}}
</div>
<div id="dfrn-request-submit-wrapper"> <div id="dfrn-request-submit-wrapper">
{{if $submit}} <input type="submit" name="submit" id="dfrn-request-submit-button" value="{{$submit}}">
<input type="submit" name="submit" id="dfrn-request-submit-button" value="{{$submit}}" /> <input type="submit" name="cancel" id="dfrn-request-cancel-button" value="{{$cancel}}">
{{/if}}
<input type="submit" name="cancel" id="dfrn-request-cancel-button" value="{{$cancel}}" />
</div> </div>
</form> </form>

View file

@ -1,63 +1,29 @@
<div class="generic-page-wrapper"> <div class="generic-page-wrapper">
<h1>{{$header}}</h1> <h1>{{$header}}</h1>
{{if $myaddr == ""}} <form action="{{$request}}" method="post">
<p id="dfrn-request-intro"> <dl>
{{$page_desc}}<br /> <dt>{{$url_label}}</dt>
<ul id="dfrn-request-networks"> <dd><a target="blank" href="{{$zrl}}">{{$url}}</a></dd>
<li><a href="http://friendi.ca" title="{{$friendica}}">{{$friendica}}</a></li> {{if $keywords}}
<li><a href="https://diasporafoundation.org" title="{{$diaspora}}">{{$diaspora}}</a> {{$diasnote}}</li> <dt>{{$keywords_label}}</dt>
<li><a href="https://gnu.io/social/" title="{{$statusnet}}" >{{$statusnet}}</a></li> <dd>{{$keywords}}</dd>
</ul>
</p>
<p>
{{$invite_desc nofilter}}
</p>
<p>
{{$desc}}
</p>
{{/if}} {{/if}}
</dl>
{{if $request}} <div id="dfrn-request-url-wrapper">
<form action="{{$request}}" method="post" /> <label id="dfrn-url-label" for="dfrn-url">{{$your_address}}</label>
{{else}} {{$myaddr}}
<form action="dfrn_request/{{$nickname}}" method="post" /> <input type="hidden" name="dfrn_url" id="dfrn-url" value="{{$myaddr}}">
<input type="hidden" name="url" id="url" value="{{$url}}">
<div id="dfrn-request-url-end"></div>
</div>
<div id="dfrn-request-submit-wrapper">
{{if $submit}}
<input class="btn btn-primary" type="submit" name="submit" id="dfrn-request-submit-button" value="{{$submit}}">
{{/if}} {{/if}}
<input class="btn btn-default" type="submit" name="cancel" id="dfrn-request-cancel-button" value="{{$cancel}}">
{{if $photo}} </div>
<img src="{{$photo}}" alt="" id="dfrn-request-photo"> </form>
{{/if}}
{{if $url}}<dl><dt>{{$url_label}}</dt><dd><a target="blank" href="{{$zrl}}">{{$url}}</a></dd></dl>{{/if}}
{{if $location}}<dl><dt>{{$location_label}}</dt><dd>{{$location}}</dd></dl>{{/if}}
{{if $keywords}}<dl><dt>{{$keywords_label}}</dt><dd>{{$keywords}}</dd></dl>{{/if}}
{{if $about}}<dl><dt>{{$about_label}}</dt><dd>{{$about}}</dd></dl>{{/if}}
<div id="dfrn-request-url-wrapper" >
<label id="dfrn-url-label" for="dfrn-url" >{{$your_address}}</label>
{{if $myaddr}}
{{$myaddr}}
<input type="hidden" name="dfrn_url" id="dfrn-url" value="{{$myaddr}}" />
{{else}}
<input type="text" name="dfrn_url" id="dfrn-url" size="32" value="{{$myaddr}}" />
{{/if}}
{{if $url}}
<input type="hidden" name="url" id="url" value="{{$url}}" />
{{/if}}
<div id="dfrn-request-url-end"></div>
</div>
<div id="dfrn-request-info-wrapper" >
</div>
<div id="dfrn-request-submit-wrapper">
{{if $submit}}
<input class="btn btn-primary" type="submit" name="submit" id="dfrn-request-submit-button" value="{{$submit}}" />
{{/if}}
<input class="btn btn-primary" type="submit" name="cancel" id="dfrn-request-cancel-button" value="{{$cancel}}" />
</div>
</form>
</div> </div>

View file

@ -1,92 +1,40 @@
<div class="generic-page-wrapper"> <div class="generic-page-wrapper">
<h1>{{$header}}</h1> <h1>{{$header}}</h1>
{{if !$myaddr}}
<p id="dfrn-request-intro">
{{$page_desc nofilter}}
</p>
<p>
{{$invite_desc nofilter}}
</p>
{{/if}}
<form action="{{$request}}" method="post">
<div id="dfrn-request-url-wrapper">
<label id="dfrn-url-label" for="dfrn-url">{{$your_address}}</label>
{{if $myaddr}} {{if $myaddr}}
{{$myaddr}}
<input type="hidden" name="dfrn_url" id="dfrn-url" value="{{$myaddr}}">
{{else}} {{else}}
<p id="dfrn-request-intro"> <input type="text" name="dfrn_url" id="dfrn-url" size="32" value="{{$myaddr}}">
{{$page_desc}}<br />
<ul id="dfrn-request-networks">
<li><a href="http://friendi.ca" title="{{$friendica}}">{{$friendica}}</a></li>
<li><a href="https://diasporafoundation.org" title="{{$diaspora}}">{{$diaspora}}</a> {{$diasnote}}</li>
<li><a href="https://gnu.io/social/" title="{{$statusnet}}" >{{$statusnet}}</a></li>
</ul>
{{$invite_desc nofilter}}
</p>
<p>
{{$desc}}
</p>
{{/if}} {{/if}}
<div id="dfrn-request-url-end"></div>
{{if $request}}
<form action="{{$request}}" method="post">
{{else}}
<form action="dfrn_request/{{$nickname}}" method="post">
{{/if}}
{{if $photo}}
<img src="{{$photo}}" alt="" id="dfrn-request-photo" />
{{/if}}
{{if $url}}<dl><dt>{{$url_label}}</dt><dd><a target="blank" href="{{$zrl}}">{{$url}}</a></dd></dl>{{/if}}
{{if $location}}<dl><dt>{{$location_label}}</dt><dd>{{$location}}</dd></dl>{{/if}}
{{if $keywords}}<dl><dt>{{$keywords_label}}</dt><dd>{{$keywords}}</dd></dl>{{/if}}
{{if $about}}<dl><dt>{{$about_label}}</dt><dd>{{$about}}</dd></dl>{{/if}}
<div id="dfrn-request-url-wrapper" >
<label id="dfrn-url-label" for="dfrn-url" >{{$your_address}}</label>
{{if $myaddr}}
{{$myaddr}}
<input type="hidden" name="dfrn_url" id="dfrn-url" size="32" value="{{$myaddr}}" />
{{else}}
<input type="text" name="dfrn_url" id="dfrn-url" size="32" value="{{$myaddr}}" />
{{/if}}
{{if $url}}
<input type="hidden" name="url" id="url" value="{{$url}}" />
{{/if}}
<div id="dfrn-request-url-end"></div>
</div>
<p id="dfrn-request-options">
{{$pls_answer}}
</p>
<div id="dfrn-request-info-wrapper" >
{{include file="field_checkbox.tpl" field=$does_know_you}}
<!--
<p id="doiknowyou">
{{$does_know}}
</p>
<div id="dfrn-request-know-yes-wrapper">
<label id="dfrn-request-knowyou-yes-label" for="dfrn-request-knowyouyes">{{$yes}}</label>
<input type="radio" name="knowyou" id="knowyouyes" value="1" />
<div id="dfrn-request-knowyou-break" ></div>
</div> </div>
<div id="dfrn-request-know-no-wrapper">
<label id="dfrn-request-knowyou-no-label" for="dfrn-request-knowyouno">{{$no}}</label>
<input type="radio" name="knowyou" id="knowyouno" value="0" checked="checked" />
<div id="dfrn-request-knowyou-end"></div> <p id="dfrn-request-options">
{{$pls_answer}}
</p>
<div id="dfrn-request-info-wrapper">
{{include file="field_checkbox.tpl" field=$does_know_you}}
{{include file="field_textarea.tpl" field=$addnote_field}}
</div> </div>
-->
<p id="dfrn-request-message-desc">
{{$add_note}}
</p>
<div id="dfrn-request-message-wrapper">
<textarea name="dfrn-request-message" rows="4" cols="64" ></textarea>
</div>
</div> <div id="dfrn-request-submit-wrapper">
<input class="btn btn-primary" type="submit" name="submit" id="dfrn-request-submit-button" value="{{$submit}}">
<div id="dfrn-request-submit-wrapper"> <input class="btn btn-default" type="submit" name="cancel" id="dfrn-request-cancel-button" value="{{$cancel}}">
{{if $submit}} </div>
<input class="btn btn-primary" type="submit" name="submit" id="dfrn-request-submit-button" value="{{$submit}}" /> </form>
{{/if}}
<input class="btn btn-primary" type="submit" name="cancel" id="dfrn-request-cancel-button" value="{{$cancel}}" />
</div>
</form>
</div> </div>