Commit graph

7951 commits

Author SHA1 Message Date
Philipp Holzer 52c7948526
Create HTTPClientFactory and introduce ImageTest 2021-08-25 14:22:42 +02:00
Hypolite Petovan 7a8d800024 Add probe support to @user@domain.tld search string format 2021-08-24 12:46:01 -04:00
Hypolite Petovan 17944c01ea Allow a GuzzleResponse body to be queried more than once
- Using `StreamInterface->getContents` left the stream index at the end of the stream, which made every subsequent call to `getBody()` return empty string
- Using `StreamInterface->__toString()` magic method correctly seek the stream to the start before reading
2021-08-24 11:30:11 -04:00
Hypolite Petovan e7fdf3c0c3
Merge pull request #10630 from annando/cleared-enotify
Unused parts of the old notification system are removed
2021-08-24 10:25:06 -04:00
Michael Vogel 9aca4b515f
Merge pull request #10628 from MrPetovan/bug/fatal-errors
Set profile fields for system user in Model\User::getOwnerDataById
2021-08-24 14:13:32 +02:00
Hypolite Petovan ceeb246128 Remove Profile::load from Module\HCard
- Renamed and re-scoped Profile::sidebar to getVcardHtml
2021-08-24 06:24:06 -04:00
Hypolite Petovan 8f0e36d617 Raise an Exception when Profile::load is profided the system user nickname 2021-08-24 05:54:15 -04:00
Hypolite Petovan e155821d7a Set profile fields for system user in Model\User::getOwnerDataById
- Address https://github.com/friendica/friendica/issues/10473#issuecomment-903676606
- This is required when Model\Profile::load is called for the system user for example
2021-08-24 05:53:46 -04:00
Michael 429a724bc1 Unused parts of the old notification system are removed 2021-08-24 08:53:15 +00:00
Hypolite Petovan 0651ace4e4
Merge pull request #10627 from annando/like-announce
Reliably display "like" and "share" notifications
2021-08-23 14:12:57 -04:00
Michael c78b7f45c5 Reliably diasplay "like" and "share" notifications 2021-08-23 15:07:14 +00:00
Hypolite Petovan 2108be7e07
Merge pull request #10619 from nupplaphil/task/guzzlehttp
PSR-7 Part 1: Use Guzzle PSR-7 library for HTTPRequest->get()
2021-08-22 18:11:30 -04:00
Philipp Holzer ff2d85b703
Initialize $curlOptions[CURLOPT_HTTPHEADER] outside of the checks 2021-08-22 22:49:55 +02:00
Philipp Holzer c3eca0cfae
Remove legacy header-parsing for guzzle 2021-08-22 22:43:28 +02:00
Michael e9c63ff075 Added "follow" subscription message 2021-08-22 08:27:56 +00:00
Michael 59045b2e23 Added handling another situation 2021-08-22 03:58:50 +00:00
Michael 4f1e61457d Fetch the user's post if present 2021-08-21 21:40:47 +00:00
Michael 42de5c77d0 The desktop notifications have been reworked 2021-08-21 20:35:04 +00:00
Philipp Holzer 8f13319c73
remove unused $redirect parameter 2021-08-20 22:30:54 +02:00
Philipp Holzer 9eba32226c
make CS happy :) 2021-08-20 22:11:36 +02:00
Philipp Holzer 653d49cb92
Fix getHeader() 2021-08-20 22:00:28 +02:00
Philipp Holzer 65ca164487
A lot of Fixings 2021-08-20 21:35:14 +02:00
Philipp Holzer 06371d29a6
Cleanup 2021-08-20 20:03:42 +02:00
Philipp Holzer a338e4cbff
Update src/Network/GuzzleResponse.php 2021-08-20 19:58:42 +02:00
Philipp Holzer 756f57f198
Revert "Use last entry for Content-Type 2021-08-20 19:58:42 +02:00
Philipp Holzer 50e2478189
Remove unnecessary exception message (avoid log flooding) 2021-08-20 19:58:42 +02:00
Philipp Holzer 1995feff61
Fix redirect logging 2021-08-20 19:58:42 +02:00
Philipp Holzer 26401e88b8
IHTTPResult::getContentType is now a string again 2021-08-20 19:58:42 +02:00
Philipp Holzer 82f767f2ee
Fix Content-Type for CurlResult class 2021-08-20 19:58:42 +02:00
Philipp Holzer 803c1d71de
Fix IHTTPResult::getHeader()
- Now returns a string array, like expected
- Fix usages
- Fix dataset
2021-08-20 19:58:42 +02:00
Philipp Holzer 3c074ab315
HTTPRequest: Replace getInfo() with new parameter 'content_length' 2021-08-20 19:58:42 +02:00
Philipp Holzer 89f718ec72
Use CurlResult for failed HTTPRequests (legacy usage) 2021-08-20 19:58:42 +02:00
Philipp Holzer dee1899628
Fix IHTTPResult::getHeader/s()
- Split functionality "getHeader()" and "getHeaders()" analog to IMessageInterface::getHeader/s()
- Fix functionality at various places - Adapt CurlResultTest
2021-08-20 19:58:42 +02:00
Philipp Holzer a60ca4a1cf
Use Guzzle for HTTPRequest and Result 2021-08-20 19:58:42 +02:00
Philipp Holzer 05ecd1e3d4
Replace IHTTPResult for CurlResult usages 2021-08-20 19:58:42 +02:00
Philipp Holzer 7009d90add
Introduce IHTTPResult Interface as abstraction for CurlResult 2021-08-20 19:58:42 +02:00
Hypolite Petovan 632d1024f7
Merge pull request #10309 from fabrixxm/feature/advanced-logsview
Display structured logs in admin
2021-08-20 05:24:07 -04:00
fabrixxm 3766204b05 Fix code standard 2021-08-20 11:09:35 +02:00
fabrixxm 7f695197aa Fix review points
- Fix headers hierarchy
- Improve accessibility:
 	- set mouse pointer
	- make rows focusable
	- open on key press
	- add tooltip with "title"
	- add role and aria attributes
