Commit graph

1837 commits

Author SHA1 Message Date
Roland Häder 3f74a59f73
Added some type-hints 2022-06-23 17:30:14 +02:00
Roland Häder 0ddb315b23
$id in Transmitter::sendContactAccept() is a string, see Introduction class 2022-06-23 16:48:00 +02:00
Roland Häder 636fef26f1
Maybe this fixes missing array element 2022-06-23 07:40:49 +02:00
Roland Häder 7eefb9aed8
Changed:
- empty() is maybe superflous here, still I would prefer a code style that is
  written explicitly and not rely on "magic casting"
2022-06-22 18:57:01 +02:00
Roland Häder b996712ef7
Images::getInfoFromURL[Cached]() will both return empty arrays on error and
that needs to be reflected here, too.
2022-06-22 17:20:59 +02:00
Roland Häder 101cd2dd10
Changes:
- added some documentation
- fixed some documentation
- changed more double-quotes to singl
2022-06-22 16:14:14 +02:00
Roland Häder ba45e59313
Changes:
- added more type-hints
- added missing documentation
- Email::send() now returns what mail() returns (bool)
2022-06-22 14:36:48 +02:00
Roland Häder 2dd7d465e8
Changes:
- added more type-hints
- updated documentation
- changed double-quotes to single
2022-06-22 14:36:47 +02:00
Roland Häder 74ab7648c6
Changes:
- addHubLink()'s 2nd parameter is DOMElement
- added more type-hints
- converted double-quotes to single
2022-06-22 14:36:46 +02:00
Roland Häder abd0d9f3fd
Changes
- added type-hints
- added some documentation
- added default: block for unknown 'rel' value
- changed return type void to empty array
2022-06-22 14:36:45 +02:00
Roland Häder 77c37ff2db
Fixed:
- Uncaught Exception TypeError: "Argument 3 passed to
  Friendica\Protocol\DFRN::createActivity() must be of the type string, null
  given, called ..."
2022-06-21 13:47:37 +02:00
Roland Häder 95f9eb34ac
Fixed indenting 2022-06-21 01:29:33 +02:00
Roland Häder fbae0b8bcf
Changes:
- renamed ItemArrayFromMail() to getItemArrayFromMail() to follow naming-convetion
- added missing type-hints
- added missing documentation
2022-06-20 21:22:46 +02:00
Roland Häder ea22e88896
Added documentation 2022-06-20 21:02:34 +02:00
Roland Häder 752953e472
Changes:
- as @MrPetovan pointed out, $actor can be NULL earlier and used later as NULL
- added some missing type-hints
- added missing documentation
- the added @TODO points out to avoid true|false|null for a boolean
2022-06-20 21:00:19 +02:00
Roland Häder 0c12e947dd
Changes:
- null was 2nd argument's value before, an empty string is basically the same here
2022-06-20 20:01:59 +02:00
Roland Häder 4fb03cf163
Changes:
- fixed a null value handled over to Friendica\Model\APContact::getByURL()
- added missing type-hints
2022-06-20 19:05:02 +02:00
Roland Häder a0c8fc6d6e
Changes:
- added more type-hints
2022-06-20 02:48:02 +02:00
Roland Häder d276f2c62b
Changes:
- added type-hints
- changed some double-quotes to single
2022-06-20 01:00:29 +02:00
Roland Häder 41f34c4261
Maybe fix for:
"Argument 1 passed to Friendica\Model\ItemURI::getIdByURI() must be of the type string, null given, called in Processor.php line 1219"
2022-06-18 18:30:50 +02:00
Roland Häder 7cbb818c93
Set type-hint for parameter $data to SimpleXMLElement as $fields in dispatch()
is the same and being handled over.
2022-06-18 05:19:24 +02:00
Roland Häder 89302d0843
Some outside code relies on returned "false" 2022-06-18 05:06:18 +02:00
Roland Häder aaf5c323b6
Fixed indenting 2022-06-18 05:04:14 +02:00
Roland Häder adb4aea6ad
Changes:
- added some type-hints
- replaced most double-quotes (only Diaspora.php, later more) with single
- added some documentation
- normalized indenting in Diaspora.php (I hope I got all?)
2022-06-18 05:03:10 +02:00
Roland Häder a770634b95 Ops, wrong type 2022-06-17 17:18:31 +02:00
Roland Häder 36d56a4041 Continued:
- changed back to 'return false;' as other methods heavily rely on false instead
  of an empty array as pointed out by @heluecht@pirati.ca
