]> git.mxchange.org Git - friendica.git/commitdiff
Remote-self: It is now possible to chose between two different modes of mirroring.
authorMichael Vogel <icarus@dabo.de>
Mon, 1 Sep 2014 12:00:21 +0000 (14:00 +0200)
committerMichael Vogel <icarus@dabo.de>
Mon, 1 Sep 2014 12:00:21 +0000 (14:00 +0200)
include/items.php
mod/crepair.php
view/templates/crepair.tpl

index c3deed35dfa9ec699e186e2d5e1ac542cbf0d4ec..0df200aebce629b15b537a435986864ba87929ab 100644 (file)
@@ -2565,10 +2565,21 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
                                if($contact['remote_self']) {
                                        $datarray['wall'] = 1;
 
-                                       // Test
-                                       $datarray['author-name']   = $datarray['owner-name'];
-                                       $datarray['author-link']   = $datarray['owner-link'];
-                                       $datarray['author-avatar'] = $datarray['owner-avatar'];
+                                       if ($contact['remote_self'] == 2) {
+                                               $r = q("SELECT `id`,`url`,`name`,`photo`,`network` FROM `contact` WHERE `uid` = %d AND `self`", intval($importer['uid']));
+                                               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;
                                        if($contact['network'] === NETWORK_FEED) {
@@ -3670,10 +3681,22 @@ function local_delivery($importer,$data) {
                        if($importer['remote_self']) {
                                $datarray['wall'] = 1;
 
-                               // Test
-                               $datarray['author-name']   = $datarray['owner-name'];
-                               $datarray['author-link']   = $datarray['owner-link'];
-                               $datarray['author-avatar'] = $datarray['owner-avatar'];
+                               if ($importer['remote_self'] == 2) {
+                                       $r = q("SELECT `id`,`url`,`name`,`photo`,`network` FROM `contact` WHERE `uid` = %d AND `self`",
+                                               intval($importer['importer_uid']));
+                                       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;
                        } else
index ef5f3613051db8c1627bea2d6039d788cba86152..0706a102d425b0bf7af43305415226c0e9dc9479 100644 (file)
@@ -158,7 +158,7 @@ function crepair_content(&$a) {
                '$label_photo' => t('New photo from this URL'),
                '$label_remote_self' => t('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_nick' => $contact['nick'],
                '$contact_id'   => $contact['id'],
index d53af5dad783d4a81b42bd21c6e4a19fbb36a679..37e2ef417bb48926af0378c05ca3dbf2972139ae 100644 (file)
@@ -39,7 +39,7 @@
 <div class="clear"></div>
 {{if $allow_remote_self eq 1}}
 <h4>{{$label_remote_self}}</h4>
-{{include file="field_checkbox.tpl" field=$remote_self}}
+{{include file="field_select.tpl" field=$remote_self}}
 {{/if}}
 
 <input type="submit" name="submit" value="{{$lbl_submit}}" />