- Rename `ParsedLog` to `ParsedLogLine`
- Add docs to `ReversedFileReader`'s implementation of `Iterator`'s methods
- Add docs to `ParsedLogIterator`'s implementation of `Iterator`'s methods
- Remove unnecessary comment
- Add more test for parsing log lines and fix some edge cases
- Fix function name in snake-case to camelCase
- Remove `DIRECTORY_SEPARATOR`
2021-08-20 11:02:18 +02:00
Hypolite Petovan 1de159a2ae Escape url tags before attempting to add missing mention links in Protocol\ActivityPub\Processor
- Mastodon uses @-sign in profile URLs which wrongly triggered the mention link add in existing mentions links
2021-08-20 03:45:15 -04:00
Hypolite Petovan 4b36f7e8c8
Merge pull request #10616 from annando/notification-message
Meaningful notification message
2021-08-19 19:20:46 -04:00
Michael c0d187f281 Added "causer" and "notification" for the "ping" mechanism 2021-08-19 14:57:35 +00:00
Michael 6899d3c618 Meaningful notification message 2021-08-19 13:58:55 +00:00
fabrixxm dd2abc7aff Fix code standard 2021-08-19 15:20:25 +02:00
fabrixxm ec4f53d56f Add DI to ParsedLogIterator, replace constructors with fluent api 2021-08-19 14:56:51 +02:00
fabrixxm a62124285d Add tests for ParsedLog and fix parsing 2021-08-19 14:55:33 +02:00
fabrixxm 84fa668845 Fix code formatting 2021-08-19 14:55:33 +02:00
fabrixxm 5b9aeeeca9 Add search and filter to log view 2021-08-19 14:55:33 +02:00
fabrixxm 9368f5445d Display structured logs in admin
Tries to parse log lines and to display info in a table.
Additional JSON data is parsed and displayed clicking on a row.