- $fetched_contact should be initialized as an empty array, let's not make this
  code more crazier than it already is (see APContact::getByURL())
2022-06-17 17:18:31 +02:00
Roland Häder 605e7d55b3 Continued:
- added more type-hints
- some methods in Diaspora returned void but integer was documented so I
  changed it to -1 to have a proper type-hint
2022-06-17 17:18:31 +02:00
Roland Häder 0c9aff8a09 Also need to declare $profile or otherwise an invocation of
Receiver::getReceiverForActor() will fail.
2022-06-17 17:18:31 +02:00
Roland Häder 5c9ce790bf Fixed:
- $object_data['actor'] can be null, but Receiver::getReceivers()'s 2nd
  parameter expect it to be string
2022-06-17 17:18:31 +02:00
Roland Häder a587217f47 Fixed "Argument 4 passed to Friendica\Protocol\DFRN::processVerbs() must be of the type bool" 2022-06-17 17:18:31 +02:00
Roland Häder c351099c5a Ops, bad type-hint here 2022-06-17 17:18:31 +02:00
Roland Häder c2e889cfae Added more type-hints 2022-06-17 17:18:31 +02:00
Roland Häder 51a7b5c584
Made also this one sweeter (null-coalscing) 2022-06-16 17:36:47 +02:00
Roland Häder e8fee5644b
Ops, syntax errors get unnoticed with a simple editor. :-( 2022-06-16 17:10:02 +02:00
Roland Häder 624e4c192c
Changed to null-coalscing style (??) as sugguested by @MrPetovan 2022-06-16 16:59:54 +02:00
Roland Häder 7814ba4fc4
Fixes for bad invocations of HTML::toBBCode() (1st parameter is now string) 2022-06-16 16:54:50 +02:00
Roland Häder b200874f17
Ops:
- wrong way around (!empty($foo)) is proper
- also needed to be checked on $acitivty['content']
2022-06-16 16:54:50 +02:00
Roland Häder b1e4c0931a
Fixes and type-hints:
- added more checked type-hints as they prevent bad method invocations
- fixed TypeError for HTML::toBBCode() invocations with NULL as first (wrong)
  argument, thanks to @tobias@social.diekershoff.de pointing this out.
2022-06-16 16:54:49 +02:00
Michael d7d8a6ab55 Issue 11625: Don't parse the title through Markdown 2022-06-11 06:50:59 +00:00
Michael cc6192df02 Issue 10926: Transmit pending events to accepted contacts 2022-05-30 20:52:43 +00:00
Michael 74b102b948 Increase the delivery queue counter on drop 2022-05-24 17:28:35 +00:00
Michael 034d838248 Ignore delivery problems with drops 2022-05-24 12:27:35 +00:00
Michael 8969e83134 Use a better query to fetch the relay actor 2022-05-24 08:06:48 +00:00
Michael e68ff3b3bb Return the actor, not the array 2022-05-24 08:02:55 +00:00
Michael b1a2de5cb5 Resubscribe to relay servers 2022-05-24 07:02:42 +00:00
Michael 6ce23bd9ca Fixed code structure 2022-05-20 04:42:10 +00:00
Michael dc16e6d471 The worker is split into several classes 2022-05-19 19:24:21 +00:00
Michael c3fd8b39aa Caching for profiles removed 2022-05-17 12:53:31 +00:00
Michael 4e3e9dc763 Cache the profile as well 2022-05-17 12:46:55 +00:00
Michael 73019284ce Increase cache lifespan / clear cache upon changes 2022-05-17 12:32:25 +00:00
Michael 610f8a086f Use cache key constants 2022-05-17 08:17:41 +00:00
Michael 1ccf22a496 AP endpoints are now cached 2022-05-17 04:58:54 +00:00
Michael 324cce7a19 Issue 11472: Store the "edit" history 2022-05-15 20:21:56 +00:00
Michael 5af7c30026 Issue 11508: Sanitizing date fields for events and polls 2022-05-15 18:00:19 +00:00
Michael 47cd1edb9f Change the featured collection to fix communication issues with Pleroma 2022-05-13 03:42:04 +00:00
Michael 632a98965c Fetch contact via uri-id to improve performance 2022-05-03 08:19:35 +00:00
Michael 060597f619 Store the tag type for the post targets 2022-04-23 11:39:19 +00:00
Michael eb1f38df22 Issue 11427: id values of OrderedCollections have to contain the page number 2022-04-21 04:29:08 +00:00
Michael 834844573b We can now store incoming questions 2022-04-20 06:28:02 +00:00
Michael eaa8163201 Preparation for storing incoming polls 2022-04-15 09:11:50 +00:00
Michael 0d8cf06e4a Experimental feature to enter a custom creation date 2022-04-13 05:31:32 +00:00
Michael 62367923e0 Fix several notices 2022-04-11 18:57:30 +00:00
Hypolite Petovan 3842f02b02
Merge pull request #11402 from annando/featured-endpoint
We now offer an endpoint for featured posts
2022-04-11 11:17:56 -04:00
Michael d15023fe4b Unified JSON exit 2022-04-09 11:58:01 +00:00
Michael d7df0825db We now offer an endpoint for featured posts 2022-04-08 21:25:31 +00:00
Hypolite Petovan 4eecf733e1
Merge pull request #11389 from nupplaphil/feat/http_client_arg
Introduce explicit HttpClient "Accept" parameter
2022-04-08 15:05:40 -04:00
Michael 69b7923df2 Use centralized function to fetch query results 2022-04-08 06:04:50 +00:00
Michael 2764859350 Remove unfeatured posts from collection 2022-04-08 04:49:23 +00:00
Michael 75bc4eccb7 Display featured posts for contacts 2022-04-07 21:52:25 +00:00
Michael a1dd299eb3 Preparations for "featured" posts 2022-04-06 13:34:11 +00:00
Michael e6ea015cb4 "Person" is "Account" 2022-04-05 20:06:04 +00:00
Michael c0b3c527d6 Added processing of incoming block notices 2022-04-05 19:14:29 +00:00
Michael dcbca0c6a3 Store "View" activity from Peertube 2022-04-05 07:48:38 +00:00
Michael a5a5a4b603 Cleaned code 2022-04-05 05:53:17 +00:00
Michael 61abc6377d Preparation for "Featured" collection added 2022-04-04 23:07:44 +00:00
Michael e6caed7b5f Merge remote-tracking branch 'upstream/develop' into new-acitivities 2022-04-04 16:05:02 +00:00
Michael aa2a32d16f Store the "EmojiReact" activity 2022-04-04 16:03:53 +00:00
Hypolite Petovan eceaf782cc
Merge pull request #11385 from annando/ap-receiver-unhandled
Added handling of some previously unhandled activities
2022-04-04 10:59:35 -04:00
Philipp Holzer 04866195b4
Remove accept parameter for head/post again 2022-04-03 19:33:09 +02:00
Michael 1475f53e21 Merge branch 'ap-receiver-unhandled' of github.com:annando/friendica into ap-receiver-unhandled 2022-04-03 07:45:19 +00:00
Michael 39a1745361 Prevent the warning of an Undefined array key "object_object_type" 2022-04-03 07:45:15 +00:00
Michael 029daef997 Only use and accept valid http links as links to an external resource 2022-04-03 07:21:36 +00:00
Michael Vogel 5fe75ed50d
Update src/Protocol/ActivityPub/Receiver.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2022-04-02 23:04:44 +02:00
Philipp Holzer e299fc67c8
Introduce "accept_header" as specific argument to the http client 2022-04-02 21:16:53 +02:00
Philipp Holzer 73c3b21665
Move ACCEPT constants to own "enum" class 2022-04-02 20:26:11 +02:00
Michael 1db3143dc5 added empty object type 2022-04-01 21:27:40 +00:00
Michael 71afbabbd8 Added handling of some previously unhandled activities 2022-04-01 11:20:17 +00:00
Michael 2ca51f752d Use appropriate "accept" values 2022-03-30 14:39:53 +00:00
Michael 3e21b035b7 Added logging 2022-03-29 17:26:31 +00:00
Michael 1fae0123ec Some more "accept" parameters are added 2022-03-29 06:24:20 +00:00
Michael 212eba327b Improve the compatibility with Lemmy 2022-03-24 10:57:55 +00:00
Michael 53ba68e222 Remove "blubb" 2022-03-22 12:31:14 +00:00
Michael 45199b498d Prevent further processing of incoming posts when thay are rejected 2022-03-22 12:28:47 +00:00
Hypolite Petovan 9eb6299f19 Check array key existence in ActivityPub\Transmitter::createPermissionBlockForItem
- APContact::getByURL can return empty array
- Address https://github.com/friendica/friendica/issues/11218#issuecomment-1066753232
2022-03-19 03:15:08 -04:00
Michael 0aa229489f Improved function description 2022-03-18 07:24:45 -04:00
Michael 7940b31685 Don't use the GUID value directly 2022-03-14 21:09:14 +00:00
Michael 0956d1dd64 Don't send forum posts to the user's followers 2022-03-14 06:07:51 +00:00
Michael 2642996171 Send community posts only to the community 2022-03-13 19:31:21 +00:00
Michael ca086b880b Some small improvements for importing feeds 2022-03-13 15:29:07 +00:00
Michael 314bf92ead Added Documentation 2022-03-12 17:29:46 +00:00
Michael fb13890341 Added parameter values 2022-03-12 15:27:56 +00:00
Michael 8c778ca02e Improved completion check for AP 2022-03-12 11:17:33 +00:00
Michael 56cd98b38b Further improved logging 2022-03-12 07:48:31 +00:00
Michael c1bb1cf0fc Improved logging 2022-03-12 07:34:30 +00:00
Michael 5a16a424ac Issue 11309: improved check for wanted posts 2022-03-12 07:08:10 +00:00
Michael 5eb647585d Issue 11315: Fix for all receivers in "to" 2022-03-11 20:39:03 +00:00
Michael f264923cad Issue 11309: Check if a post is wanted 2022-03-11 14:00:05 +00:00
Hypolite Petovan c13ae36256
Merge pull request #11305 from annando/api-spoiler
API: Improve support for the summary field
2022-03-08 15:48:46 -05:00
Michael e0468ac914 API: Improve support for the summary field 2022-03-08 18:32:09 +00:00
Michael 8039ab731f Type hints reverted 2022-03-08 18:26:59 +00:00
Michael Vogel acba7d25a0
Apply suggestions from code review
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2022-03-06 14:15:59 +01:00
Michael 31dbdd3677 variable type for the return value is added 2022-03-06 12:21:27 +00:00
Michael Vogel 1ec1adf904
Apply suggestions from code review
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2022-03-06 05:49:49 +01:00
Michael 421dd028ce Fix storing mail settings 2022-03-05 13:08:09 +00:00
Hypolite Petovan 6a1f9a7fa3 Move unfollow protocol to worker task
- Add uid parameter to unfollow hook
- Rework and unify Contact::unfollow, Contact::removeSharer and Contact::terminateFriendship
- Add missing twitterUser property to Twitter\Friendships\Destroy module
2022-02-24 09:35:54 -05:00
Hypolite Petovan 52f5d924b7 Replace remaining instances of DBA::update('contact') with Contact::update()
- This was breaking the synchronisation between the contact and user-contact tables
2022-02-24 09:35:54 -05:00
Michael 59630a2c82 Improve the name of the "followers" receiver 2022-02-23 20:18:37 +00:00
Michael 311c1fdd81 Avoid warning and notice 2022-02-20 05:14:36 +00:00
Michael 00f39cd308 Reverted change 2022-02-19 20:32:19 +00:00
Michael 22952f88ca SImplify code 2022-02-19 19:45:27 +00:00
Michael c867581530 Store the receivers of a post in the tags 2022-02-19 13:31:49 +00:00
Hypolite Petovan c03ff7833b
Merge pull request #11253 from annando/forum3
More rework to make private communities working
2022-02-18 12:19:57 -05:00
Hypolite Petovan c376081d0d Relax comparison with pconfig system.accept_only_sharer value
- DI::pConfig()->get returns a string value, not an integer
- Removed superfluous default values now that we aren't doing strict type checking
2022-02-18 09:32:30 -05:00
Michael 51fb265621 Merge remote-tracking branch 'upstream/develop' into forum3 2022-02-17 07:11:50 +00:00
Michael 9ac24a0f36 More rework to make private communities working 2022-02-16 22:56:55 +00:00
Hypolite Petovan 99979019bf Expand system.accept_only_sharer pconfig value to include previous behavior with likes 2022-02-15 15:54:36 -05:00
Michael 29d83c0ffb Block communication with Diaspora for communities 2022-02-15 07:08:02 +00:00
Michael d404f15312 Improve local forum distribution 2022-02-14 22:04:33 +00:00
Michael a5a1c81790 Fetch the user id when not provided 2022-02-13 16:42:43 +00:00
Michael ee3a8ccb3b No notifcations for forum / fetch user for fetching content 2022-02-13 05:45:06 +00:00
Michael e394143148 Private forums are now working via ActivityPub 2022-02-12 18:38:36 +00:00
Michael cdee2b44db Avoid thread completion on activities 2022-02-12 13:05:56 +00:00
Hypolite Petovan 1b73e4d267
Merge pull request #11230 from annando/account-type
Use "account-type" instead of "page-flags"
2022-02-09 22:23:55 -05:00
Michael 9a764516d0 Use the "contact-type" instead of "forum" or "prv" 2022-02-09 06:52:16 +00:00
Michael b857c26999 Use "account-type" instead of "page-flags" 2022-02-09 05:56:12 +00:00
Michael f87b80266c Display followers for followers of private forums 2022-02-08 21:05:15 +00:00
Hypolite Petovan 121e40357c
Merge pull request #11209 from annando/issue-10365-Events
Issue 10365: Event updates are now processed
2022-02-05 12:08:00 -05:00
Michael 3e51309525 Check for a filled "event-id" field 2022-02-05 16:22:21 +00:00
Michael 4914ee423f Issue 10914: Display events in the feed in the author's timezone 2022-02-05 11:29:50 +00:00
Michael bd8032f2ba Issue 10365: Event updates are now processed 2022-02-05 11:16:50 +00:00
Michael 11b6c29a3a Fix for PR #11204 - Forums are now correctly detected 2022-02-04 06:02:21 +00:00
Michael 695d6ce461 Issue 10966: Ignore "only sharer" setting for forum accounts 2022-02-03 20:26:30 +00:00
Michael 9eec2bf5f3 Improved support for "Page" type 2022-01-27 17:51:23 +00:00
Michael ad526f5ad2 set the post-type to "poll" for incoming poll posts 2022-01-23 05:50:39 +00:00
Michael a8c6160dd7 Improved handling of several object types 2022-01-23 04:40:45 +00:00
Michael 43b9e39c6a Lemmy support added 2022-01-22 15:24:51 +00:00
Philipp 322b7c856c
Merge pull request #11129 from urbalazs/copyright-2022
Update copyright
2022-01-02 09:45:35 +01:00
Balázs Úr e56a53647b Update copyright 2022-01-02 08:27:47 +01:00
Michael a97bfb512a Issue 11104: Don't cann the addons on Diaspora reshare 2021-12-20 21:16:00 +00:00
Hypolite Petovan 13efe0eff0 Add logging for unexpected empty published key in activity 2021-12-12 21:46:59 -05:00