Browse Source

Merge pull request #5839 from annando/like-owner

The owner of a "like" should be the author
tags/2019.01
Tobias Diekershoff 10 months ago
parent
commit
5014779052
No account linked to committer's email address
2 changed files with 4 additions and 7 deletions
  1. 2
    2
      src/Model/Item.php
  2. 2
    5
      src/Protocol/Diaspora.php

+ 2
- 2
src/Model/Item.php View File

@@ -3111,7 +3111,7 @@ class Item extends BaseObject
3111 3111
 			return true;
3112 3112
 		}
3113 3113
 
3114
-		$objtype = $item['resource-id'] ? ACTIVITY_OBJ_IMAGE : ACTIVITY_OBJ_NOTE ;
3114
+		$objtype = $item['resource-id'] ? ACTIVITY_OBJ_IMAGE : ACTIVITY_OBJ_NOTE;
3115 3115
 
3116 3116
 		$new_item = [
3117 3117
 			'guid'          => System::createUUID(),
@@ -3125,7 +3125,7 @@ class Item extends BaseObject
3125 3125
 			'parent'        => $item['id'],
3126 3126
 			'parent-uri'    => $item['uri'],
3127 3127
 			'thr-parent'    => $item['uri'],
3128
-			'owner-id'      => $item['owner-id'],
3128
+			'owner-id'      => $author_id,
3129 3129
 			'author-id'     => $author_id,
3130 3130
 			'body'          => $activity,
3131 3131
 			'verb'          => $activity,

+ 2
- 5
src/Protocol/Diaspora.php View File

@@ -1969,11 +1969,8 @@ class Diaspora
1969 1969
 		$datarray["contact-id"] = $author_contact["cid"];
1970 1970
 		$datarray["network"]  = $author_contact["network"];
1971 1971
 
1972
-		$datarray["author-link"] = $person["url"];
1973
-		$datarray["author-id"] = Contact::getIdForURL($person["url"], 0);
1974
-
1975
-		$datarray["owner-link"] = $contact["url"];
1976
-		$datarray["owner-id"] = Contact::getIdForURL($contact["url"], 0);
1972
+		$datarray["owner-link"] = $datarray["author-link"] = $person["url"];
1973
+		$datarray["owner-id"] = $datarray["author-id"] = Contact::getIdForURL($person["url"], 0);
1977 1974
 
1978 1975
 		$datarray["guid"] = $guid;
1979 1976
 		$datarray["uri"] = self::getUriFromGuid($author, $guid);

Loading…
Cancel
Save