File reading and line parsing is handled in iterators, to avoid to keep
too much data in memory.
Search and filter should be trivial to add.
Log file is read backward to display log events newest first.
A "tail" functionality should be easy to implement.
2021-08-19 14:55:33 +02:00
Hypolite Petovan 9b64035231 ActivityPub: Add support for non-link mentions
- This enables implicit mention removal even if the remote server doesn't add links to mentions in the message body.
- This also enable interactive mentions in the message body when implicit mentions are disabled.
2021-08-18 14:36:21 -04:00
Hypolite Petovan f0bb83c225
Merge pull request #10613 from annando/improved-payload
The push api payload content is improved
2021-08-18 13:45:18 -04:00
Michael Vogel 9bc6b08618
Update src/Worker/PushSubscription.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2021-08-18 18:54:03 +02:00
Michael 6f6fe7fa25 Clarify the upcoming functionality 2021-08-18 10:27:45 +00:00
Michael Vogel 486328336f
Merge pull request #10611 from MrPetovan/task/feed-debug-contact
Allow contact creation in Module\Debug\Feed
2021-08-18 10:05:38 +02:00
Michael b521e45903 Merge remote-tracking branch 'upstream/develop' into improved-payload 2021-08-17 23:00:00 +00:00
Michael 5a9db1b3bc The push api payload content is improved 2021-08-17 22:53:52 +00:00
Hypolite Petovan 0a592fbf34 Abort early if owner isn't found in Module\RemoteFollow
- Address https://github.com/friendica/friendica/issues/10473#issuecomment-899099987
2021-08-17 09:38:35 -04:00
Hypolite Petovan 6f13663c45 Return early if body is empty in Network\Probe::updateFromFeed
- Address https://github.com/friendica/friendica/issues/10473#issuecomment-894815271
2021-08-17 09:35:44 -04:00
Hypolite Petovan a04944d443 Allow contact creation in Module\Debug\Feed
- This module only allowed existing contact feeeds to be debugged
2021-08-17 08:20:58 -04:00
Hypolite Petovan 64d6df659d
Merge pull request #10609 from tobiasd/20210816-10514
Issue 10514: add TLS check to the installer
2021-08-17 07:58:17 -04:00
Tobias Diekershoff e1c961cc64
Merge pull request #10607 from MrPetovan/task/advancecontentfilter-attachments
Add the attachments to the $item for the prepare_body_content_filter hook
2021-08-17 12:40:49 +02:00
Tobias Diekershoff ae6e13815d rewording the encouragement and regen of the messages.po 2021-08-17 08:38:06 +02:00
Tobias Diekershoff 6cd9f26771 add encuragement 2021-08-17 08:38:06 +02:00
Tobias Diekershoff e16e9bd929 typo 2021-08-17 08:38:06 +02:00
Tobias Diekershoff cafb91ec62 Issue 10514: add TLS check to the installer
This PR adds a check to the installer which tries to determine whether the
request to the installer was made over an HTTPS line or not.

I've only tested it with an Apache2 server, but there it works.

