Remote-self: It is now possible to chose between two different modes of mirroring.

This commit is contained in:
Michael Vogel 2014-09-01 14:00:21 +02:00
parent 522b9edffe
commit e35c55dd3b
3 changed files with 33 additions and 10 deletions

View file

@ -2565,10 +2565,21 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
if($contact['remote_self']) { if($contact['remote_self']) {
$datarray['wall'] = 1; $datarray['wall'] = 1;
// Test if ($contact['remote_self'] == 2) {
$datarray['author-name'] = $datarray['owner-name']; $r = q("SELECT `id`,`url`,`name`,`photo`,`network` FROM `contact` WHERE `uid` = %d AND `self`", intval($importer['uid']));
$datarray['author-link'] = $datarray['owner-link']; if (count($r)) {
$datarray['author-avatar'] = $datarray['owner-avatar']; $datarray['contact-id'] = $r[0]["id"];
$datarray['network'] = $r[0]["network"];
$datarray['owner-name'] = $r[0]["name"];
$datarray['owner-link'] = $r[0]["url"];
$datarray['owner-avatar'] = $r[0]["photo"];
$datarray['author-name'] = $datarray['owner-name'];
$datarray['author-link'] = $datarray['owner-link'];
$datarray['author-avatar'] = $datarray['owner-avatar'];
}
}
$notify = true; $notify = true;
if($contact['network'] === NETWORK_FEED) { if($contact['network'] === NETWORK_FEED) {
@ -3670,10 +3681,22 @@ function local_delivery($importer,$data) {
if($importer['remote_self']) { if($importer['remote_self']) {
$datarray['wall'] = 1; $datarray['wall'] = 1;
// Test if ($importer['remote_self'] == 2) {
$datarray['author-name'] = $datarray['owner-name']; $r = q("SELECT `id`,`url`,`name`,`photo`,`network` FROM `contact` WHERE `uid` = %d AND `self`",
$datarray['author-link'] = $datarray['owner-link']; intval($importer['importer_uid']));
$datarray['author-avatar'] = $datarray['owner-avatar']; if (count($r)) {
$datarray['contact-id'] = $r[0]["id"];
$datarray['network'] = $r[0]["network"];
$datarray['owner-name'] = $r[0]["name"];
$datarray['owner-link'] = $r[0]["url"];
$datarray['owner-avatar'] = $r[0]["photo"];
$datarray['author-name'] = $datarray['owner-name'];
$datarray['author-link'] = $datarray['owner-link'];
$datarray['author-avatar'] = $datarray['owner-avatar'];
}
}
$notify = true; $notify = true;
} else } else

View file

@ -158,7 +158,7 @@ function crepair_content(&$a) {
'$label_photo' => t('New photo from this URL'), '$label_photo' => t('New photo from this URL'),
'$label_remote_self' => t('Remote Self'), '$label_remote_self' => t('Remote Self'),
'$allow_remote_self' => get_config('system','allow_users_remote_self'), '$allow_remote_self' => get_config('system','allow_users_remote_self'),
'$remote_self' => array('remote_self', t('Mirror postings from this contact'), $contact['remote_self'], t('Mark this contact as remote_self, this will cause friendica to repost new entries from this contact.')), '$remote_self' => array('remote_self', t('Mirror postings from this contact'), $contact['remote_self'], t('Mark this contact as remote_self, this will cause friendica to repost new entries from this contact.'), array('0'=>t('No mirroring'), '1'=>t('Mirror as forwarded posting'), '2'=>t('Mirror as my own posting'))),
'$contact_name' => $contact['name'], '$contact_name' => $contact['name'],
'$contact_nick' => $contact['nick'], '$contact_nick' => $contact['nick'],
'$contact_id' => $contact['id'], '$contact_id' => $contact['id'],

View file

@ -39,7 +39,7 @@
<div class="clear"></div> <div class="clear"></div>
{{if $allow_remote_self eq 1}} {{if $allow_remote_self eq 1}}
<h4>{{$label_remote_self}}</h4> <h4>{{$label_remote_self}}</h4>
{{include file="field_checkbox.tpl" field=$remote_self}} {{include file="field_select.tpl" field=$remote_self}}
{{/if}} {{/if}}
<input type="submit" name="submit" value="{{$lbl_submit}}" /> <input type="submit" name="submit" value="{{$lbl_submit}}" />