+ // We prefer the data from the user's contact over the public one
+ if (!empty($row['author-link']) && !empty($row['contact-link']) &&
+ ($row['author-link'] == $row['contact-link'])) {
+ if (isset($row['author-avatar']) && !empty($row['contact-avatar'])) {
+ $row['author-avatar'] = $row['contact-avatar'];
+ }
+ if (isset($row['author-name']) && !empty($row['contact-name'])) {
+ $row['author-name'] = $row['contact-name'];
+ }
+ }
+
+ if (!empty($row['owner-link']) && !empty($row['contact-link']) &&
+ ($row['owner-link'] == $row['contact-link'])) {
+ if (isset($row['owner-avatar']) && !empty($row['contact-avatar'])) {
+ $row['owner-avatar'] = $row['contact-avatar'];
+ }
+ if (isset($row['owner-name']) && !empty($row['contact-name'])) {
+ $row['owner-name'] = $row['contact-name'];
+ }
+ }
+
+ // We can always comment on posts from these networks
+ if (isset($row['writable']) && !empty($row['network']) &&
+ in_array($row['network'], [NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS])) {
+ $row['writable'] = true;
+ }
+