Addresses #10514
2021-08-17 08:38:06 +02:00
Philipp db6fded5d2
Update src/Core/StorageManager.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2021-08-16 23:32:32 +02:00
Philipp Holzer 99239e3d99
Fix usage 2021-08-16 23:27:43 +02:00
Philipp Holzer 1901716479
Lower complexity for valid backends (replace hashmap with a "simple" name array) 2021-08-16 23:27:43 +02:00
Philipp Holzer 02a4d30f7d
Add todo for later 2021-08-16 23:27:43 +02:00
Philipp 1df6225868
Update src/Model/Storage/Filesystem.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2021-08-16 23:27:42 +02:00
Philipp f4941b5b49
Update src/Model/Storage/IWritableStorage.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2021-08-16 23:27:42 +02:00
Philipp Holzer c17bc55158
Introduce InvalidClassStorageException and adapt the code for it 2021-08-16 23:27:42 +02:00
Philipp Holzer d0536ebea7
Rename ISelectableStorage to IWritableStorage 2021-08-16 23:27:42 +02:00
Philipp Holzer eb035771f1
Revert Photo::getImageDataForPhoto return-type change 2021-08-16 23:27:42 +02:00
Philipp Holzer 51ebb1541a
- Revert HTTPSignature change 2021-08-16 23:27:42 +02:00
Philipp Holzer 57438afbb3
- Moved the description for the specific storage exception first
- Introduced exceptions for try to get invalid storage
- ReferenceStorageException now extends StorageException
2021-08-16 23:27:42 +02:00
Philipp Holzer 470ba8b61b
Fixup Database behaviour 2021-08-16 23:27:42 +02:00
Philipp Holzer 90c99520bb
Fix Storage Exceptions 2021-08-16 23:27:42 +02:00
Philipp Holzer 29c7552df5
Refactor IStorage 2021-08-16 23:27:42 +02:00
Philipp Holzer 5dcdf2322e
Split IStorage and ISelectableStorage and make their behaviour homogenous 2021-08-16 23:27:41 +02:00
Hypolite Petovan e205bd450e
Merge pull request #10602 from annando/push
Transmit push subscriptions
2021-08-16 14:33:36 -04:00
Michael 7158b35f58 Added logging, removed superfluous comments 2021-08-16 15:23:34 +00:00
Hypolite Petovan 7082582655 Add the attachments to the $item for the prepare_body_content_filter hook
- Allows filtering on attachments that are added later to the post content
2021-08-16 05:28:08 -04:00
Michael ce9da778b9 Clarify XMPP profile field description 2021-08-16 06:15:18 +00:00
Michael c85ce2f6b0 Add a payload 2021-08-16 06:11:26 +00:00
Michael 69c816eb17 Trim whitespace 2021-08-15 22:09:32 +00:00
Michael e3f8f371a7 Use the existing VAPID key generation 2021-08-15 21:54:24 +00:00
Michael 2c1b33af87 Standards 2021-08-15 21:30:27 +00:00
Michael 69f11c4a84 Adding the VAPID keys 2021-08-15 21:24:23 +00:00
Michael d5e9253adb Standards again 2021-08-15 21:03:43 +00:00
Michael 5cf0da4140 Coding standards 2021-08-15 21:01:58 +00:00
Michael 977d28353c Transmit push subscriptions 2021-08-15 20:52:46 +00:00
Hypolite Petovan 414f20c529
Merge pull request #10600 from nupplaphil/bug/update_autoinstall_doc
AutomaticInstallation - Fix last example
2021-08-15 16:50:58 -04:00
Philipp Holzer b52c9215f6
AutomaticInstallation - Fix last example 2021-08-15 21:36:05 +02:00
Michael c78d490c2e Some more standards 2021-08-15 16:24:12 +00:00
Michael f29cef175e Remove spaces 2021-08-15 16:22:23 +00:00
Michael 19f3cad56c Preparation for creating push notification 2021-08-15 16:18:25 +00:00
Michael 5056376902 We need to create a vapid public and private key 2021-08-15 12:57:29 +00:00
Michael 74f3cbc383 Improved error check, added "put" 2021-08-15 07:28:26 +00:00
Michael 8b6ace6629 Don't continue when key couldn't be created 2021-08-15 06:45:48 +00:00
Michael 167a12ef54 Styling 2021-08-15 00:43:07 +00:00
Michael e28a4265c5 API: First steps to support subscriptions 2021-08-15 00:30:41 +00:00
Hypolite Petovan 1e305e748d
Merge pull request #10596 from annando/mark-file-star-for-all
Follow, file and star does now work for all items
2021-08-12 12:20:55 -04:00
Michael Vogel fa65c436f4
Apply suggestions from code review
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2021-08-12 18:04:01 +02:00
Hypolite Petovan a364436623
Merge pull request #10597 from annando/warning
Fixes "PHP Warning:  key() expects parameter 1 to be array, string given"
2021-08-12 11:48:35 -04:00
Michael Vogel f7f79a240a Are the tests happy? 2021-08-12 15:12:41 +02:00
Michael Vogel e6ab4d9be9 Fixes "PHP Warning: key() expects parameter 1 to be array, string given" 2021-08-12 14:00:54 +02:00
Michael 81d9fc677f Updated messages.po 2021-08-12 06:33:08 +00:00
Michael 473adaf463 Mark, file and starring does now work for all items 2021-08-12 05:28:47 +00:00
Michael Vogel b855646097
Merge pull request #10580 from MrPetovan/bug/10019-peertube-embed
Simplify attachment processing in Protocol\ActivityPub\Receiver
2021-08-11 13:56:33 +02:00
Michael ce46ab2573 The Matrix and XMPP address is now transported via AP as well 2021-08-10 23:49:09 +00:00
Hypolite Petovan 56ee1a211f
Merge pull request #10592 from annando/event
Simplify event storing
2021-08-10 09:00:41 -04:00
Michael 8e074a5fe4 Simplify event storing 2021-08-10 10:24:14 +00:00
Michael 56c00ea42d Handles PHP Notice: Undefined index: addr in src/Protocol/Diaspora.php on line 3091 2021-08-10 03:50:43 +00:00
Hypolite Petovan d7e5814b12 Simplify attachment processing in Protocol\ActivityPub\Receiver
- Remove indexing attachments by mediatype for later sorting
2021-08-09 19:29:12 -04:00
Michael 28cfdec7c4 Some more renamed functions 2021-08-09 20:56:15 +00:00
Michael c81e81dc8d "getUserId" is now "getLoggedInUserId" 2021-08-09 20:33:46 +00:00
Michael 15b93b4459 "getUserNickname" is now "getLoggedInUserNickname" 2021-08-09 19:48:39 +00:00
Michael f5e84c1ff0 Use owner not profile 2021-08-09 15:38:22 +00:00
Michael 4495e83eca Merge remote-tracking branch 'upstream/develop' into app-user2 2021-08-09 15:32:32 +00:00
Michael b8fa75b2dd Changed function name 2021-08-09 15:29:07 +00:00
Hypolite Petovan 3e1e3c8b3e
Merge pull request #10588 from annando/matrix
Matrix addresses can be entered in the profile
2021-08-09 10:56:12 -04:00
Michael 51d549639d Fix profile probing via Pleroma 2021-08-09 06:56:41 +00:00
Michael bee04f86ee Matrix addresses can be entered in the profile 2021-08-09 01:39:09 +00:00
Michael 9f01052dd2 Removed some more unused "use" 2021-08-08 20:03:28 +00:00
Michael a9d7e5b29e Removed unused use 2021-08-08 19:43:15 +00:00
Michael 28090bd793 Get rid of App->user completely 2021-08-08 19:30:21 +00:00
Michael fc283ab928 Remove direct calls to App->user 2021-08-08 10:14:56 +00:00
Michael 9664efd66b Added some description 2021-08-07 20:09:25 +00:00
Michael 6a23b17c95 Respect the postopts values for scheduled posts 2021-08-06 18:49:17 +00:00
Tobias Diekershoff 266ee26240
Merge pull request #10579 from annando/http-errors
Avoid some HTTP errors
2021-08-06 08:11:35 +02:00
Michael a8442e41ab Improved error message for external resources 2021-08-06 04:02:42 +00:00
Michael 4bc3e8c141 Don't send "accept" when we accept anything 2021-08-06 04:02:22 +00:00
Tobias Diekershoff 0e54d35f65
Merge pull request #10575 from MrPetovan/bug/10019-peertube-embed
Extract MP4 video URL from PeerTube ActivityPub metadata to enable video embed
2021-08-05 18:11:07 +02:00
Hypolite Petovan f194d167b0 Extract MP4 video URL from PeerTube ActivityPub metadata to enable video embed
- This MP4 video URL is located in the tags of the streaming URL link element that we don't support yet
2021-08-05 10:51:42 -04:00
Michael d6c25dc63c Handle profile page detection without a type 2021-08-05 11:37:04 +00:00
Michael eec6cdf01b Avoid a database query when possible 2021-08-05 08:51:39 +00:00
Michael 835152d418 Simplified signature creation 2021-08-05 08:42:46 +00:00
Michael a26a2a0228 Make the system owner ready for Diaspora 2021-08-05 08:30:44 +00:00
Michael Vogel c73130aa6b Create the Diaspora signature for the correct user 2021-08-05 08:58:50 +02:00
Michael 1c5baddcd2 Don't use the system user for participation messages 2021-08-04 12:35:03 +00:00
Michael Vogel 25f0f0c439 Display the publish time in the local timezone 2021-08-04 07:58:07 +02:00
Michael ec3eead034 Don't set the pconfig values on manual mode 2021-08-03 05:39:04 +00:00
Hypolite Petovan 37d5bc1a51
Merge pull request #10566 from annando/manage-avatar
Use the general function ro create an avatar path
2021-08-02 18:50:15 -04:00
Michael 9f19adf8bb Use the general function ro create an avatar path 2021-08-02 22:28:42 +00:00
Michael 6c8a4a2552 Use a centralized function to delete delayed entries 2021-08-02 20:56:34 +00:00
Michael 88e276843e Using "post" when deleting, fixing deleting 2021-08-02 19:18:44 +00:00
Michael f87e41e206 Scheduled posts are now listed and can be deleted 2021-08-02 17:03:06 +00:00
Michael ec5ed0cf46 Placeholder page for scheduled posts 2021-08-02 12:10:03 +00:00
Michael 8214401b57 Merge remote-tracking branch 'upstream/develop' into scheduled-frontend 2021-08-01 13:12:25 +00:00