@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix missing file attachment in Conpherence

Summary:
When you drag and drop a file in a Conpherence chat,
the file was only visible by the author.

Now the file is also attached to that chat, making it visible.

This is a follow-up from:

https://we.phorge.it/D25705?id=2178

Refs T15106

Test Plan:
1) open a Conpherence chat or create a new one
2) drag and drop file in it and send the message
3) verify file is attached to the chat

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: avivey, Cigaryno, Matthew, valerio.bozzolan, tobiaswiese

Maniphest Tasks: T15106

Differential Revision: https://we.phorge.it/D25709

+39
+24
src/applications/conpherence/controller/ConpherenceUpdateController.php
··· 79 79 $user, 80 80 $conpherence, 81 81 $message); 82 + 83 + $xaction_comment = PhabricatorTransactions::findOneByType( 84 + $xactions, 85 + PhabricatorTransactions::TYPE_COMMENT); 86 + 87 + $text_metadata = $request->getStr('text_metadata'); 88 + if ($text_metadata) { 89 + $text_metadata = phutil_json_decode($text_metadata); 90 + $attached_file_phids = idx( 91 + $text_metadata, 92 + 'attachedFilePHIDs', 93 + array()); 94 + 95 + if ($attached_file_phids) { 96 + $metadata_object = array( 97 + 'remarkup.control' => array( 98 + 'attachedFilePHIDs' => $attached_file_phids, 99 + ), 100 + ); 101 + 102 + $xaction_comment->setMetadata($metadata_object); 103 + } 104 + } 105 + 82 106 $delete_draft = true; 83 107 } else { 84 108 $action = ConpherenceUpdateActions::LOAD;
+15
src/applications/transactions/constants/PhabricatorTransactions.php
··· 41 41 ); 42 42 } 43 43 44 + /** 45 + * Find the first transaction that matches a type. 46 + * @param array $xactions 47 + * @param string $type 48 + * @return PhabricatorTransactions|null 49 + */ 50 + public static function findOneByType($xactions, $type) { 51 + foreach ($xactions as $xaction) { 52 + if ($xaction->getTransactionType() === $type) { 53 + return $xaction; 54 + } 55 + } 56 + return null; 57 + } 58 + 44 59 }