Compare commits

..

1135 Commits

Author SHA1 Message Date
Tobias Diekershoff eeadc00e83 bump VERSION to 2022.12 2022-12-20 06:48:39 +01:00
Tobias Diekershoff e54267e0cf set the release date for the 2022.12 release in the CHANGELOG 2022-12-20 06:48:23 +01:00
Tobias Diekershoff 1f889b6086
Merge pull request #12453 from tobiasd/2022.12-CHANGELOG
CHANGELOG updates for 2022.12
2022-12-20 06:31:53 +01:00
Tobias Diekershoff 3f9b8ec1e5
Merge pull request #12484 from tobiasd/20221220-credits
foss to foss- in the CREDITS
2022-12-20 06:16:56 +01:00
Tobias Diekershoff b6cc2ddc48 foss to foss- in the CREDITS 2022-12-20 06:12:44 +01:00
Tobias Diekershoff 455b3faa14 some last update to the CHANGELOG 2022-12-20 06:04:37 +01:00
Hypolite Petovan 0d4ea4b7f0
Merge pull request #12483 from annando/issue-12419
Issue 12419: Quickhack to make GoToSocial work
2022-12-19 16:24:58 -05:00
Michael e733adcaae Issue 12419: Quickhack to make GoToSocial work 2022-12-19 21:21:06 +00:00
Hypolite Petovan 45ee7d55f0
Merge pull request #12482 from annando/fix-reachable
Fix delivery problems with "reachable" test
2022-12-19 14:48:45 -05:00
Michael d39f4014e4 Fix delivery problems with "reachable" test 2022-12-19 19:41:04 +00:00
Hypolite Petovan 5110c11885
Merge pull request #12480 from foss-/patch-5
update FAQ client list: remove Fedi from iOS apps
2022-12-19 14:18:00 -05:00
foss- 0fee47e0c6
update FAQ client list: remove Fedi from iOS apps
Their github https://github.com/Big-Fig/Fediverse.app links to a dead website https://fedi.app/fediapp and no updates for over a year. iOS App Store won't load app at https://apps.apple.com/us/app/fedi-for-pleroma-and-mastodon/id1478806281
2022-12-19 20:04:21 +01:00
Philipp 20374ab5a2
Merge pull request #12447 from MrPetovan/bug/12441-profile-contacts
Retrieve contact records for the page visitor in several modules
2022-12-19 17:14:43 +01:00
Philipp c9f92f41fb
Merge pull request #12479 from MrPetovan/bug/deprecated
Fix several Deprecated notices
2022-12-19 17:13:12 +01:00
Philipp 275347b087
Merge pull request #12478 from MrPetovan/bug/12476-profiles-inaccessible
Fix module instantiation in Profile\Index module
2022-12-19 17:12:27 +01:00
Hypolite Petovan f2188835e7 Add logging and default value when JSON encode->decode fails in JsonLD::compact
- Address part of https://github.com/friendica/friendica/issues/12011#issuecomment-1357768936
2022-12-19 10:22:05 -05:00
Hypolite Petovan 06ea61f0ed Provide default value for system.banner config key
- Address part of https://github.com/friendica/friendica/issues/12011#issuecomment-1357768936
2022-12-19 10:17:57 -05:00
Hypolite Petovan 6a17223289 Ward against null value in language key of item array in Mastodon\Status object
- Address part of https://github.com/friendica/friendica/issues/12011#issuecomment-1357768936
2022-12-19 10:11:12 -05:00
Hypolite Petovan b1b0bfc280 Don't compute system.update_interval when it's -1 (disabled)
- Address part of https://github.com/friendica/friendica/issues/12011#issuecomment-1357768936
2022-12-19 10:05:21 -05:00
Hypolite Petovan eb9af005f0 Fix module instantiation in Profile\Index module
- Address https://github.com/friendica/friendica/issues/11992#issuecomment-1357441775
2022-12-19 09:50:42 -05:00
Hypolite Petovan 29330a4205 Remove DI dependency in Profile\Status module 2022-12-19 09:50:42 -05:00
Hypolite Petovan 9da21bf680 Remove fallback contact query from Model\Contact::photoMenu
- Correct contact is now supplied to the method
2022-12-19 09:50:18 -05:00
Hypolite Petovan 2d9633a595 Retrieve contact records for the page visitor in Profile\Common module 2022-12-19 09:50:18 -05:00
Hypolite Petovan 472bde99a4 Retrieve contact records for the page visitor in Contact\Contacts module 2022-12-19 09:50:17 -05:00
Hypolite Petovan fca1abbafe Retrieve contact records for the page visitor in Profile\Contacts module 2022-12-19 09:50:17 -05:00
Hypolite Petovan 36a8962333 Remove DI dependency in Contact\Hovercard module 2022-12-19 09:50:17 -05:00
Hypolite Petovan 7458721f9f Remove DI dependency in Profile\Common module 2022-12-19 09:50:16 -05:00
Hypolite Petovan a633532475 Remove DI dependency in Contact\Contacts module 2022-12-19 09:50:16 -05:00
Hypolite Petovan cef408c842 Remove DI dependency in Module\Profile\Contacts 2022-12-19 09:50:16 -05:00
Hypolite Petovan f9dcb7c6d4
Merge pull request #12475 from annando/no-failed-delivery
Don't perform a delivery to failing servers
2022-12-19 09:26:00 -05:00
Michael Vogel 8f22b4f33d
Update src/Model/GServer.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2022-12-19 15:22:21 +01:00
Michael feb74b4d9a Don't perform a delivery to failing servers 2022-12-19 09:30:56 +00:00
Tobias Diekershoff b79daee21b more issues closed 2022-12-19 07:44:46 +01:00
Tobias Diekershoff 86a486f62b
Merge pull request #12472 from MrPetovan/bug/12466-profile-photos-aside
Remove VCard for owner in Profile\Photos module
2022-12-19 07:38:13 +01:00
Tobias Diekershoff 9d38671ec9
Merge pull request #12471 from MrPetovan/bug/12468-bbcode-img-code
Skip literal text in ActivityPub\Transmitter::removePictures
2022-12-19 07:03:31 +01:00
Tobias Diekershoff b4db8fe8d2
Merge pull request #12469 from MrPetovan/bug/12462-tos-rules
Skip blank lines in Tos module
2022-12-19 06:58:42 +01:00
Tobias Diekershoff a522267c9d
Merge pull request #12470 from MrPetovan/bug/12452-profile-field-URL
Convert custom profile field URL values to rel="me" links
2022-12-19 06:57:56 +01:00
Hypolite Petovan 5392bafbb4 Remove VCard for owner in Profile\Photos module
- Remove unused remote contact retrieval
- Remove contact list from aside for non-owner visitors
2022-12-18 23:52:33 -05:00
Hypolite Petovan 2372e50e3b Skip literal text in ActivityPub\Transmitter::removePictures 2022-12-18 23:32:52 -05:00
Hypolite Petovan 39607b20e2 Convert custom profile field URL values to rel="me" links 2022-12-18 23:24:59 -05:00
Hypolite Petovan 76e9c4daa2 Fix link to profile page in custom profile fields settings
- Previous link was leading to conversations
2022-12-18 22:49:49 -05:00
Hypolite Petovan 07f7585e40 Remove DI dependency in Profile\Profile module 2022-12-18 22:49:18 -05:00
Hypolite Petovan 1cc0c1148e Skip blank lines in Tos module 2022-12-18 22:16:41 -05:00
Philipp e28be36086
Merge pull request #12465 from annando/issue-12185
Issue 12185: Problems adding contacts
2022-12-19 01:32:02 +01:00
Tobias Diekershoff b315f2135f forgot the attached images 2022-12-18 19:45:06 +01:00
Tobias Diekershoff 0baff45243
Merge pull request #12467 from MarekBenjamin/patch-1
Update CREDITS.txt
2022-12-18 19:41:04 +01:00
MarekBenjamin 15f6031113
Update CREDITS.txt
Marek Bachmann (real name) and MarrekBejamin (git name) is the same person. No need for double credit 👼
2022-12-18 19:17:09 +01:00
Michael e057b39f68 Issue 12185: Problems adding contacts 2022-12-18 15:43:35 +00:00
Hypolite Petovan 738e63f73e
Merge pull request #12464 from tobiasd/20221218-de
DE translation updates
2022-12-18 10:27:28 -05:00
Tobias Diekershoff 43fd9eb77c DE translation updates 2022-12-18 16:12:50 +01:00
Tobias Diekershoff ddc0c2e240 add HU addon translations 2022-12-18 16:11:54 +01:00
Tobias Diekershoff 00f4845fe6 Some more issues fixed, some formatting 2022-12-18 15:58:43 +01:00
Michael Vogel 8ac3f58a1c
Merge pull request #12461 from tobiasd/20221218-credits
20221218 credits
2022-12-18 12:04:11 +01:00
Tobias Diekershoff a96a8de651 removed double entry 2022-12-18 10:06:18 +01:00
Philipp 40777d08c1
Merge pull request #12459 from MrPetovan/bug/12454-link-preview-translation
Add missing t() call in Settings\Display module
2022-12-18 09:26:04 +01:00
Tobias Diekershoff 18f69f6f73 some more corrections 2022-12-18 09:20:12 +01:00
Tobias Diekershoff fb2d193a6c some more corrections 2022-12-18 09:19:11 +01:00
Tobias Diekershoff aa94a131b8 fix 2022-12-18 09:17:09 +01:00
Tobias Diekershoff e1b45c7fba fix 2022-12-18 09:16:46 +01:00
Tobias Diekershoff 7beee99f31 regen CREDITS.txt 2022-12-18 09:15:31 +01:00
Tobias Diekershoff b3504dfdee
Merge pull request #12460 from annando/photo-api
API: Fix interoperability between Friendica and Mastodon part
2022-12-18 08:15:49 +01:00
Michael 1899c53516 API: Fix interoperability between Friendica and Mastodon part 2022-12-18 06:30:32 +00:00
Michael Vogel 49078069f9
Merge pull request #12442 from MrPetovan/bug/warnings
Use account-user-view entry to instantiate Api\Mastodon\FollowRequestobjects
2022-12-18 07:06:59 +01:00
Hypolite Petovan f7a8c109e9 Updated main translation file after adding a string 2022-12-18 01:04:04 -05:00
Hypolite Petovan 52e3126cba Add missing t() call in Settings\Display module 2022-12-18 01:04:04 -05:00
Hypolite Petovan 9718484f9e Remove DI dependency in Settings\Display module 2022-12-18 01:04:04 -05:00
Hypolite Petovan c7e53cb9b4 Use account-user-view entry to instantiate Api\Mastodon\FollowRequest objects
- Address https://github.com/friendica/friendica/issues/11993#issuecomment-1354395861
2022-12-18 01:03:37 -05:00
Michael Vogel af4164b86a
Merge pull request #12458 from MrPetovan/bug/12456-tos-rules
Trim terms of service rules before turning them to an array
2022-12-18 06:23:55 +01:00
Hypolite Petovan 43aa9cddc5 Trim terms of service rules before turning them to an array 2022-12-17 21:13:52 -05:00
Philipp 9a8f6f2150
Merge pull request #12457 from annando/image-grid-shared
Fix image grid in shared Friendica posts
2022-12-17 23:30:10 +01:00
Michael ed520a3f39 Fix image grid in shared Friendica posts 2022-12-17 22:07:14 +00:00
Philipp d25fc9de9b
Merge pull request #12359 from matthiasmoritz/calendar_default_view
Calendar default view
2022-12-17 19:05:57 +01:00
Hypolite Petovan 3756f933a6 Update main translation file after adding strings 2022-12-17 12:20:49 -05:00
Hypolite Petovan cdf180c58d Add new calendar.default_view pconfig key 2022-12-17 12:20:43 -05:00
Hypolite Petovan 83e34ef8e7 Move first_day_of_week pconfig key to calendar category 2022-12-17 12:20:14 -05:00
Matthias Moritz 5817709562 Move vier version of calendat/calendar_head template to base
- With the support for the remaining themes dropped, the base template wasn't used anymore
2022-12-17 12:20:13 -05:00
Hypolite Petovan 60dd9bed5e
Merge pull request #12455 from tobiasd/20221217-security
renewed the expiration date for the security.txt file
2022-12-17 10:52:46 -05:00
Tobias Diekershoff 704cc34981 renewed the expiration date for the security.txt file 2022-12-17 16:46:46 +01:00
Tobias Diekershoff b84ad5578f CHANGELOG updates for 2022.12 2022-12-17 16:40:13 +01:00
Philipp 057eefcbe2
Merge pull request #12451 from tobiasd/20221217-ru
RU translation update THX SpcCw
2022-12-17 15:37:55 +01:00
Tobias Diekershoff 847396ac38 RU translation update THX SpcCw 2022-12-17 15:24:59 +01:00
Philipp e73ef3e925
Merge pull request #12449 from tobiasd/20221217-lng
DE, FR, HU and PL translation updates
2022-12-17 08:56:20 +01:00
Tobias Diekershoff bde1d5b02e DE translation updates 2022-12-17 08:51:23 +01:00
Tobias Diekershoff ce14c81e1f HU translation updates THX Balázs Úr 2022-12-17 08:49:27 +01:00
Tobias Diekershoff 301fd13ced DE translation updates 2022-12-17 08:48:10 +01:00
Tobias Diekershoff d77fa441db FR translation updates THX kalon33 2022-12-17 08:41:38 +01:00
Tobias Diekershoff 912493f673 PL translation updates THX strebski 2022-12-17 08:40:27 +01:00
Hypolite Petovan c69705d34e
Merge pull request #12446 from annando/preview-image
Fix: Images must not be removed on preview
2022-12-17 01:25:13 -05:00
Michael 2e6ab0e312 Fix: Images must not be removed on preview 2022-12-17 05:48:09 +00:00
Philipp 44b2b97e80
Merge pull request #12445 from MrPetovan/bug/12382-tag-attachment
Exclude [attachment] from tag search
2022-12-17 02:23:18 +01:00
Philipp 22c1cd3cd1
Merge pull request #12440 from MrPetovan/bug/fatal-errors
Catch exceptions in Model\Gserver::cleanURL
2022-12-17 02:17:00 +01:00
Philipp f49c85e9b8
Merge pull request #12444 from MrPetovan/bug/11911-frio-modal-height
[frio] Allow space for the upload button in the fbrowser modal
2022-12-17 02:16:21 +01:00
Hypolite Petovan d609d70bd2 Exclude [attachment] from tag search 2022-12-16 20:06:37 -05:00
Hypolite Petovan 30973647a6 [frio] Allow space for the upload button in the fbrowser modal 2022-12-16 19:16:25 -05:00
Hypolite Petovan c60464a4be Catch exceptions in Model\Gserver::cleanURL
- Address https://github.com/friendica/friendica/issues/11992#issuecomment-1354393419
2022-12-16 17:39:40 -05:00
Hypolite Petovan f37750d679
Merge pull request #12443 from nupplaphil/bug/dba_definition
Include DBA/View definitions from Hooks again
2022-12-16 17:05:16 -05:00
Philipp b0cc0f0d7b
Add load(true) for ViewDefinitions as well 2022-12-16 22:05:32 +01:00
Philipp 1c789d487b
Include DBA definitions from Hooks again 2022-12-16 21:59:32 +01:00
Philipp 2ae3ae0b8a
Merge pull request #12436 from MrPetovan/bug/notices
Address a few notices
2022-12-16 08:52:04 +01:00
Philipp 63c661c783
Merge pull request #12435 from MrPetovan/bug/12344-calendar-profile-load
Apply calendar owner custom theme
2022-12-16 08:51:17 +01:00
Hypolite Petovan 2497817c2a Ward against empty siteinfo in Text\BBCode::embedURL
- Address https://github.com/friendica/friendica/issues/11994#issuecomment-1349593196
2022-12-15 23:33:02 -05:00
Hypolite Petovan 060936d31e Ward against empty $contact array in Module\Photo::getPhotoById
- Address https://github.com/friendica/friendica/issues/11994#issuecomment-1349591039
2022-12-15 23:31:32 -05:00
Hypolite Petovan 0c5158b85d Check that $probed key exists before comparison in OStatus\Subscribe
- Address https://github.com/friendica/friendica/issues/11994#issuecomment-1349590054
2022-12-15 23:29:06 -05:00
Hypolite Petovan 777afb45fc Apply calendar owner custom theme 2022-12-15 23:14:45 -05:00
Hypolite Petovan 590f92ba42
Merge pull request #12434 from MarekBenjamin/issue_make_balancing_optional
Removed balancing of image grid
2022-12-15 15:49:20 -05:00
Marek Bachmann 91cc6d5a94 Add unbalanced imagegrid generation 2022-12-15 21:29:14 +01:00
Philipp a5931f7ffd
Merge pull request #12432 from MrPetovan/bug/12431-frio-forum-network
[frio] Re-hide the forum contact row in network page
2022-12-15 18:38:06 +01:00
Hypolite Petovan d096dbe276 [frio] Re-hide the forum contact row in network page 2022-12-15 11:10:28 -05:00
Tobias Diekershoff f84e76d893
Merge pull request #12422 from MrPetovan/bug/5095-group-tooltip
[frio] Reduce group member add/remove button virtual height
2022-12-15 06:32:08 +01:00
Tobias Diekershoff d33dc131ff
Merge pull request #12425 from MrPetovan/task/11774-frio-remove-banner-setting
[frio] Remove header banner setting form field
2022-12-15 06:25:55 +01:00
Tobias Diekershoff f8b70ef9f0
Merge pull request #12424 from MrPetovan/task/10100-contact-relationship-prominence
Make relationship filter widget more prominent in Module\Contact
2022-12-15 06:24:32 +01:00
Tobias Diekershoff 0128bbdb08
Merge pull request #12426 from MrPetovan/task/12237-ACL-meta-groups-doc
Add documentation about the ACL autocomplete fields
2022-12-15 06:22:14 +01:00
Tobias Diekershoff 7d20798e97
Merge pull request #12427 from MrPetovan/bug/12399-suppress-notif-forum
Suppress notifications for forum users in Module\Notifications\Ping
2022-12-15 06:20:21 +01:00
Tobias Diekershoff 9e61720875
Merge pull request #12428 from MrPetovan/bug/12406-frio-contact-list-frame
[frio] Add wrapper to generic contact list
2022-12-15 06:16:13 +01:00
Tobias Diekershoff f114ad1883
Merge pull request #12429 from MrPetovan/bug/contactblock-icon
Make contact block list style more specific
2022-12-15 06:14:55 +01:00
Tobias Diekershoff f95a33da70
Merge pull request #12430 from MrPetovan/task/12421-frio-screenshot
[frio] Update description, version, maintainer and screenshot
2022-12-15 06:14:00 +01:00
Tobias Diekershoff eb856275f2
Merge pull request #12416 from MrPetovan/task/remove-clear-body-attach
Remove obsolete `<div class="clear"></div>` from body-attach div
2022-12-15 06:05:22 +01:00
Tobias Diekershoff 3d3ccdad77
Merge pull request #12423 from MrPetovan/bug/9286-admin-features-lock
Show lock status even when feature is disabled in Admin/Features
2022-12-15 06:04:08 +01:00
Hypolite Petovan 8a6da56738 Remove obsolete <div class="clear"></div> from body-attach div 2022-12-14 22:35:12 -05:00
Hypolite Petovan 3546f5b189 [frio] Update description, version, maintainer and screenshot 2022-12-14 22:25:53 -05:00
Hypolite Petovan 38f5e28e33 Make contact block list style more specific
- The wide selector had side effects across the site
2022-12-14 22:11:19 -05:00
Hypolite Petovan 0d2c302beb [frio] Add wrapper to generic contact list 2022-12-14 22:05:58 -05:00
Hypolite Petovan 2d624e900d Suppress notifications for forum users in Module\Notifications\Ping
- The bell icon is already hidden for them but the notification number showed in the page title
2022-12-14 22:01:14 -05:00
Hypolite Petovan 07520719f7 Add documentation about the ACL autocomplete fields 2022-12-14 21:57:14 -05:00
Hypolite Petovan 244b65e5fc [frio] Remove header banner setting form field
- This setting isn't used in the frio theme at all
2022-12-14 21:45:27 -05:00
Hypolite Petovan c54bca43a5 Make relationship filter widget more prominent in Module\Contact 2022-12-14 21:35:34 -05:00
Hypolite Petovan e0cdb8a940 Show lock status even when feature is disabled in Admin/Features 2022-12-14 21:30:47 -05:00
Hypolite Petovan 710a805623 [frio] Reduce group member add/remove button virtual height
- This bring down the tooltip closer to the icon
2022-12-14 21:17:01 -05:00
Hypolite Petovan c76795f0f8
Merge pull request #12418 from MarekBenjamin/upload_image_size_desc_fix
Show PHP's upload_max_filesize value with binary prefix on admin site
2022-12-14 17:26:57 -05:00
Marek Bachmann 3576855e71 Small fix to show PHP.ini upload_max_filesize value also with binary prefix for consistency 2022-12-14 23:19:08 +01:00
Hypolite Petovan 0e543b2d4a
Merge pull request #12392 from annando/api-relations
API: Use "contact" for own relations
2022-12-14 08:06:14 -05:00
Hypolite Petovan d26b0ed5a2
Merge pull request #12407 from HankG/friendica-api-photo-endpoint-updates
Friendica api photo endpoint updates
2022-12-13 17:14:48 -05:00
Hank G 7072a71788
Update src/Module/Api/Friendica/Photoalbum/Index.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2022-12-13 16:52:28 -05:00
Hank G 2338a268d3
Update src/Module/Api/Friendica/Photoalbum/Show.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2022-12-13 16:52:21 -05:00
Hank G 6af4bfae21
Update src/Module/Api/Friendica/Photoalbum/Show.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2022-12-13 16:46:16 -05:00
Hank G ae8f1a1c5b
Update src/Module/Api/Friendica/Photoalbum/Show.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2022-12-13 16:45:56 -05:00
Hank G 7bb60776c6
Update src/Module/Api/Friendica/Photoalbum/Show.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2022-12-13 16:45:49 -05:00
Hank G d74345782a
Update src/Module/Api/Friendica/Photoalbum/Index.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2022-12-13 16:45:34 -05:00
Hank Grabowski 5288ed46d4 Remove extraneous comment and fix whitespace between lines for style 2022-12-13 16:04:03 -05:00
Hank Grabowski 0b2c013db4 Fix space missing after if style error in src/Module/Api/Friendica/Photoalbum/Show.php 2022-12-13 15:59:45 -05:00
Hank Grabowski 8576610c54 Fix copyright header issues... 2022-12-13 15:58:03 -05:00
Hank Grabowski 991c5fa6de Add latest_first parameter to photo gallery listing Friendica API endpoint 2022-12-13 15:41:24 -05:00
Hank Grabowski 4fc01c93ce Add photo album show endpoint that lists photos in an album 2022-12-13 14:16:08 -05:00
Hank Grabowski 5b52533749 Fix Friendica API Photo Album list documentation to reflect endpoint 2022-12-13 14:14:58 -05:00
Hank Grabowski 951b221e21 Fix Friendica API Photo Album list documentation to reflect endpoint 2022-12-13 13:31:10 -05:00
Hank Grabowski e1823c7138 Add Photo Album index endpoint to Friendica API 2022-12-13 13:28:34 -05:00
Hank Grabowski 800f94495b Add Photo album cache flushes to Friendica Photo endpoints 2022-12-13 13:27:23 -05:00
Hank Grabowski 8f56aa316b Allow album to be empty string thus defaulting to i10n "Wall Photos" like in UI 2022-12-13 12:48:50 -05:00
Michael Vogel 846709eba8
Merge pull request #12400 from MrPetovan/task/image-grid
Normalize padding in image grid
2022-12-13 16:21:06 +01:00
Hypolite Petovan d9361f2b81 Improve code standards in Model\Item 2022-12-13 09:33:01 -05:00
Hypolite Petovan 2fa9d49632 Normalize padding in image grid
- Remove outside padding, vertical and horizontal
- Remove artificial padding with <br> in content/image.tpl
2022-12-12 21:56:23 -05:00
Hypolite Petovan ed805d1af2
Merge pull request #12398 from MarekBenjamin/image-grid-fixes
Fixed image grid when exactly ONE portrait and ONE landscape is attached
2022-12-12 19:15:00 -05:00
Marek Bachmann 290b14a000 Fixed image grid when exactly ONE portrait and ONE landscape is attached 2022-12-13 00:39:39 +01:00
Hypolite Petovan c38dcc2f41
Merge pull request #12334 from MarekBenjamin/new_image_presentation
Show Images in posts in an image grid
2022-12-12 17:24:40 -05:00
Marek Bachmann 8690b311a8 Moved image_grid.css content to global.css and use unique class names for imagegrid style classes, removed id for div 2022-12-12 22:58:50 +01:00
MarekBenjamin 86b9cef273
Update image_grid.css
Removed fall back to one column
2022-12-12 21:56:42 +01:00
MarekBenjamin bc70bc23a4
Update image_grid.css 2022-12-12 21:45:57 +01:00
MarekBenjamin c554af9c30
Merge branch 'friendica:2022.12-rc' into new_image_presentation 2022-12-12 19:07:09 +01:00
Hypolite Petovan 94801986b6
Merge pull request #12397 from HankG/fix-photo-get-without-scale-arg
Fix photo get without scale arg
2022-12-12 13:01:03 -05:00
Hypolite Petovan 27c738f90f
Merge pull request #12395 from HankG/fix-photo-get-without-scale-arg
Fix Friendica Photo GET API endpoint to work without explicit scale term
2022-12-12 13:00:19 -05:00
Hank Grabowski a8428264f0 Use is_int not intval to return Photo->createFromId back to original version 2022-12-12 12:38:45 -05:00
Hank Grabowski 4e5794c99d Update Friendica Photo API endpoint fix to pass null for scale when not applied 2022-12-12 12:37:01 -05:00
MarekBenjamin d2b23d57e4
Merge branch 'friendica:2022.12-rc' into new_image_presentation 2022-12-12 17:59:42 +01:00
Hank Grabowski 46607598f3 Fix Friendica Photo GET API endpoint to work without explicit scale term 2022-12-12 11:27:59 -05:00
Hypolite Petovan d60c405390
Merge pull request #12393 from annando/api-permissions
API: Allow permissions for status posts
2022-12-12 10:20:28 -05:00
Michael Vogel 0209c39e0a
Update src/Module/Api/Twitter/Statuses/Update.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2022-12-12 15:51:14 +01:00
Hypolite Petovan c8d4b73871
Merge pull request #12391 from annando/issue-12338
Issue 12338: Use redirect for "about" and "about/more"
2022-12-12 09:39:12 -05:00
Michael 7dfe517c77 Redirect in a different way 2022-12-12 11:24:20 +00:00
Michael 5312b23f03 Don't send the header 2022-12-12 03:13:24 +00:00
Michael a2f386cd2f Transmit header before creating user list 2022-12-12 02:43:32 +00:00
Michael cfd09663e7 Don't display pending requests 2022-12-12 02:33:57 +00:00
Michael 89efa73195 Fix tests 2022-12-11 22:56:56 +00:00
Michael d05910a6e5 API: Allow permissions for status posts 2022-12-11 22:48:43 +00:00
Michael ff5da9bc71 API: Use "contact" for own relations 2022-12-11 22:26:30 +00:00
MarekBenjamin e4702ed464
Merge branch 'friendica:2022.12-rc' into new_image_presentation 2022-12-11 22:25:47 +01:00
Hypolite Petovan baf2f7565a
Merge pull request #12390 from annando/fixes
Only reshare the author's posts on `MIRROR_NATIVE_RESHARE`
2022-12-11 15:05:47 -05:00
Hypolite Petovan 0d95535137
Merge pull request #12389 from annando/fatal
Handle some fatal errors
2022-12-11 15:04:54 -05:00
Michael afd1dba774 Issue 12338: Use redirect for "about" and "about/more" 2022-12-11 19:50:10 +00:00
Michael 2f3f41ed9c Merge remote-tracking branch 'origin/2022.12-rc' into fixes 2022-12-11 19:00:59 +00:00
Marek Bachmann eb1cfd09a9 added more sophisticated column balancing logic for portraits and landscapes 2022-12-11 18:25:19 +01:00
MarekBenjamin a5aa44f189
Merge branch 'friendica:2022.12-rc' into new_image_presentation 2022-12-11 18:24:27 +01:00
Philipp e72d17c3af
Merge pull request #12388 from MrPetovan/task/psr-20
Add Clock classes to deal with "now" times in tests
2022-12-11 18:21:20 +01:00
Michael 5d3248d57b Handle some fatal errors 2022-12-11 16:48:36 +00:00
Marek Bachmann 58cc270da8 fixed bug in portrait iteration
shortened var names

added some comments
2022-12-11 17:09:28 +01:00
MarekBenjamin 23f31883f5
Merge branch 'friendica:2022.12-rc' into new_image_presentation 2022-12-11 16:56:33 +01:00
Hypolite Petovan a79be5e697 Add Clock classes to deal with "now" times in tests
- [Composer] Add psr/clock dependency
2022-12-11 10:12:23 -05:00
Hypolite Petovan 35ce394948
Merge pull request #12385 from annando/more-blurhash
Add more BlurHash to avoid not being able to display some picture
2022-12-11 09:24:49 -05:00
Michael Vogel 884a265c5a Some small fixes 2022-12-11 11:21:02 +01:00
Michael 3ce4a1fee4 Avoid error when image couldn't be fetched 2022-12-11 10:12:20 +00:00
Michael bf7df13855 Add more BlurHash to avoid not being able to display some picture 2022-12-11 09:56:30 +00:00
Hypolite Petovan 183e9dc7b2
Merge pull request #12383 from annando/issue-12367
Issue 12367: Calculate relative date on "date" level instead of "datetime"
2022-12-10 23:55:05 -05:00
Hypolite Petovan 84fc8973e7
Merge pull request #12384 from annando/issue-12285
Issue 12285: Show sharing notification only once
2022-12-10 23:54:39 -05:00
Michael fc1ef084f4 Simplify variable name 2022-12-11 04:16:58 +00:00
Michael 5e176b52a5 Issue 12285: Show sharing notification only once 2022-12-11 04:11:29 +00:00
Michael 62376d2e62 Only calculate the last login on a "date" level 2022-12-11 03:26:45 +00:00
Michael a65aa75234 Issue 12367: Calculate relative date on "date" level instead of "datetime" 2022-12-11 03:24:36 +00:00
MarekBenjamin 1454f3bc2a
Merge branch 'friendica:2022.12-rc' into new_image_presentation 2022-12-10 23:59:51 +01:00
Marek Bachmann fe2c4f7c4b Restored $s = $hook_data['html']; call which was removed on error 2022-12-10 23:47:37 +01:00
Marek Bachmann 412ba461e7 Removed unused imports 2022-12-10 23:45:42 +01:00
Marek Bachmann 236a4c819b Removed not needed image_grid_column.tpl 2022-12-10 23:44:23 +01:00
Marek Bachmann 2eb170bdbd Added some logic for image grid column balancing 2022-12-10 23:37:03 +01:00
Hypolite Petovan 04945f9c98
Merge pull request #12381 from annando/issue-11875
Issue 11875: Fetch post on activity
2022-12-10 17:20:38 -05:00
Hypolite Petovan 0a296c3f02
Merge pull request #12380 from annando/parts
Fix "part" calculation for split posts
2022-12-10 17:20:06 -05:00
Marek Bachmann cc048bca38 remove old code 2022-12-10 22:58:43 +01:00
Marek Bachmann d786f225ee Added image grid generation to addVisualAttachments 2022-12-10 22:54:50 +01:00
Michael 1a1e452fae Issue 11875: Fetch post on activity 2022-12-10 21:48:00 +00:00
Michael 539ac4f2b8 Fix "part" calculation for splitted posts 2022-12-10 21:23:21 +00:00
MarekBenjamin c7811576cc
Merge branch 'friendica:2022.12-rc' into new_image_presentation 2022-12-10 22:17:26 +01:00
Hypolite Petovan 106dac5508
Merge pull request #12379 from annando/id-for-image
ID added for list of images in a post
2022-12-10 14:46:19 -05:00
Michael 870fd1a52b ID added for list of images in a post 2022-12-10 19:08:56 +00:00
Michael Vogel 46660c9462
Merge pull request #12364 from MrPetovan/bug/warnings
Address several warning messages
2022-12-10 18:10:24 +01:00
Michael Vogel 2722ef82cf
Merge pull request #12360 from MrPetovan/bug/deprecated
Address several Deprecated messages
2022-12-10 18:08:17 +01:00
Hypolite Petovan 2362e28c40
Merge pull request #12378 from annando/localprobe
Diaspora added to localprobe
2022-12-10 11:47:45 -05:00
Hypolite Petovan 71a7f2d503 Remove parameter-less call of OStatus\Salmon module in DFRN\Notify
- Address https://github.com/friendica/friendica/issues/11993#issuecomment-1342615279
2022-12-10 11:45:53 -05:00
Hypolite Petovan a71fb8d7f3 Check for existence of a public contact id before deleting related notifications in Model\Contact
- Address part of https://github.com/friendica/friendica/issues/11993#issuecomment-1338134893
2022-12-10 11:42:04 -05:00
Hypolite Petovan e78471c847 Throw exception when a few keys are missing from probe data array in Repository\DiasporaContact
- Address part of https://github.com/friendica/friendica/issues/11993#issuecomment-1338134893
2022-12-10 11:42:04 -05:00
Hypolite Petovan d87585477c Delete introductions when referenced contact id doesn't exist anymore in Ping module
- Address part of https://github.com/friendica/friendica/issues/11993#issuecomment-1338134893
2022-12-10 11:42:03 -05:00
Hypolite Petovan 7aa5407bbd Remove superfluous strlen call in Module\Tos
- Address https://github.com/friendica/friendica/issues/12011#issuecomment-1342617099
2022-12-10 11:38:42 -05:00
Hypolite Petovan 607d26e906 Ward against empty JsonLD::fetchElement result in ActivityPub\Receiver::processTags
- Address https://github.com/friendica/friendica/issues/12011#issuecomment-1336478368
2022-12-10 11:38:42 -05:00
Hypolite Petovan b1860d4121 Check for last-activity value before feeding it to strtotime in Module\NoScrape
- Address https://github.com/friendica/friendica/issues/12011#issuecomment-1340019523
2022-12-10 11:38:41 -05:00
Hypolite Petovan c70d657885 Ward against invalid name from receiver in ActivityPub::storeReceivers
- Address part of https://github.com/friendica/friendica/issues/12011#issuecomment-1338133783
2022-12-10 11:38:41 -05:00
Hypolite Petovan f3dc69c226 Ensure strpos is provided a string in App::runFrontend
- Address part of https://github.com/friendica/friendica/issues/12011#issuecomment-1338133783
2022-12-10 11:38:41 -05:00
Hypolite Petovan fc246424a9 Provide default host value to hash() in Model\Item::guidFromUri
- Address part of https://github.com/friendica/friendica/issues/12011#issuecomment-1338133783
2022-12-10 11:38:37 -05:00
Hypolite Petovan 0af2be14ee Check for parts key existence before performing strpos in Network\Probe
- Address part of https://github.com/friendica/friendica/issues/12011#issuecomment-1338133783
2022-12-10 11:38:02 -05:00
Hypolite Petovan 1622ce0a99 Coalesce null activity name in ActivityPub\Processor
- Address part of https://github.com/friendica/friendica/issues/12011#issuecomment-1338133783
2022-12-10 11:38:02 -05:00
Hypolite Petovan e7574356d8 Replace parse_url with UriInterface instantiation in Model\APContact
- Address part of https://github.com/friendica/friendica/issues/12011#issuecomment-1338133783
2022-12-10 11:38:02 -05:00
Michael 2761972742 Simplify lastname/firstname 2022-12-10 16:02:38 +00:00
Michael ab1ff53b18 Diaspora added to localprobe 2022-12-10 15:59:11 +00:00
Michael Vogel b29e520a25
Merge pull request #12377 from MrPetovan/bug/12376-diasporacontact-subscribe
Change DiasporaContact->subscribe type to string
2022-12-10 15:47:49 +01:00
Hypolite Petovan 19d11c08d4 Change DiasporaContact->subscribe type to string
- This avoids the expected "{uri}" placeholder to be URL-encoded in the string representation
2022-12-10 09:23:29 -05:00
Hypolite Petovan 5fd5819321
Merge pull request #12375 from annando/issue-12373
Issue 12373: Fix communication to Diaspora
2022-12-10 08:45:53 -05:00
Michael c6ca844f33 "networks" has to contain all probing fields 2022-12-10 12:35:05 +00:00
Michael 6496ed4c19 Remove testcode, improve rearrange 2022-12-10 12:14:23 +00:00
Michael 019bb56668 Issue 12373: Fix communication to Diaspora 2022-12-10 12:08:55 +00:00
Philipp 04d997548c
Merge pull request #12374 from MrPetovan/bug/admin-logs-view
Fix wrong condition when redirecting to filtered log view in admin/logs
2022-12-09 22:36:43 +01:00
Hypolite Petovan 85db716894 Fix wrong condition when redirecting to filtered log view in admin/logs
- Address https://friendica.xyz/display/adf174d5-1563-937d-3cd7-2df680918252
2022-12-09 16:24:55 -05:00
MarekBenjamin e86a2e047d
Merge branch 'friendica:2022.12-rc' into new_image_presentation 2022-12-08 23:16:28 +01:00
Hypolite Petovan 74be29e822
Merge pull request #12372 from loma-one/patch-3
Change icon size button comments
2022-12-08 16:57:58 -05:00
Hypolite Petovan 3e431bda1e
Merge pull request #12371 from loma-one/patch-1
Change oversized buttons
2022-12-08 16:57:31 -05:00
loma-one 69e2b45f39
Titel H2 2022-12-08 22:14:47 +01:00
loma-one 5d1aeea41e
Änderung Icon-Größe Schaltfläche Kommentare
Using the glocal css "template-icon" to show the correct size of the buttons
2022-12-08 21:47:52 +01:00
Hypolite Petovan a521c1adaf
Merge pull request #12370 from loma-one/patch-2
css specification for oversized button in composer
2022-12-08 15:00:36 -05:00
loma-one c285e4160b
css specification for oversized button in composer
In order to specify the buttons in the composer in the correct size again, an additional specification has been added. This can also be used for other oversized buttons.
2022-12-08 20:42:28 +01:00
MarekBenjamin 75d857c595
Merge branch 'friendica:2022.12-rc' into new_image_presentation 2022-12-08 20:40:58 +01:00
Marek Bachmann d270a98e86 Image grid logic 2022-12-08 20:39:51 +01:00
loma-one c95882125d
Change oversized buttons
Additional css specification in global.css to resize the button in the composer. ".template-icon"
Use ".template-icon" in additional buttons that are currently displayed oversized.
2022-12-08 20:38:44 +01:00
Hypolite Petovan d84dad20ca
Merge pull request #12368 from tobiasd/20221208-de2
DE translation update
2022-12-08 12:17:30 -05:00
Tobias Diekershoff 9cd72cfec6 DE translation update 2022-12-08 18:11:16 +01:00
Hypolite Petovan 60a6503f6f
Merge pull request #12366 from tobiasd/20221208-fr
FR translation update THX kalon33
2022-12-08 12:00:14 -05:00
Tobias Diekershoff 350f542220 FR translation update THX kalon33 2022-12-08 17:52:34 +01:00
Philipp fc675a1736
Merge pull request #12365 from MrPetovan/bug/fatal-errors
Address a couple of fatal error messages
2022-12-08 17:14:51 +01:00
Hypolite Petovan d9e69fc543 Fix OPTIONS responses 2022-12-08 10:10:40 -05:00
Hypolite Petovan 15eba181a0 Initialize parameter with $server for all Router cases including Maintenance mode
- Address https://github.com/friendica/friendica/issues/11992#issuecomment-1339614287
- Address https://github.com/friendica/friendica/issues/11992#issuecomment-1339909728
2022-12-08 10:10:23 -05:00
Hypolite Petovan 6fddcb2c04
Merge pull request #12363 from annando/bulk-images
Add images in a loop (preparation for a gallery)
2022-12-08 08:38:52 -05:00
Michael 741469a5c5 Add images in a loop (preparation for a galery) 2022-12-08 07:16:25 +00:00
Michael Vogel 7fcc813028
Merge pull request #12362 from tobiasd/20221208-de
DE translation update
2022-12-08 08:03:54 +01:00
Tobias Diekershoff 3fcf35a5bc
Merge pull request #12361 from annando/issue-12345
Issue 12345: No link preview on DFRN posts
2022-12-08 06:59:04 +01:00
Tobias Diekershoff 5954af2e81 DE translation update 2022-12-08 06:55:55 +01:00
Michael 7d51fa47d5 Issue 12345: No link preview on DFRN posts 2022-12-08 05:49:25 +00:00
Hypolite Petovan 16f5dc92f8
Merge pull request #12350 from annando/link-preview
The appearance of the link preview is now configurable
2022-12-07 16:34:18 -05:00
MarekBenjamin 74ff7bae59
Merge branch 'friendica:2022.12-rc' into new_image_presentation 2022-12-07 18:52:20 +01:00
Marek Bachmann d590df9a72 set character encoding to utf-8 for parsing rendered-html 2022-12-07 18:50:16 +01:00
Hypolite Petovan 35cf093086
Merge pull request #12352 from foss-/patch-4
Doc > FAQ.md: AddTwidereX iOS, Remove deprecated and non-functional clients
2022-12-07 09:01:37 -05:00
Marek Bachmann c8b43e688f Merge remote-tracking branch 'origin/new_image_presentation' into new_image_presentation 2022-12-07 13:22:56 +01:00
Marek Bachmann 99e20d1b00 Temporary hack to remove images after last text line by DOM inspection 2022-12-07 13:22:28 +01:00
foss- 63a628460e
AddTwidereX iOS, Remove deprecated and non-functional clients
- add TwidereX to iOS
- Remove Twidere Android (currently broken and no longer under development. fun fact: its Google Play link was already going to TwidereX)
- Remove B4X Android + iOS (Google Play Link dead https://github.com/AnywhereSoftware/B4X-Pleroma, website unmaintained, no commits for over a year)
- Remove Tootle iOS, Linux (repo archived: https://github.com/bleakgrey/tootle, no development in almost 3 years)
2022-12-07 13:16:08 +01:00
Michael b9cb94c432 Updated messages.po 2022-12-07 07:12:56 +00:00
Michael 498a957009 The appearanxe of the link preview is now configurable 2022-12-07 07:02:04 +00:00
Hypolite Petovan 8d1bc02f8f
Merge pull request #12349 from annando/hidewall
Fix "Missing hidewall key" message
2022-12-06 23:57:09 -05:00
Michael e5ff71f839 Fix "Missing hidewall key" 2022-12-06 22:23:43 +00:00
Tobias Diekershoff 05f8303034
Merge pull request #12348 from annando/api-search-offset
API: Only search for direct hit without offset
2022-12-06 21:05:32 +01:00
Michael 6965614f00 API: Only search for direct hit without offset 2022-12-06 18:47:43 +00:00
Tobias Diekershoff 215c332a94
Merge pull request #12347 from annando/add-parents
Fix post completion
2022-12-06 19:21:22 +01:00
Michael 5e40b47a17 Fix post completion 2022-12-06 17:45:18 +00:00
Tobias Diekershoff 59088161e8 bump version to 2022.12-rc 2022-12-06 14:34:03 +01:00
MarekBenjamin de83be11ac
Merge branch 'friendica:develop' into new_image_presentation 2022-12-06 11:35:09 +01:00
Hypolite Petovan 9b8b1be3e7
Merge pull request #12340 from nupplaphil/bug/friendica-12339
[frio] Fix preview function when creating posts
2022-12-05 20:49:03 -05:00
Marek Bachmann 9778b60e64 cleaned up my git mess :-/ anyways, should work now 2022-12-06 01:14:15 +01:00
Marek Bachmann 2205ef0574 Merge remote-tracking branch 'origin/new_image_presentation' into new_image_presentation
# Conflicts:
#	src/Model/Item.php
2022-12-06 01:02:04 +01:00
Marek Bachmann 458f22d303 Support more than 2 images 2022-12-06 00:59:48 +01:00
Marek Bachmann 7fb0f018df First draft for using a image grid to display attached images. 2022-12-06 00:59:47 +01:00
Marek Bachmann 8145454707 Revert "Merge branch 'develop' into new_image_presentation"
This reverts commit 76f4ba7685, reversing
changes made to 733543505b.
2022-12-06 00:48:28 +01:00
Marek Bachmann 76f4ba7685 Merge branch 'develop' into new_image_presentation
# Conflicts:
#	src/Object/Image.php
2022-12-05 23:36:57 +01:00
Philipp 8543174bf1
Merge pull request #12341 from annando/fix-small-preview
The BlurHash function must not change the original image
2022-12-05 21:45:37 +01:00
Michael a260e97b6f The BlurHash function must not change the original image 2022-12-05 20:38:21 +00:00
Philipp c6e627d45c
Fix preview function when creating posts 2022-12-05 21:10:14 +01:00
Marek Bachmann 733543505b Merge branch 'develop' into new_image_presentation 2022-12-05 16:54:12 +01:00
Hypolite Petovan 38fa76d6b5
Merge pull request #12336 from annando/imagick-blurhash
Support blurhash for Imagick
2022-12-05 08:12:56 -05:00
Michael e62be24e6b Swap conditions 2022-12-05 12:53:21 +00:00
Tobias Diekershoff 71c1530303
Merge pull request #12337 from foss-/patch-3
Update FAQ client list
2022-12-05 13:04:15 +01:00
foss- c632675976
Update FAQ client list
- add Android Mastodon F-Droid
- add TheDesk to macOS, Windows
- add Tooot Android Google Play link
- add Fedi GitHub link
- remove Mastonaut (unmaintained since April 2022 https://mastodon.technology/@brunoph/108138252725934908)
- remove Friendly (unmaintained since 2018)
2022-12-05 12:59:46 +01:00
Michael b93f100c97 Merge remote-tracking branch 'upstream/develop' into imagick-blurhash 2022-12-05 07:34:16 +00:00
Michael 6deb93256a Support blurhash for Imagick 2022-12-05 06:53:19 +00:00
Philipp 73742812d1
Merge pull request #12238 from MrPetovan/task/refactor-dcontact
New table "diaspora-contact" (new paradigm) v34 FINAL
2022-12-05 07:38:05 +01:00
Hypolite Petovan 818cdf83ca [Database version 1500] Remove obsolete table fcontact 2022-12-05 00:00:50 -05:00
Hypolite Petovan ce69026964 [Database version 1499] Create new paradigm classes for Diaspora Contact
- Switch table fcontact for dcontact in views
2022-12-05 00:00:50 -05:00
Michael ace80ca1b4 Use "author_handle" for the author handle extracted from Diaspora XML messages
- We have structured data under the variable name "author"
- Remove unused $uid parameter from Diaspora::storeByGuid
- Convert $person parameter to just its URL in Diaspora::authorContactByUrl
- Flip parameters in getUriFromGuid to get rid of $onlyfound
2022-12-05 00:00:49 -05:00
Michael d5e005f90d [Database version 1498] New table "diaspora-contact" for Diaspora contacts (duh)
- Remove duplicated "author-uri-id" keys in view declarations
2022-12-05 00:00:49 -05:00
Hypolite Petovan 32a9f39768
Merge pull request #12333 from annando/issue-12327
Issue 12327: Convert avatars to static
2022-12-04 23:30:58 -05:00
Hypolite Petovan 445a0b61dd
Merge pull request #12332 from annando/issue-11915
Issue 11915: Show reshared posts for contacts
2022-12-04 23:30:02 -05:00
Michael 2be0ad7697 Remove test code 2022-12-05 03:59:47 +00:00
Michael 08d64f3c57 Fix the function description 2022-12-05 03:46:40 +00:00
Michael Vogel 28c7fda6e9
Update src/Factory/Api/Mastodon/Status.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2022-12-05 04:37:04 +01:00
Marek Bachmann fbd4b54656 Support more than 2 images 2022-12-05 04:23:34 +01:00
Marek Bachmann 6753eeab8b First draft for using a image grid to display attached images. 2022-12-05 03:27:51 +01:00
Michael 5bff6f38d7 Issue 12327: Convert avatars to static 2022-12-04 23:31:23 +00:00
Michael 4f98d2c74a Issue 11915: Show reshared posts for contacts 2022-12-04 21:57:58 +00:00
Marek Bachmann 7833da5196 Merge branch 'develop' into new_image_presentation 2022-12-04 19:06:23 +01:00
Philipp 62f982cf7e
Merge pull request #12330 from annando/issue-12275
Issue 12275: Banner upload via avatar does work now
2022-12-04 17:51:11 +01:00
Michael 5c74113bf6 Issue 12275: Banner upload via avatar does work now 2022-12-04 16:33:29 +00:00
Hypolite Petovan 552a30e1f3
Merge pull request #12329 from annando/blurhash
Use the blurhash when the remote picture doesn't load
2022-12-04 10:34:30 -05:00
Michael 1c8690a872 Fix calls for pictures without blurhash 2022-12-04 15:14:43 +00:00
Michael cfe5101b9b Use the blurhash when the remote picture doesn't load 2022-12-04 14:58:53 +00:00
Hypolite Petovan 23a8245fb0
Merge pull request #12328 from nupplaphil/feat/php81_phpunit
Woodpecker Enhancements
2022-12-04 09:46:59 -05:00
Hypolite Petovan 10154e532e
Merge pull request #12326 from nupplaphil/feat/route_about
Add /about route
2022-12-04 09:43:19 -05:00
Philipp b3ca1e2bfb
Merge pull request #12325 from annando/blurhash
API: Support Blurhash
2022-12-04 15:25:33 +01:00
Philipp 10e423237e
Force phpunit execution at the opensocial node 2022-12-04 15:06:10 +01:00
Philipp f79c810236
Try PHP8.1 again 2022-12-04 14:53:14 +01:00
Philipp 1a8722c1f6
Add /about route 2022-12-04 14:47:31 +01:00
Michael a5be5b27e3 Support Blurhash 2022-12-04 13:29:21 +00:00
Philipp 3d73c452df
Merge pull request #12313 from MrPetovan/bug/12312-calendar-JS
Escape HTML in event mapping callback
2022-12-04 12:53:00 +01:00
Hypolite Petovan 82c2e686d7 Updating main translation file after updating a few strings 2022-12-04 06:42:12 -05:00
Hypolite Petovan a0752b1161 Escape HTML in event mapping callback
- This prevents arbitrary Javascript from being executed from the calendar view
2022-12-04 06:37:37 -05:00
Hypolite Petovan 2f42606c43 Add information about BBCode availability in event fields 2022-12-04 06:37:37 -05:00
Hypolite Petovan 349436a77a Fix event start time not being properly converted to UTC
- This was triggering unexpected time comparison errors
2022-12-04 06:37:36 -05:00
Hypolite Petovan 1b71b963d7 Fix description not being populated in event form when there's a validation error 2022-12-04 06:37:36 -05:00
Philipp 04450bbbd4
Merge pull request #12324 from annando/issue-10518
Issue 10518: "last-activity" instead of "login_date"
2022-12-04 11:21:35 +01:00
Michael e5a531d3b5 Simplify "last-activity" handling 2022-12-04 07:17:26 +00:00
Michael 1d8c9276f3 Issue 10518: "last-activity" instead of "login_date" 2022-12-04 07:03:11 +00:00
Hypolite Petovan 22e2578b23
Merge pull request #12322 from annando/api-rules
API: Central way to fetch the system rules
2022-12-03 17:24:52 -05:00
Hypolite Petovan 9f03622841
Merge pull request #12321 from annando/getload
Only fetch the processes if needed
2022-12-03 17:22:35 -05:00
Michael 16b76919c0 Rules added 2022-12-03 21:15:08 +00:00
Michael b6f7d31036 API: Central way to fetch the system rules 2022-12-03 20:18:19 +00:00
Michael fa80c69d94 Only fetch the processes if needed 2022-12-03 19:44:50 +00:00
Hypolite Petovan 8cb7d4a9bd
Merge pull request #12320 from annando/issue-11553a
Issue 11553: Reliably return the user's contacts
2022-12-03 12:20:34 -05:00
Michael 36c7aea214 Debug code removed 2022-12-03 15:37:40 +00:00
Michael Vogel 3b01d12bb5
Merge pull request #12317 from MrPetovan/bug/notices
Fix last reference of replaced variable $owner_nick in Protocol\Feed::atom()
2022-12-03 16:36:13 +01:00
Hypolite Petovan 303d556ab0 Fix last reference of replaced variable $owner_nick in Protocol\Feed::atom()
- Address https://github.com/friendica/friendica/issues/11994#issuecomment-1336146405
2022-12-03 10:19:04 -05:00
Michael e4dda7d2ca Issue 11553: Reliably return the user's contacts 2022-12-03 14:19:48 +00:00
Hypolite Petovan 82972744a9
Merge pull request #12316 from VVelox/load_fix
get the load average in a portable manner
2022-12-03 05:38:55 -05:00
Zane C. Bowers-Hadley 8f82fb9a22 now with g 2022-12-03 04:34:17 -06:00
Zane C. Bowers-Hadley edaff99307 derp, minor fix 2022-12-03 04:31:04 -06:00
Michael Vogel 6c59987418
Merge pull request #12315 from MrPetovan/bug/12163-frio-group-display
Ward against empty template variable in frio:contact/entry.tpl
2022-12-03 11:28:54 +01:00
Michael Vogel 684fceada9
Merge pull request #12310 from MrPetovan/bug/deprecated
Address a couple PHP 8.1 deprecation notices
2022-12-03 11:26:10 +01:00
Zane C. Bowers-Hadley f664208157 get the load average in a portable manner 2022-12-03 04:24:49 -06:00
Hypolite Petovan e6f8b8c6e0 Ward against preg_replace_callback null return value in Strings::performWithEscapedBlocks
- Add logging to troubleshoot potential issue with regex
- Address part of https://github.com/friendica/friendica/issues/12011#issuecomment-1335124938
2022-12-03 04:20:27 -05:00
Hypolite Petovan 3b3192933d Ensure null values aren't processed in Content\Text\Markdown::toBBCode
- Address part of https://github.com/friendica/friendica/issues/12011#issuecomment-1335124938
2022-12-03 04:20:27 -05:00
Hypolite Petovan e389fe945f Ward against empty template variable in frio:contact/entry.tpl 2022-12-03 04:19:33 -05:00
Hypolite Petovan dbbbef368f
Merge pull request #12314 from annando/issue-12302
Issue 12302: Remote self is working again
2022-12-03 02:55:34 -05:00
Michael edc6851f0e Issue 12302: Remote self is working again 2022-12-03 07:15:29 +00:00
Marek Bachmann a660718099 Merge branch 'develop' into new_image_presentation 2022-12-03 01:03:36 +01:00
Hypolite Petovan a649d117e2
Merge pull request #12311 from matthiasmoritz/event-details-do-not-render-correctly-#12308
Event details do not render correctly
2022-12-02 15:43:19 -05:00
Matthias Moritz 7a39dfe23b Merge branch 'event-details-do-not-render-correctly-#12308' of https://github.com/matthiasmoritz/friendica into event-details-do-not-render-correctly-#12308 2022-12-02 21:01:20 +01:00
Matthias Moritz f27d9cb73e Update Event.php 2022-12-02 20:59:24 +01:00
Matthias Moritz 942d1e15f6
Merge branch 'friendica:develop' into event-details-do-not-render-correctly-#12308 2022-12-02 20:42:58 +01:00
Matthias Moritz 8b2a3805b6 Update Event.php
fixing double encoding issue in event view.

fixes #12308
2022-12-02 20:42:16 +01:00
Philipp eda197070d
Merge pull request #12309 from MrPetovan/bug/warnings
Ward against missing hidewall key in profile array in Model\Profile::getVCardHTML
2022-12-02 14:35:13 +01:00
Hypolite Petovan 98f4a68890 Ward against missing hidewall key in profile array in Model\Profile::getVCardHTML
- Address part of https://github.com/friendica/friendica/issues/12011#issuecomment-1335124938
- Add logging to troubleshoot unexpected case
2022-12-02 08:17:06 -05:00
Marek Bachmann 7e58052994 Merge branch 'develop' into new_image_presentation 2022-12-02 00:22:45 +01:00
Philipp e32654381b
Merge pull request #12250 from MrPetovan/task/4090-move-mod-photos
Move missing POST part of Profile\Photos\Index from mod/photos
2022-12-02 00:06:36 +01:00
Hypolite Petovan 60f18f6f56 Updated main translation file after moving strings 2022-12-01 18:01:33 -05:00
Hypolite Petovan 34f21b40f4 Move missing POST part of Profile\Photos from mod/photos 2022-12-01 17:57:29 -05:00
Philipp 5ea22197ac
Merge pull request #12227 from matthiasmoritz/public_calendar
Public calendar
2022-12-01 17:27:36 +01:00
Hypolite Petovan 8d37828c70 Update main translation file after changing strings 2022-12-01 08:06:09 -05:00
Hypolite Petovan 84b2a35e05 Add new public_calendar additional feature
- This gives anonymous access to public events
2022-12-01 08:06:07 -05:00
Hypolite Petovan ae76fa1174 Remove unused first parameter from BaseProfile::getTabsHTML
- Add expected Profile::load call to Profile\Photos module
2022-12-01 08:03:35 -05:00
Hypolite Petovan b83526ad0b Tighten profile restriction feature
- Prevent feed access to restricted profiles
- Rework display of restricted profiles with a redirect to the profile/restricted route
- Normalize permission checking with IHandleUserSession->isAuthenticated
- Remove unusable "nocache" parameter in feed module because session isn't initialized
- Reword setting name and description
2022-12-01 08:03:35 -05:00
Hypolite Petovan 0d53c69610 Remove unused theme info value "events_in_profile"
All public events (event if they are ownded by other users) are visible
2022-12-01 08:03:34 -05:00
Hypolite Petovan 2baa56d478
Merge pull request #12298 from annando/api-suggestions
Contact suggestions are now cached
2022-12-01 05:25:44 -05:00
Hypolite Petovan 1bc72f5b55
Merge pull request #12306 from annando/api-doc
API: The "reports" endpoint is partially supported
2022-12-01 05:24:07 -05:00
Michael 1d00947bcd Don't fetch sugestions for the system user / catch error on contact timeline 2022-12-01 07:07:59 +00:00
Michael 146f874c2e Avoid 'Undefined array key "last-activity"' 2022-12-01 06:12:13 +00:00
Michael 8e0196fec3 Update the last activity in OAuth 2022-12-01 06:02:51 +00:00
Michael 431eb34a1c Deactivate setting last activity 2022-12-01 05:57:29 +00:00
Michael 5201d87b3f Reenable last acttivity update 2022-12-01 05:54:42 +00:00
Michael 910a76812a Reenable worker call 2022-12-01 05:53:18 +00:00
Michael c56e4222dc Debug the failing test 2022-12-01 05:50:34 +00:00
Michael Vogel 13cc638062
Merge pull request #12305 from MrPetovan/bug/notices
Check post existence before accessing its properties in Model\Post\UserNotification
2022-12-01 06:45:50 +01:00
Michael 226e857387 API: The "reports" endpoint is partially supported 2022-12-01 05:40:32 +00:00
Hypolite Petovan 8012968506 Check post existence before accessing its properties in Model\Post\UserNotification 2022-11-30 19:30:36 -05:00
Michael ed1a879b7b Use "utcNow" 2022-11-30 22:36:58 +00:00
Michael f905220923 New field to show the day of the last activity 2022-11-30 22:34:50 +00:00
Hypolite Petovan 1b0f7e5add
Merge pull request #12304 from HankG/add-dismissed-field-to-mastodon-notifications
Add dismissed field to mastodon notifications
2022-11-30 14:55:09 -05:00
Hank G f61dbf76a7
Update src/Module/Api/Mastodon/Notifications.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2022-11-30 14:39:00 -05:00
Hank G b51b537711
Update src/Factory/Api/Mastodon/Notification.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2022-11-30 14:38:53 -05:00
Hypolite Petovan 6b2a936f16
Merge pull request #12303 from HankG/fix-mastodon-api-dismiss-endpoint
Fix broken dismiss endpoint on Mastodon notifications API
2022-11-30 14:31:40 -05:00
Hank Grabowski a2559d6241 Add 'include_all' parameter on Mastodon API endpoint
Maintains old functionality of only returning non-dismissed notifications while adding ability to get list of dismissed and non-dismissed notifications
2022-11-30 14:24:46 -05:00
Hank Grabowski a27ffda59f Add dismissed field to Mastodon API Notification types 2022-11-30 14:23:20 -05:00
Hank Grabowski 5b5c38f9ab Fix broken dismiss endpoint on Mastodon notifications API 2022-11-30 14:11:39 -05:00
Hypolite Petovan 35ca4961d2
Merge pull request #12267 from MarekBenjamin/show_image_upload_limit
Show image size limit in Frio as "usagemessage" for photo_upload
2022-11-30 12:24:51 -05:00
MarekBenjamin 8f5d6fdf72
Merge branch 'friendica:develop' into show_image_upload_limit 2022-11-30 18:19:18 +01:00
MarekBenjamin e4fd9d425f
Update src/Module/Media/Photo/Upload.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2022-11-30 18:16:55 +01:00
MarekBenjamin f9c0d5a14b
Update src/Module/Media/Photo/Upload.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2022-11-30 18:16:42 +01:00
Michael fbcc56d42d Changes after code review 2022-11-30 14:33:55 +00:00
Michael 1ced4673fe Indention 2022-11-30 13:35:57 +00:00
Hypolite Petovan 7402bc9f50
Merge pull request #12299 from annando/auto-reshare-fix
Check that an auto reshare is only done on the expected contact
2022-11-30 08:34:10 -05:00
Michael Vogel 4a94078091
Merge pull request #12300 from matthiasmoritz/bug-noLocalPosts
Fix #12262 - shared friendica posts are filtered on status page
2022-11-30 13:37:40 +01:00
Matthias Moritz 2035a7a178 Merge branch 'bug-noLocalPosts' of https://github.com/matthiasmoritz/friendica into bug-noLocalPosts 2022-11-30 13:20:50 +01:00
Matthias Moritz 71f4dd0d20 Update Status.php
Instead of removing AP, added Protocol::DFRN to the list of networks.
2022-11-30 13:19:31 +01:00
Matthias Moritz 7676aa7908
Merge branch 'friendica:develop' into bug-noLocalPosts 2022-11-30 12:18:48 +01:00
Matthias Moritz da93373e8d Fix #12262 - shared friendica posts are filtered on status page
Native shares from the same Instance (or maybe all Friendica instances) were filtered out from the users home. With this commit they now appear on the users Profile/Status
2022-11-30 12:15:58 +01:00
Michael a01cdccb05 Check that an auto reshare is only done on the expected contact 2022-11-30 09:28:27 +00:00
Michael Vogel cd3e842f76
Merge pull request #12296 from MrPetovan/bug/deprecated
Address some PHP 8.1 deprecation notices
2022-11-30 07:19:46 +01:00
Michael f31e617f5d Contact suggestions are now cached 2022-11-30 05:59:27 +00:00
Marek Bachmann 79235b6db1 Removed redundant maximagesize = INF statements 2022-11-30 05:17:48 +01:00
Marek Bachmann 00808326c2 message.po 2022-11-30 04:39:00 +01:00
Marek Bachmann a3d8a59b00 Correctly output binary prefix values since base 2 is used for conversion 2022-11-30 04:37:08 +01:00
Marek Bachmann 75b01f669a Check for inf values before try to converts bytes to binary prefix strings 2022-11-30 04:35:18 +01:00
Marek Bachmann 037e181f82 use the existing function for format byte values to KiB, MiB, GiB 2022-11-30 04:34:40 +01:00
Marek Bachmann bb9afc520b Added getBytesFromShorthand at the remaining places. 2022-11-30 04:13:10 +01:00
Hypolite Petovan 150c0e0750 Address some PHP 8.1 deprecation notices
- Replace a strstr call by strpos in Model\APContact
- Simplify conditions in Protocol\DFRN
- Address part of https://github.com/friendica/friendica/issues/12011#issuecomment-1331012289
2022-11-29 21:37:41 -05:00
Marek Bachmann 97a3587e58 Added handling as infinity if maxfilesize is set to 0 2022-11-30 02:44:48 +01:00
Marek Bachmann ca7af7a64b Merge branch 'develop' into show_image_upload_limit 2022-11-30 02:28:15 +01:00
Marek Bachmann bbd1c34292 Wrapped all occurrences of DI::config()->get('system', 'maximagesize') with Strings::getBytesFromShorthand() 2022-11-30 02:26:56 +01:00
Marek Bachmann 99e1c64b1a Added info that shorthands can be used for maxfilesize Admin Site 2022-11-30 02:16:48 +01:00
Marek Bachmann 2794100cbc Fixed meaning of "maximagesize" = 0 --> infinity 2022-11-30 02:16:04 +01:00
Marek Bachmann 49db646922 Merge remote-tracking branch 'origin/show_image_upload_limit' into show_image_upload_limit 2022-11-30 01:58:32 +01:00
Marek Bachmann 0ea219f728 Use previously already available field.5 for short hand pattern ad admin page for maximagesize 2022-11-30 01:58:22 +01:00
MarekBenjamin 72b3bbb23c
Update src/Module/Admin/Site.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2022-11-30 01:49:53 +01:00
Marek Bachmann 7d86cb1a1e Removed Trends.php which for what ever reason found its way in my branch under src/Module/Api/Mastodon but is not present in friendica:develop 2022-11-30 01:40:21 +01:00
Hypolite Petovan 6c2f42ed03
Merge pull request #12294 from annando/tag-warnings
Fix warning 'Undefined array key "name"'
2022-11-29 19:36:51 -05:00
Marek Bachmann b2f962c0ce Merge remote-tracking branch 'origin/show_image_upload_limit' into show_image_upload_limit 2022-11-30 01:26:37 +01:00
Marek Bachmann 978fe26f4c Added Strings::getBytesFromShorthand() for file size check at upload and new message.po 2022-11-30 01:26:08 +01:00
Marek Bachmann c03784eaa9 wanted to use a constant for the shorthand regex to be used in the form input templates and to check maximagesize post value. But Input field seems to require the regex without enclosing "/.../", so remove const for now 2022-11-30 01:26:08 +01:00
Marek Bachmann d44968cd10 split-off! Trends.php allow shorthands in the system.maximagesize 2022-11-30 01:26:08 +01:00
Marek Bachmann 9c383e2004 allow shorthands in the system.maximagesize 2022-11-30 01:26:08 +01:00
Marek Bachmann e73451d89b Added Strings::getBytesFromShorthand() for file size check at upload and new message.po 2022-11-30 01:22:38 +01:00
Marek Bachmann 10e0672981 wanted to use a constant for the shorthand regex to be used in the form input templates and to check maximagesize post value. But Input field seems to require the regex without enclosing "/.../", so remove const for now 2022-11-30 01:15:42 +01:00
Marek Bachmann 25ba8bfb53 allow shorthands in the system.maximagesize 2022-11-30 01:05:32 +01:00
Michael 8eda9dfe7c Fix warning 'Undefined array key "name"' 2022-11-29 23:21:27 +00:00
MarekBenjamin 3cf0b9b9fd
Merge branch 'friendica:develop' into show_image_upload_limit 2022-11-29 21:58:46 +01:00
Hypolite Petovan 24e4dfa541
Merge pull request #12293 from annando/report-status
Added status to the report
2022-11-29 15:01:57 -05:00
Michael 8eca961aeb Added status to the report 2022-11-29 19:50:12 +00:00
Michael Vogel dddf17b5c5
Merge pull request #12290 from MrPetovan/bug/frio-contact-follow
[frio] Add page wrapper to contact follow page
2022-11-29 19:59:10 +01:00
Hypolite Petovan ebe512edfd
Merge pull request #12292 from annando/api-speed
API: Speed improvements
2022-11-29 13:55:33 -05:00
Michael 8b41d62a88 API: Speed improvements 2022-11-29 18:45:30 +00:00
Hypolite Petovan c0c414ab95 [frio] Add page wrapper to contact follow page 2022-11-29 06:37:41 -05:00
Marek Bachmann 77c68d10e8 Merge branch 'develop' into show_image_upload_limit 2022-11-29 00:28:05 +01:00
Hypolite Petovan 624231c665
Merge pull request #12289 from annando/fatal
Fix fatal errors because of unknown function/variable names
2022-11-28 16:46:19 -05:00
Michael 3288efb323 Fix fatal errors because of unknown function/variable names 2022-11-28 21:22:21 +00:00
Hypolite Petovan 0ba111d99c
Merge pull request #12288 from annando/api-tags
API: Added trending links
2022-11-28 16:13:37 -05:00
Michael Vogel 7898f9cccb
Update src/Module/Api/Mastodon/Trends/Links.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2022-11-28 21:42:34 +01:00
Michael 437419bbd9 Updated database.sql 2022-11-28 20:22:08 +00:00
Michael de76e860ad API: Added trending links 2022-11-28 20:19:57 +00:00
Hypolite Petovan d6a7303991
Merge pull request #12283 from annando/api-tags
Issue 12191: API tag handling
2022-11-28 14:52:29 -05:00
Hypolite Petovan 1ec4c14501
Merge pull request #12287 from nupplaphil/bug/fix_router
Fix Legacy Router class routing
2022-11-28 14:52:01 -05:00
Michael e391328cbf Added changelog entry 2022-11-28 19:31:04 +00:00
Philipp de25d3a7ee
Fix Legacy Router class routing 2022-11-28 20:14:37 +01:00
Michael bded1c3989 Only use items that had originally been posted in the last week 2022-11-28 14:51:37 +00:00
Michael 0e160040d4 Code standards 2022-11-28 10:54:26 +00:00
MarekBenjamin bfe220c344
Merge branch 'friendica:develop' into show_image_upload_limit 2022-11-28 10:53:50 +01:00
Michael c00004f6ea API: Tredning statuses added 2022-11-28 09:30:41 +00:00
Philipp 5e7e2b65b2
Merge pull request #12284 from tobiasd/20221128-de
DE translation update THX  MarekBenjamin
2022-11-28 08:12:53 +01:00
Michael 6b36bd893b API: Trending tags are added 2022-11-28 07:08:01 +00:00
Michael 73ba7d8005 Coding styles 2022-11-28 06:52:55 +00:00
Michael a7639a2341 Updated documentation 2022-11-28 06:46:18 +00:00
Tobias Diekershoff 3092975523 DE translation update THX MarekBenjamin 2022-11-28 07:00:11 +01:00
Michael f7167acc74 Standards 2022-11-28 04:07:25 +00:00
Michael 56c4727fe1 Merge branch 'api-tags' of github.com:annando/friendica into api-tags 2022-11-28 04:04:35 +00:00
Michael 934766c364 Trim the tag 2022-11-28 04:04:27 +00:00
Michael Vogel 4e6b6fd76b
Update src/Module/Api/Mastodon/FollowedTags.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2022-11-28 05:00:08 +01:00
Michael 85f57e69fa Issue 12191: We can now follow and unfollow tags via API 2022-11-28 03:29:43 +00:00
Michael a6d060b0e4 Merge remote-tracking branch 'upstream/develop' into api-tags 2022-11-28 02:13:20 +00:00
Marek Bachmann 361908ce3b and the messages.po 2022-11-28 01:23:00 +01:00
Marek Bachmann d43e393921 and now the missing ')' at the correct position 2022-11-28 01:16:54 +01:00
Marek Bachmann 5b2ac7b944 Added missing ')' 2022-11-28 01:11:02 +01:00
MarekBenjamin 6877f8a473
Update src/Module/Admin/Site.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2022-11-28 01:06:40 +01:00
Marek Bachmann 6ebf0f860b messages.po 2022-11-27 23:53:34 +01:00
Marek Bachmann a01872a117 Merge branch 'develop' into show_image_upload_limit
# Conflicts:
#	src/Util/Strings.php
#	view/lang/C/messages.po
2022-11-27 23:52:58 +01:00
Philipp a60467ed78
Merge pull request #12281 from annando/issue-12149
Issue 12149: Show that a post was reshared
2022-11-27 22:11:17 +01:00
Michael 6d74d74a26 Issue 12149: Show that a post was reshared 2022-11-27 20:47:08 +00:00
Michael 0e2c2cd0e0 API: Support new tag endpoints 2022-11-27 19:22:41 +00:00
Philipp 4c64c6ed98
Merge pull request #12279 from MrPetovan/bug/12273-api-search-exact-results
Return only one result in case of exact match in Api\Mastodon\Search
2022-11-27 15:15:59 +01:00
Hypolite Petovan db987999b5 Return only one result in case of exact match in Api\Mastodon\Search 2022-11-27 08:28:52 -05:00
Hypolite Petovan 9fbdcb5459
Merge pull request #12277 from nupplaphil/mod/fbrowser
Move mod/fbrowser to src\Modules\Attachment|Photos\Browser
2022-11-27 07:55:55 -05:00
Philipp b56e6f4b5b
Merge pull request #12280 from MrPetovan/bug/11804-delete-notifications-item
Remove related notifications when marking an item for deletion
2022-11-27 09:01:28 +01:00
Hypolite Petovan 25e1412174 Remove related notifications when marking an item for deletion 2022-11-26 21:48:26 -05:00
Philipp 3ac3b3d2af
Perfection! 2022-11-27 01:52:49 +01:00
Philipp 272911527c
Apply suggestions from code review
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2022-11-27 01:52:14 +01:00
Philipp 4e53ba0c20
Cache the Module class 2022-11-27 01:48:52 +01:00
Philipp 29190fae73
Update messages.po 2022-11-27 01:36:31 +01:00
Philipp 012f486eb6
Adhere feedback 2022-11-27 01:34:59 +01:00
Philipp e6933a28da
Be more kindly :-) 2022-11-27 01:34:59 +01:00
Philipp 50316bbb80
Move Browser & Upload to own namespace 2022-11-27 01:34:59 +01:00
Philipp 051253a745
Move FileBrowser to own namespace & Bugfix album usage 2022-11-27 01:34:58 +01:00
Philipp 3607aa32ca
Apply suggestions from code review
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2022-11-27 01:34:58 +01:00
Philipp e60dfef0d0
Update src/App/Arguments.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2022-11-27 01:34:58 +01:00
Philipp 7c058153b5
Make PHP-CS happy 2022-11-27 01:34:58 +01:00
Philipp 801ee5c17f
Merge pull request #12276 from MrPetovan/bug/fatal-errors
Address a couple of fatal errors
2022-11-27 00:31:14 +01:00
Philipp 51b21b6709
Merge pull request #12278 from MrPetovan/bug/warnings
Address a couple of warnings
2022-11-27 00:31:01 +01:00
Marek Bachmann 719c294fb5 Added info about upload_max_filesize to admin page 2022-11-26 23:45:58 +01:00
Marek Bachmann f45b358393 using constant value for calculation of MiB output, really no need to calculate 2**20 for just dividing the bytes by one constant divisor. 2022-11-26 23:44:23 +01:00
Marek Bachmann 597f1ba9e3 using constant value for calculation of MiB output, really no need to cluclate 2**20 for just deviding the bytes by one constant divisor. 2022-11-26 23:33:51 +01:00
Hypolite Petovan a5f601718f Add a default value for $data['version'] in Model\GServer
- Address https://github.com/friendica/friendica/issues/11993#issuecomment-1327320541
2022-11-26 17:28:55 -05:00
Hypolite Petovan b6d62003a6 Have a default value for $item['contact-id'] in Model\Post\Delayed
- Address https://github.com/friendica/friendica/issues/11993#issuecomment-1327030873
2022-11-26 17:27:36 -05:00
Marek Bachmann 54289b2d08 Integrated isnumeric check to limit comparison condition 2022-11-26 23:25:11 +01:00
MarekBenjamin 765b50bde8
Update src/Util/Strings.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2022-11-26 23:14:21 +01:00
MarekBenjamin ce56cabd9f
Update src/Util/Strings.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2022-11-26 23:12:46 +01:00
Philipp d8ad95ac39
Remove mod/fbrowser 2022-11-26 22:37:03 +01:00
Philipp 3ef7ae2f74
License :) 2022-11-26 22:33:45 +01:00
Philipp d0b16b2fc1
Move mod/fbrowser to src\Modules\Attachment|Photos\Browser 2022-11-26 22:26:30 +01:00
Marek Bachmann 6c73077bbc whitespaces 2022-11-26 21:53:12 +01:00
Marek Bachmann f88722bf7f Better formatting 2022-11-26 21:47:55 +01:00
Marek Bachmann f4d49e561c fixed a forgotten debug output 2022-11-26 21:44:41 +01:00
Marek Bachmann 907deed523 introduced getBytesFromShorthand function to covert from shorthand notation to int 2022-11-26 21:43:31 +01:00
Hypolite Petovan 34418d790d Check for existence of $contact.photo_menu.edit in frio:contact/entry.tpl
- Address https://github.com/friendica/friendica/issues/11992#issuecomment-1327030221
2022-11-26 15:38:21 -05:00
Hypolite Petovan ed7b175491 Catch worker argument type errors
- This marks the invalid worker queue item as completed instead of endlessly retrying it
- Address https://github.com/friendica/friendica/issues/11992#issuecomment-1327029331
2022-11-26 15:21:46 -05:00
Hypolite Petovan a95e93c725
Merge pull request #12272 from annando/issue-12133
Issue 12133: Account data can now be updated via API
2022-11-26 08:50:18 -05:00
Michael 08b9d11d46 Updated documentation 2022-11-26 09:00:35 +00:00
Michael acfc11c436 Issue 12133: Account data can now be updated via API 2022-11-26 08:56:24 +00:00
Hypolite Petovan 1cecc51796
Merge pull request #12271 from annando/api-suggestion
Issue 12266: APISuggestions should now work
2022-11-25 21:39:40 -05:00
Michael 8879d93aad Issue 12266: APISuggestions should now work 2022-11-26 02:08:34 +00:00
Hypolite Petovan 29ee2473d7
Merge pull request #12269 from annando/api-edit
Issue 12192: API: Enable edit
2022-11-25 19:22:27 -05:00
Hypolite Petovan fe402c3850
Merge pull request #12270 from nupplaphil/bug/woodpecker_ci
Remove addon-sample.config.php from build pipeline
2022-11-25 18:58:20 -05:00
Philipp efc35ddb00
Remove addon-sample.config.php from build pipeline 2022-11-25 23:46:17 +01:00
Marek Bachmann c4c1bd2908 changed var name 2022-11-25 23:36:28 +01:00
Philipp c2c563be26
Merge pull request #12249 from MrPetovan/bug/deprecated
Address several PHP 8.1 deprecation notices
2022-11-25 23:32:32 +01:00
Philipp 4291e0def5
Merge pull request #12246 from MrPetovan/bug/notices
Ensure the existence of various keys in decoded data in Diaspora::decodeRaw
2022-11-25 23:30:56 +01:00
Marek Bachmann 74bab60989 message.po once more 2022-11-25 23:01:25 +01:00
Marek Bachmann bb67f6e219 Added check if upload_max_filesize (php.ini) or friendica option 'maxfilesize' is dominant for the actual image upload limit and print out the lower (relevant) one. 2022-11-25 22:57:06 +01:00
MarekBenjamin 9dd1cf8316
Update mod/photos.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2022-11-25 21:53:32 +01:00
Michael 92807d86a3 API: Enable edit 2022-11-25 19:35:40 +00:00
Marek Bachmann c11e2b0795 updated messages.po 2022-11-25 19:55:43 +01:00
Marek Bachmann d402fe364e Show image size limit in Frio as "usagemessage" for photo_upload 2022-11-25 19:44:09 +01:00
Hypolite Petovan 55640eec87 [Composer] Upgrade to phpseclib version 3
- Create custom Key file format for Salmon Magic key
- Remove obsolete pemToME and MEtoPem Crypto methods
- Remove unused newECKeypair Crypto method
- Switch to constant-time Base64 encode/decode in Base64Url Strings methods
2022-11-25 08:13:05 -05:00
Hypolite Petovan a3fb499735 Replace call to parse_url() with Uri instanciation in Util\Proxy
- Address part of https://github.com/friendica/friendica/issues/12011#issuecomment-1321796513
2022-11-25 08:13:05 -05:00
Hypolite Petovan 0ec7238da4 Fix null value passed to string functions deprecation notices
- Address part of https://github.com/friendica/friendica/issues/12011#issuecomment-1321796513
2022-11-25 08:13:05 -05:00
Hypolite Petovan 6b555f64da Add \ReturnTypeWillChange attribute to methods inherited from native interfaces
- Part of https://github.com/friendica/friendica/issues/12011#issuecomment-1321796513
2022-11-25 08:13:05 -05:00
Hypolite Petovan 01558d6dda
Merge pull request #12264 from annando/error
Fix "Argument #1 ($parts) must be of type array, bool given"
2022-11-25 08:05:10 -05:00
Michael fa5e7585a3 Fix "Argument #1 ($parts) must be of type array, bool given" 2022-11-25 06:08:56 +00:00
Michael Vogel 7c7cb8373c
Merge pull request #12254 from MrPetovan/bug/reorder-search
Reorder search to try redirecting to post first
2022-11-25 06:11:46 +01:00
Hypolite Petovan 9de6350154 Reorder search to try redirecting to post first
- Pleroma's post page includes the author's feed which wrongly gets picked up as a contact
- Address https://libranet.de/display/0b6b25a8-1563-7ec0-7408-70b986546395
2022-11-24 22:21:51 -05:00
Hypolite Petovan 849ce8f203
Merge pull request #12261 from MarekBenjamin/develop
Correct multiple times coppied typos in the DocBlocks of DBA.php
2022-11-24 19:18:28 -05:00
Marek Bachmann 18f0d3d31e removed double blank 2022-11-25 01:03:34 +01:00
Marek Bachmann 62ec2b5610 Merge remote-tracking branch 'origin/develop' into develop 2022-11-25 01:00:06 +01:00
Marek Bachmann f4e2c7a11d corrected typos in DocBlocks 2022-11-25 00:59:24 +01:00
Philipp 3e5a820679
Merge pull request #12259 from MarekBenjamin/nginx_template_improvements
Nginx template improvements
2022-11-24 23:39:32 +01:00
Marek Bachmann bd7582e841 Merge remote-tracking branch 'origin/nginx_template_improvements' into nginx_template_improvements 2022-11-24 23:08:07 +01:00
Marek Bachmann 7effc07fd6 typo 2022-11-24 23:07:55 +01:00
MarekBenjamin 32eb50506d
Update mods/sample-nginx-certbot.config
Damn typos, I am too used to use autocorrect, need to learn again to proofread my own texts! Thank you very much! <3

Co-authored-by: Philipp <admin+Github@philipp.info>
2022-11-24 23:07:27 +01:00
MarekBenjamin 960477cfaa
Merge branch 'friendica:develop' into nginx_template_improvements 2022-11-24 22:58:18 +01:00
Marek Bachmann 2f29031f2a content of sample-nginx-certbot.config 2022-11-24 22:57:09 +01:00
Hypolite Petovan 313f3d8515
Merge pull request #12255 from annando/invalid-unfollow
Silently quit on unfollow of invalid contacts
2022-11-24 14:46:59 -05:00
Michael 53b46855ef return "null" 2022-11-24 19:45:45 +00:00
Marek Bachmann 9f70c2a1d7 Added sample-nginx-cerbot.config to easly configure nginx to use ssl for friendica using certbot 2022-11-24 20:08:49 +01:00
Marek Bachmann 33088b3446 Replaced hostname in rewrite url for forwarding http to https by $server_name variable instead of hard coded example.com url
Updated default PHP-FPM path from 7.0 to 7.4
2022-11-24 19:21:18 +01:00
Hypolite Petovan e1b259fc4c
Merge pull request #12256 from annando/issue-12189
Issue 12189: Quote share a feed now shares the linked feed url
2022-11-24 08:01:42 -05:00
Michael c88125348f Issue 12189: Quote share a feed now shares the linked feed url 2022-11-24 06:36:08 +00:00
Michael 6a434588a9 Silently quit on unfollow of invalid contacts 2022-11-24 05:17:14 +00:00
Hypolite Petovan 32847f3398
Merge pull request #12251 from annando/remote-self
"MIRROR_FORWARDED" is no more
2022-11-23 17:18:20 -05:00
Michael 3ee594bb1f Updated database.sql 2022-11-23 22:05:36 +00:00
Michael a6ff817f47 Update added 2022-11-23 21:47:47 +00:00
Michael 0bd0046b9f Merge remote-tracking branch 'upstream/develop' into remote-self 2022-11-23 21:11:09 +00:00
Michael 8bbf3f3699 "MIRROR_FORWARDED" is no more 2022-11-23 21:10:57 +00:00
Hypolite Petovan 0d1869be7d
Merge pull request #12248 from MarekBenjamin/ImageUploadSizeSettingInformation
Added information that max image upload size on admin page does not a…
2022-11-23 13:31:14 -05:00
Marek Bachmann 32aa8bd198 Added information that max image upload size on admin page does not affect server-side upload limits 2022-11-23 18:17:33 +01:00
Michael Vogel 1f08b2c1c0
Merge pull request #12244 from MrPetovan/bug/warnings
Address various Warning messages
2022-11-23 17:50:25 +01:00
Hypolite Petovan d2ea58428d Ensure the existence of various keys in decoded data in Diaspora::decodeRaw
- Address https://github.com/friendica/friendica/issues/11994#issuecomment-1302681295
2022-11-23 11:22:54 -05:00
Hypolite Petovan 14ebc4a821 Ensure $owner is set in ActivityPub\Transmitter::sendContactReject
- Address https://github.com/friendica/friendica/issues/11993#issuecomment-1289535020
2022-11-23 11:05:36 -05:00
Hypolite Petovan 7c6d54c989 Ensure $attachment has a width and a height when it's an image in Mastodon\Attachment
- Address https://github.com/friendica/friendica/issues/11993#issuecomment-1323274513
2022-11-23 11:00:15 -05:00
Hypolite Petovan a5af1408d6 Ward against the possible case that $actor is empty in ActivityPub\Processor::createItem
- Address https://github.com/friendica/friendica/issues/11993#issuecomment-1323273452
2022-11-23 10:47:51 -05:00
Hypolite Petovan a8eabae12f Ensure $owner is set in ActivityPub\Transmitter::sendActivity
- Address https://github.com/friendica/friendica/issues/11993#issuecomment-1322704863
2022-11-23 10:40:41 -05:00
Hypolite Petovan 8e67d28997 Return early if user contact doesn't exist in Mastodon\Notification::getType
- Address https://github.com/friendica/friendica/issues/11993#issuecomment-1321804594
2022-11-23 10:35:49 -05:00
Hypolite Petovan c356c962f1
Merge pull request #12243 from annando/remote-self
No more automated posts via mod/item.php
2022-11-23 10:00:06 -05:00
Michael 7b563fd307 Tempory fix removed 2022-11-23 14:17:39 +00:00
Michael c4aaa08693 Updated messages.po 2022-11-23 14:16:13 +00:00
Michael 352b7a0ac3 "MIRROR_FORWARDED" is removed 2022-11-23 14:00:34 +00:00
Michael 25992b063a Merge remote-tracking branch 'upstream/develop' into no-api-post 2022-11-23 06:28:24 +00:00
Michael f600f68907 No more automated posts via mod/item.php 2022-11-23 06:27:40 +00:00
Hypolite Petovan 5501f703ae
Merge pull request #12240 from MarekBenjamin/patch-2
Update sample-nginx.config
2022-11-22 18:19:13 -05:00
MarekBenjamin 3d7e4cb9f4
Update sample-nginx.config
Removed  `ssl on`  in line 54 directive since it is deprecated and already activated with the `listen 443 ssl;`  directive in line 51
2022-11-22 22:56:29 +01:00
Hypolite Petovan 9fb447fefd
Merge pull request #12234 from HankG/fix-friendica-notification-seen-endpoint
Update Notify->iid to itemId for notification endpoint
2022-11-22 00:32:44 -05:00
Hank Grabowski 733509561a Update Notify->iid to itemId for notification endpoint 2022-11-21 23:40:15 -05:00
Hypolite Petovan 6bf5c344f5
Merge pull request #12231 from HankG/fix-unfavourite-endpoint
Fix unfavourite (and related) endpoints
2022-11-21 16:51:43 -05:00
Hank Grabowski 548fd3201d The two endpoints for unfavoriting/liking (and related things) was failing because it wasn't using the correct uuid in item.php in processing the action. 2022-11-21 16:49:20 -05:00
Philipp d2ba254a5a
Merge pull request #12228 from MrPetovan/task/4090-move-mod-photos
Create /profile/{nickname}/photos route
2022-11-21 00:32:15 +01:00
Philipp 41be03a7c3
Merge pull request #12225 from MrPetovan/bug/10188-addon-config
Remove config/addon-sample.config.php file in favor of per-addon configuration files
2022-11-21 00:16:26 +01:00
Hypolite Petovan d4cbfeb54c
Update doc/Config.md from review suggestion
Co-authored-by: Philipp <admin+Github@philipp.info>
2022-11-20 18:14:37 -05:00
Hypolite Petovan 187a28abda Update main translation file after moving strings 2022-11-20 17:26:08 -05:00
Hypolite Petovan 77e87da441 Create /profile/{nickname}/photos route
- Create new Profile\Photos\Index module class
- Update most references of the legacy /photos/{nickname} route
2022-11-20 17:15:07 -05:00
Hypolite Petovan 6dcc964ed8 Fix string interpolation in Model\Photo::upload 2022-11-20 17:07:08 -05:00
Hypolite Petovan fa3db8737b Remove config/addon-sample.config.php file in favor of per-addon configuration files
- Update documentation and .gitignore
2022-11-20 14:34:32 -05:00
Tobias Diekershoff 9751cadfbf
Merge pull request #12226 from MrPetovan/bug/warnings
Use guid from shared post in Protocol\Diaspora::getReshareDetails
2022-11-20 19:42:11 +01:00
Hypolite Petovan d4bb5223a4 Use guid from shared post in Protocol\Diaspora::getReshareDetails
- Address https://github.com/friendica/friendica/issues/11993#issuecomment-1321194769
2022-11-20 13:01:37 -05:00
Tobias Diekershoff eec48057dc
Merge pull request #12221 from MrPetovan/bug/warnings
Fix various PHP 8 deprecations
2022-11-20 08:21:06 +01:00
Tobias Diekershoff 70ea419fcc
Merge pull request #12218 from MrPetovan/bug/frion-search-items
[frio] Improve search list display for web and mobile
2022-11-20 08:14:42 +01:00
Tobias Diekershoff d1a85f1fa4
Merge pull request #12222 from MrPetovan/bug/12219-hovercard-stay-local
Fix support for `/contact/123456/conversations` URLs in Module\Contact\Hovercard
2022-11-20 08:10:42 +01:00
Tobias Diekershoff 99c6e65be4
Merge pull request #12223 from MrPetovan/task/12220-add-authorize_interaction-route
Add support for Mastodon /authorize_interaction route
2022-11-20 08:05:44 +01:00
Hypolite Petovan 5f074bc4e7 Add support for Mastodon /authorize_interaction route
- It is used by Fedifind to follow people who set their Webfinger address in their Twitter bio
2022-11-19 19:55:01 -05:00
Hypolite Petovan 83c04ac433 Fix support for /contact/123456/conversations URLs in Module\Contact\Hovercard 2022-11-19 19:41:45 -05:00
Hypolite Petovan 99df11e99b Fix PHP 8 inheritance deprecation warnings in App\PAge and ParsedLogIterator 2022-11-19 19:30:48 -05:00
Hypolite Petovan 6f93ee7e49 Fix various PHP 8 deprecations 2022-11-19 19:15:47 -05:00
Hypolite Petovan a147038c2e Ensure IEMail::getMessage returns a string 2022-11-19 19:15:47 -05:00
Hypolite Petovan 2a4985cd46 Fix database connection with sockets
- Reformat Database\Database.php file
- Reformat and fix spelling in static/defaults.config.php file
2022-11-19 19:15:43 -05:00
Hypolite Petovan a4eb6f971f [frio] Improve search list display for web and mobile
- Reduced margins
- Repositioned the network icon and external link
2022-11-19 17:16:51 -05:00
Hypolite Petovan 24804eb042 Hide non-functional mass deletion feature in search view 2022-11-19 17:16:01 -05:00
Philipp 5a2a8db21f
Merge pull request #12208 from MrPetovan/bug/12059-display-not-found
Improve error message when conversation isn't available in Module\Item\Display
2022-11-19 19:59:40 +01:00
Philipp 643d18b108
Merge pull request #12215 from MrPetovan/bug/hovercard-url
Fix support for `/contact/redir` URLs in Module\Contact\Hovercard
2022-11-19 19:53:38 +01:00
Philipp e084dd964b
Merge pull request #12216 from MrPetovan/bug/fatal-errors
Fix constructor compatibility with BaseSettings parent class
2022-11-19 19:53:11 +01:00
Hypolite Petovan a91944af24 Fix constructor compatibility with BaseSettings parent class
- Address https://paste.metaversum.wtf/?fc75de3f8eba6e7d#813SFjJwWWaJERQyrEpGAVnL33xZpTRV4MZeKmzsAvK8
2022-11-19 13:33:05 -05:00
Hypolite Petovan 0c8242af64 Update main translation file after adding a string 2022-11-19 12:29:08 -05:00
Hypolite Petovan 525eab395c Improve error message when conversation isn't available in Module\Item\Display
- Retrieve the parent post no matter what. Previously it was depending on the user's settings, which gave unpredictable behavior if the parent post wasn't retrieved for whatever reason.
- List possible reasons the conversation isn't showing up based on the condition in Model\Post::selectViewForUser
- Allow HTML in exception messages
2022-11-19 12:29:08 -05:00
Hypolite Petovan de5097b772 Fix support for /contact/redir URLs in Module\Contact\Hovercard
- The feature was broken after the Redir route was moved
2022-11-19 12:28:54 -05:00
Hypolite Petovan acc3c2d2c7
Merge pull request #12214 from Schnoop/bugfix/DivisionByZero
Prevent division by zero in Mastodon Attachment.
2022-11-19 12:27:40 -05:00
Thorsten 90567772bd Prevent division by zero. 2022-11-19 18:16:41 +01:00
Hypolite Petovan 3d5b81e4ef
Merge pull request #12213 from Schnoop/bugfix/NodeInfo
Fix that users property should be an object instead of array.
2022-11-19 11:59:33 -05:00
Thorsten 877369d964 Fix that user property should be an object instead of array. 2022-11-19 16:48:07 +01:00
Tobias Diekershoff 8609fe2f5e
Merge pull request #12207 from MrPetovan/bug/12187-register-uid-0
Ensure register records aren't created with uid = 0
2022-11-19 15:52:53 +01:00
Hypolite Petovan 336c8eba4f
Merge pull request #12211 from Schnoop/feature/fixImportLink
Fix route for user import.
2022-11-19 09:21:13 -05:00
Thorsten d77fece367 Fix route for user import. 2022-11-19 15:17:42 +01:00
Hypolite Petovan 805fa6024f Update main translation file after adding strings 2022-11-19 07:53:55 -05:00
Hypolite Petovan 6460218c0e Ensure register records aren't created with uid = 0
- uid = 0 matches system account and public contact records, giving unexpected display in pending user list. More importantly, the originally created user can't be approved since its user id is lost.
2022-11-18 16:04:02 -05:00
Hypolite Petovan c07af2a0ed
Merge pull request #12202 from Schnoop/develop
Add meta tag to attachment to show images in mastodon app.
2022-11-18 14:44:05 -05:00
Schnoop 528e1661e4
Merge pull request #1 from Schnoop/Schnoop-patch-1
Update main.js
2022-11-18 20:08:10 +01:00
Schnoop 565ade02a4
Update main.js
Revert trailing slash changes as this will lead to wrong urls.
2022-11-18 20:07:46 +01:00
Schnoop 99c319734d
Merge branch 'friendica:develop' into develop 2022-11-18 19:50:24 +01:00
Thorsten 45badbf0f8 Changed ddev config to match supported PHP version. 2022-11-18 19:43:47 +01:00
Thorsten 2edbd1a3e2 Reverted some changes that won't work with PHP7.3 2022-11-18 19:41:56 +01:00
Hypolite Petovan 061653a9a5
Merge pull request #12205 from tobiasd/20221118-de
DE translation update
2022-11-18 10:30:18 -05:00
Tobias Diekershoff d7946dd985 DE translation update 2022-11-18 16:11:07 +01:00
Thorsten 7a39be8270 DDEV and some PHP8.1 fixes. 2022-11-18 12:03:55 +01:00
Thorsten efaf84631d Merge branch 'develop' of github.com:Schnoop/friendica into develop 2022-11-18 10:03:09 +01:00
Thorsten 74b10708ae Add meta tag to attachment to show images in mastodon app. 2022-11-18 09:42:53 +01:00
Thorsten 8a71bdc1a0 Add meta tag to attachment to show images in mastodon app. 2022-11-18 09:38:02 +01:00
Hypolite Petovan e354f48765
Merge pull request #12200 from annando/ignore-view
"View" activities are now ignored
2022-11-17 15:28:34 -05:00
Michael cdbfa34066 "View" activities are now ignored 2022-11-17 20:01:32 +00:00
Philipp 19db2ab184
Merge pull request #12198 from MarekBenjamin/patch-1
Update README.md
2022-11-17 20:11:54 +01:00
MarekBenjamin d1abb690a0
Update README.md
Removed "post on facebook" since Facebook add-ons are deprecated (https://github.com/friendica/friendica/wiki/How-to:-Friendica%E2%80%99s-Facebook-connector)
Changed preposition in  "(...) receive any content on Tumblr, Wordpress or RSS." to "receive any content from Tumblr, Wordpress or RSS."
2022-11-17 19:35:27 +01:00
Philipp 944f4733be
Merge pull request #12196 from MrPetovan/bug/12182-icon-size
Add global styles for .icon
2022-11-17 07:01:48 +01:00
Hypolite Petovan 47ad922f9a Add global styles for .icon
- Normalize user/contact profile pictures size
2022-11-16 20:12:36 -05:00
Philipp fa675de710
Merge pull request #12194 from MrPetovan/bug/12193-contact_template
Replace remaining references to contact_template.tpl by contact/entry.tpl
2022-11-16 22:30:19 +01:00
Hypolite Petovan a6d96bf1b7 Replace remaining references to contact_template.tpl by contact/entry.tpl 2022-11-16 16:23:47 -05:00
Hypolite Petovan 293f147867
Merge pull request #12186 from nupplaphil/mod/editpost
Move mod/editpost.php to src\Module\Post\Edit
2022-11-16 16:14:07 -05:00
Philipp 81b21c4131
Revert "Remove geotag"
This reverts commit 5dc9319b
2022-11-16 21:20:24 +01:00
Philipp 5204d79dee
Merge pull request #12190 from annando/no-view
Fix memory issue on displaying conversations
2022-11-16 10:52:18 +01:00
Philipp 9621279572
Make PHP-CS happy ... 2022-11-16 10:49:12 +01:00
Philipp 12fb897f54
Adhere PHP-CS 2022-11-16 08:56:37 +01:00
Philipp e7fd4a4cd1
Remove legacy comments 2022-11-16 08:56:19 +01:00
Philipp 5dc9319bb2
Remove geotag 2022-11-16 08:50:57 +01:00
Philipp db7af4c45b
Remove jotnets 2022-11-16 08:49:48 +01:00
Michael ec92f7a81c Fix memory issue on displaying conversations 2022-11-16 04:57:46 +00:00
Philipp 09e01b9356
Replace $_SESSION 2022-11-15 22:52:23 +01:00
Philipp 01c2a775e4
Update messages.po 2022-11-15 22:34:31 +01:00
Philipp 00883c9dcb
Move mod/editpost.php to src\Module\Post\Edit 2022-11-15 22:32:46 +01:00
Philipp 53f3454874
Merge pull request #12184 from annando/duplicated-media
This fixes duplicated media in quoted posts
2022-11-15 21:17:19 +01:00
Hypolite Petovan 403b025b5d
Merge pull request #12179 from nupplaphil/mod/display
Move mod/(update_)display.php to src\Module
2022-11-15 15:14:17 -05:00
Michael 348156dbcf Simplify the check 2022-11-15 19:55:03 +00:00
Michael eca52627c1 This fixes duplicated media in quoted posts 2022-11-15 19:48:43 +00:00
Philipp 59c97234f8
PHP-CS and license .. 2022-11-15 20:15:25 +01:00
Philipp 584e7a7e6d
Remove trailing slash in update_ calls 2022-11-15 20:11:38 +01:00
Philipp eff7740a67
Address feedback 2022-11-15 19:53:53 +01:00
Michael Vogel 1a54fc2140
Merge pull request #12181 from MrPetovan/bug/warnings
Address a couple of warnings
2022-11-15 17:58:24 +01:00
Hypolite Petovan 952e6c688c Suppress warning when /phots route is used without a nickname
- Address https://github.com/friendica/friendica/issues/11993#issuecomment-1314964388
2022-11-15 09:04:12 -05:00
Hypolite Petovan 3a7586e3f7 Fix wrong user table field name in Repository\Notify
- Address https://github.com/friendica/friendica/issues/11993#issuecomment-1314954594
2022-11-15 09:03:43 -05:00
Philipp ba0b83b0b0
Make PHP-CS happy 2022-11-15 01:10:49 +01:00
Philipp 9d455a5d0b
Update messages.po 2022-11-15 01:00:29 +01:00
Philipp 3259bd17dc
Move mod/(update_)display.php to src\Module 2022-11-15 00:57:47 +01:00
Philipp 5c05a3b0f6
Move mod/display.php "feed-item" to a src\Module\Item\Feed.php 2022-11-15 00:52:58 +01:00
Hypolite Petovan 744d0fdde4
Merge pull request #12178 from annando/null-report
Allow anonymous reports
2022-11-14 18:30:54 -05:00
Michael 91949f0292 Allow anonymous reports 2022-11-14 23:27:46 +00:00
Philipp 8dfd560b52
Merge pull request #12169 from MrPetovan/bug/7574-notifications-deleted-users
Centralize config.admin_email management in Model\User
2022-11-15 00:08:07 +01:00
Hypolite Petovan 1ec70f9640 Update main translation file after moving strings 2022-11-14 17:13:27 -05:00
Hypolite Petovan fe547b7851 Centralize config.admin_email management in Model\User 2022-11-14 17:02:42 -05:00
Hypolite Petovan cbe8d463b1 Don't create notify for deleted user accounts 2022-11-14 17:02:42 -05:00
Hypolite Petovan 48b1dceb19 Don't send item notifications to deleted user accounts 2022-11-14 17:02:42 -05:00
Hypolite Petovan 2d0af812b1 Don't send password reset emails to deleted user accounts 2022-11-14 17:02:41 -05:00
Hypolite Petovan 6df187478d Fixed wrong reference to user.expire in Model\User::getActorName
- Update field documentation to prevent further confusion
2022-11-14 17:02:41 -05:00
Philipp c3cae0ae96
Merge pull request #12177 from MrPetovan/bug/warnings
Ensure Post::toArray returns an array
2022-11-14 20:58:42 +01:00
Hypolite Petovan 10e48a34f2 Ensure Post::toArray returns an array
- We don't handle query errors anyway
- Remove unused parameter do_close
- Address https://github.com/friendica/friendica/issues/11993#issuecomment-1314245581
2022-11-14 14:53:54 -05:00
Philipp 0eaa2eae84
Merge pull request #12156 from MrPetovan/task/4090-move-mod-pubsubhubbub
Move remainder of OStatus stack to src/Module
2022-11-14 20:04:35 +01:00
Hypolite Petovan 89338684b5 Update main translation file after moving strings 2022-11-14 13:48:47 -05:00
Hypolite Petovan 27e59e3819 Delete mod/ostatus_subscribe.php file 2022-11-14 13:48:47 -05:00
Hypolite Petovan cb0fde5d7d Create new OStatus\Subscribe module class
- Move route from /ostatus_subscribe to /ostatus/subscribe
2022-11-14 13:48:47 -05:00
Hypolite Petovan d53f51fce3 Delete mod/poco.php file 2022-11-14 13:48:47 -05:00
Hypolite Petovan eb6b03b555 Add new OStatus\PortableContacts module class
- Retain existing route /poco for backward compatibility
- Remove unsupported links to /poco/{nickname} route
2022-11-14 13:48:46 -05:00
Hypolite Petovan d21da2dc0a Remove mod/pubsub.php file 2022-11-14 13:48:46 -05:00
Hypolite Petovan a1a0b6512c Create new OStatus\PubSub module class
- Retain previous route /pubsub for backward compatibility
2022-11-14 13:48:46 -05:00
Hypolite Petovan cac42d349c Remove mod/pubsubhubbub.php file 2022-11-14 13:48:46 -05:00
Hypolite Petovan a8759a9b86 Create new OStatus\PubSubHubBub module class
- Retaining the same /pubsubhubbub route to keep backward compatibility
2022-11-14 13:48:45 -05:00
Philipp 66819fadfd
Merge pull request #12158 from annando/api-report
We can now store reports done via API
2022-11-14 18:40:57 +01:00
Hypolite Petovan 63fc315ea0 Add support for Mastodon /reports API call 2022-11-14 12:22:54 -05:00
Hypolite Petovan 17a3a48210 Add new Moderation\Report domain classes 2022-11-14 12:22:52 -05:00
Hypolite Petovan 5d9ce80007 [Database version 1489] Add new report database tables 2022-11-14 12:10:37 -05:00
Hypolite Petovan e6db31a462
Merge pull request #12174 from annando/duplicate-media
Avoid duplicate media elements
2022-11-13 19:07:08 -05:00
Michael 9506bf6989 Avoid duplicate media elements 2022-11-13 23:38:48 +00:00
Philipp 21d1659982
Merge pull request #12173 from MrPetovan/bug/mail-headers-crlf
mail() requires additional headers to be separated by CRLF
2022-11-13 11:35:18 +01:00
Hypolite Petovan 4dc96daeb3 mail() requires additional headers to be separated by CRLF
- Rewrite Email->getAdditionalMailHeaderString to have only one string concatenation statement
2022-11-13 02:28:06 -05:00
Philipp b1eba05e93
Merge pull request #12168 from KulikAlex/patch-1
Update message_recipient.tpl
2022-11-12 17:31:10 +01:00
KulikAlex 03cfb69a64
Update message_recipient.tpl 2022-11-12 19:04:02 +03:00
Michael Vogel f8c3083f35
Merge pull request #12164 from MrPetovan/bug/fatal-errors
Remove superfluous property declaration in Settings\UserExport
2022-11-12 14:46:09 +01:00
Hypolite Petovan eedde86a37 Remove superfluous property declaration in Settings\UserExport
- Address https://github.com/friendica/friendica/issues/11992#issuecomment-1312417007
2022-11-12 08:37:42 -05:00
Hypolite Petovan 07d42d6af2
Merge pull request #12162 from annando/link-share
Avoid link parsing problems in front of "share" elements
2022-11-12 08:00:01 -05:00
Michael 5b70df63de Avoid link parsing problems in front of "share" elements 2022-11-12 11:20:26 +00:00
Philipp ca3dcdad04
Merge pull request #12157 from MrPetovan/bug/fatal-errors
Fix constructor parameters in Module\Settings\RemoveMe
2022-11-11 07:34:02 +01:00
Hypolite Petovan 863977da66 Fix constructor parameters in Module\Settings\RemoveMe
- Address https://github.com/friendica/friendica/issues/11992#issuecomment-1311162326
2022-11-10 22:36:54 -05:00
Philipp f9ab5b0669
Merge pull request #12154 from MrPetovan/bug/12084-strip-RTL-override
Remove RTL Override character from display names to show in notifications
2022-11-10 17:29:11 +01:00
Hypolite Petovan 256c8ab170 Remove RTL Override character from display names to show in notifications
- It was causing the notification message to be unreadable
2022-11-10 10:42:21 -05:00
Hypolite Petovan 71ab9e13f2 Flatten arbitrary contact structure in constructor of FormattedNavNotification 2022-11-10 10:41:02 -05:00
Hypolite Petovan 87bb4d44a2
Merge pull request #12153 from nupplaphil/feat/woodpecker
Woodpecker: Update PHP version
2022-11-09 20:36:33 -05:00
Philipp 3550257d9c
Deactivate PHP 8.1
- PHP 7 incompatible change necessary (App\Page.php OffsetGet mixed return)
2022-11-10 00:04:57 +01:00
Philipp 477bec1977
Fix some PHP8.1 issues if possible 2022-11-09 23:58:23 +01:00
Philipp 3b03da3259
Activate PHP 8.1 Unit-Tests 2022-11-09 23:20:22 +01:00
Philipp ad1d160634
Woodpecker: Update PHP version 2022-11-09 23:20:22 +01:00
Hypolite Petovan 59b48c2d84
Merge pull request #12152 from nupplaphil/mod/msearch
Move mod/mod/msearch & mod/match to src/Module
2022-11-09 16:55:25 -05:00
Philipp 6d7cfc8450
whops .. wrong legacy endpoint 2022-11-09 22:39:36 +01:00
Philipp 815d8975e6
Rename Match to MatchInterests because PHP8-lint rejects "match" 2022-11-09 22:36:02 +01:00
Philipp 7c66073e4b
Add license 2022-11-09 22:29:43 +01:00
Philipp a36a4b6192
fix link 2022-11-09 22:28:29 +01:00
Philipp 4998d15e85
Update messages.po 2022-11-09 22:27:47 +01:00
Philipp 82c631eae3
Fix Guzzle InvalidArgumentException for POST with array parameters 2022-11-09 22:25:37 +01:00
Philipp 75360f3b8c
Move mod/mod/msearch & mod/match to src/Module 2022-11-09 22:17:50 +01:00
Philipp 3f6ec3dd31
Merge pull request #12106 from MrPetovan/task/4090-move-mod-settings
Move mod/settings.php to src/Module
2022-11-09 20:34:31 +01:00
Philipp d6e12d412b
Merge pull request #12150 from MrPetovan/bug/moderation
Replace remaining "admin" instances in moderation templates
2022-11-09 14:31:14 +01:00
Hypolite Petovan cb5e18838c Replace remaining "admin" instances in moderation templates 2022-11-09 08:13:12 -05:00
Hypolite Petovan 60dec7f164 Update main translation file after changing strings 2022-11-09 06:29:53 -05:00
Hypolite Petovan e6ada08e1b Delete mod/settings.php and its reference 2022-11-09 06:26:08 -05:00
Hypolite Petovan 5916544bc8 Move settings/features to src/Module 2022-11-09 06:26:08 -05:00
Hypolite Petovan 45c4439119 Move settings/connectors to src/Module 2022-11-09 06:26:05 -05:00
Hypolite Petovan 33d1df3c6d Move settings/addons to src/Module 2022-11-09 06:25:41 -05:00
Hypolite Petovan 3226b00995 Move settings/oauth to src/Module
- Add settings_content() permission checks to Module\BaseSettings
- Transform application token deletion GET links to POST forms to keep a single OAuth module class
2022-11-09 06:25:22 -05:00
Philipp 55365aa4da
Merge pull request #12147 from annando/warning
Fix warning:  Undefined array key "public"
2022-11-09 09:25:01 +01:00
Michael d3bbed176f Merge remote-tracking branch 'upstream/develop' into warning 2022-11-09 07:35:31 +00:00
Michael e9393fb509 Fix warning when loading invalid html 2022-11-09 06:38:31 +00:00
Michael a7e576fda0 Fix warning: Undefined array key "public" 2022-11-09 06:31:05 +00:00
Philipp f2cf3d0072
Merge pull request #12146 from MrPetovan/task/4090-move-mod-redir
Move mod/redir.php to src/Module
2022-11-09 07:29:59 +01:00
Hypolite Petovan 143d8a6d6d Update main translation file after moving strings 2022-11-08 20:25:21 -05:00
Hypolite Petovan a8ab85065b Delete mod/redir.php file 2022-11-08 20:12:26 -05:00
Hypolite Petovan 4a626ef101 Create new Contact\Redir module class
- Move /redir route to /contact/redir
2022-11-08 20:12:23 -05:00
Hypolite Petovan 386c08aa05 Remove superfluous calls to DI::baseUrl in Contact:photoMenu 2022-11-08 19:31:09 -05:00
Philipp 6af025246e
Merge pull request #12141 from MrPetovan/task/4090-move-mod-removeme
Move mod/removeme.php to src/Module
2022-11-09 00:40:29 +01:00
Hypolite Petovan 6313780094 Updated main translation file after changing strings 2022-11-08 18:33:54 -05:00
Hypolite Petovan 48da6f2f51 Deleted fils related to mod/removeme.php 2022-11-08 18:33:54 -05:00
Hypolite Petovan a68c790c64 Create new Settings\RemoveMe module class
- Moved route from /removeme to /settings/removeme
- Combined templates into one
2022-11-08 18:33:54 -05:00
Hypolite Petovan cae2e17436
Merge pull request #12145 from annando/parent-post
Performance improvements in public timeline
2022-11-08 18:06:47 -05:00
Michael df8644c59c Performance improvements in public timeline 2022-11-08 21:48:42 +00:00
Philipp a8c23e8cee
Merge pull request #12140 from annando/store-source
For debug reasons we now can store all incoming sources
2022-11-08 18:30:50 +01:00
Hypolite Petovan 64fad2913d Updated main translation file after adding strings 2022-11-08 11:53:10 -05:00
Hypolite Petovan 99d54dc711 Restore Item\Source module functionality 2022-11-08 11:53:09 -05:00
Michael 246021fdfa Store the source of incoming posts 2022-11-08 11:53:09 -05:00
Philipp 3bd6acba7e
Merge pull request #12144 from MrPetovan/bug/moderation
Add missing links to moderation section
2022-11-08 17:26:19 +01:00
Hypolite Petovan 8161a32b77 Add missing links to moderation section 2022-11-08 09:16:36 -05:00
Tobias Diekershoff 48090d1b70
Merge pull request #12142 from MrPetovan/task/homepage-verified
Add title to homepage verified check mark
2022-11-08 11:12:17 +01:00
Tobias Diekershoff 0c92610f6c
Merge pull request #12143 from MrPetovan/bug/moderation
Replace remaining occurrences of admin/users route by moderation/users
2022-11-08 11:09:36 +01:00
Hypolite Petovan 327cf17b07 Updated main translation file after adding a string 2022-11-08 04:32:58 -05:00
Hypolite Petovan 0a20566199 Replace remaining occurrences of admin/users route by moderation/users 2022-11-08 04:26:11 -05:00
Hypolite Petovan 561f22cdc4 Add title to homepage verified check mark
- Decrease log level for not found Memcached keys
2022-11-08 04:20:19 -05:00
Philipp 939a80ceb0
Merge pull request #12107 from annando/moderation
New area "moderation"
2022-11-08 08:46:06 +01:00
Hypolite Petovan 4ecf6d9d63 Updated main translation file after moving strings 2022-11-08 02:32:57 -05:00
Hypolite Petovan 18f54f4425 New area "moderation"
- Moved several admin pages to the moderation area
- ACL still is checking for administrator credentials
2022-11-08 02:28:42 -05:00
Tobias Diekershoff 4fb7e9b023
Merge pull request #12138 from MrPetovan/task/4090-move-mod-repair_ostatus
Move mod/repair_ostatus.php to src/Module
2022-11-08 06:24:24 +01:00
Hypolite Petovan 5ab1cf44f9 Update main translation file after changin strings 2022-11-07 21:56:29 -05:00
Hypolite Petovan e612137a9d Delete mod/repair_ostatus.php file 2022-11-07 21:44:42 -05:00
Hypolite Petovan c7dbe0b610 Create new OStatus\Repair module class
- Create corresponding template file
2022-11-07 21:44:18 -05:00
Hypolite Petovan e7051580e4
Merge pull request #12136 from annando/quote-bug
Quoted reshares containing quoted reshares should now look fine
2022-11-07 20:48:04 -05:00
Michael 664071a0b1 Quoted reshares containing quoted reshares should now look fine 2022-11-07 20:44:20 -05:00
Hypolite Petovan 57a207fd8c
Merge pull request #12121 from nupplaphil/feat/move_cal_2
Move mod/cal.php and mod/events.php to Module
2022-11-07 14:47:56 -05:00
Philipp bb97776dfb
The last PHPCS error .. 2022-11-07 20:35:07 +01:00
Philipp d524f55e3e
Reduce error-throws :-) 2022-11-07 20:34:05 +01:00
Philipp a81708091f
Make PHPCS happy 2022-11-07 20:32:55 +01:00
Philipp a6b09529fd
Update messages.po 2022-11-07 20:32:45 +01:00
Philipp 2da2ac6826
make PHP CS happy? 2022-11-07 20:28:08 +01:00
Philipp 78a8ed6fe7
adhere feedback 2022-11-07 20:21:11 +01:00
Philipp f13c91b320
Move mod/cal.php and mod/events.php to Module 2022-11-07 19:52:24 +01:00
Philipp 89fde911f9
Fix possible security issue 2022-11-07 19:52:13 +01:00
Hypolite Petovan 1c80969db9
Merge pull request #12134 from Quix0r/fixes/type-hints
Added type-hints
2022-11-07 13:42:38 -05:00
Roland Häder 3bdc20df15
Changed:
- added type-hints as follow-up commit to #12130
2022-11-07 19:18:34 +01:00
Michael Vogel e6a5c172ce
Merge pull request #12131 from MrPetovan/task/4090-move-mod-salmon
Move mod/salmon.php to src/Module
2022-11-07 14:55:02 +01:00
Hypolite Petovan 6cb6841866
Merge pull request #12109 from tobiasd/verify-homepage-relme
Verify homepage by checking for a rel-me link back to the user profile
2022-11-07 07:56:00 -05:00
Hypolite Petovan 7c7fc624f3
Fix code standards in Module\OStatus\Salmon 2022-11-07 07:54:12 -05:00
Tobias Diekershoff d82e8284f0 regen messages.po 2022-11-07 11:25:11 +01:00
Tobias Diekershoff 44af6e4bc2 don't be pythonic 2022-11-07 11:19:33 +01:00
Tobias Diekershoff 379eeb49eb make the standards check happy 2022-11-07 11:19:33 +01:00
Tobias Diekershoff cdfd51310e we don't need the 20... 2022-11-07 11:19:33 +01:00
Tobias Diekershoff 594c17546b the config default parameter was deprecated 2022-11-07 11:19:33 +01:00
Tobias Diekershoff a9265220af add labels for the logger parameters 2022-11-07 11:19:33 +01:00
Tobias Diekershoff 33c9d17bdb change the cURL success check and adopt the logger messages 2022-11-07 11:19:33 +01:00
Tobias Diekershoff fb04eb107b set the validation to false, and only set it to true if we were able to verify the link 2022-11-07 11:19:33 +01:00
Tobias Diekershoff 64f290a055 avoide useless cURL request to the profile page 2022-11-07 11:19:33 +01:00
Tobias Diekershoff 39908f9083 regen messages.po 2022-11-07 11:19:33 +01:00
Tobias Diekershoff dd0811aec9 remove debugging tracers 2022-11-07 11:19:33 +01:00
Tobias Diekershoff 5530b6fc75 reviews 2022-11-07 11:19:33 +01:00
Tobias Diekershoff 1c65098013 clean up the used modules 2022-11-07 11:19:33 +01:00
Tobias Diekershoff be6809ecdd updated the messages.po file 2022-11-07 11:19:11 +01:00
Tobias Diekershoff 457c34dd13 add a checkmark to the vcards if the homepage has a rel-me back to the profile 2022-11-07 11:15:55 +01:00
Tobias Diekershoff a1d57abfe4 add the new CheckRelMeProfileLink class to the worker 2022-11-07 11:15:55 +01:00
Tobias Diekershoff a98d321376 add the homepage_verified field to the profile table and the owner-view 2022-11-07 11:15:55 +01:00
Tobias Diekershoff 028d823d96 add a help text to the profile settings indicating how to verify the homepage, or that the homepage is verified 2022-11-07 11:15:55 +01:00
Tobias Diekershoff 0104930fb3 add homepage help text to the templates 2022-11-07 11:15:55 +01:00
Tobias Diekershoff c8636db9f6 When the profile is updated, let the Worker verify the homepage link 2022-11-07 11:15:55 +01:00
Tobias Diekershoff 30b9a57a37 Let the Worker check the homepage of a profile daily 2022-11-07 11:15:54 +01:00
Michael Vogel 029a539774
Merge pull request #12118 from MrPetovan/task/10875-add-follow-contact-actions
Add follow/unfollow link to the contact actions menu
2022-11-07 08:41:15 +01:00
Hypolite Petovan 9e315a75d8 Remove mod/salmon.php 2022-11-06 20:42:08 -05:00
Hypolite Petovan ec02664773 Add new OStatus\Salmon module class
- Add module instanciation in Module\DFRN\Notify
2022-11-06 20:42:05 -05:00
Hypolite Petovan bd9292fe19 Convert static methods to dynamic in Module\DFRN\Notify 2022-11-06 20:38:33 -05:00
Hypolite Petovan db3404e8a3 Update main translation file after adding a couple strings 2022-11-06 19:03:21 -05:00
Hypolite Petovan d5b29b1c61 Add follow/unfollow link to the contact actions menu 2022-11-06 19:03:21 -05:00
Hypolite Petovan ae5dde9f5e Fix <a> tags with an onclick action navigating to the URL 2022-11-06 19:03:21 -05:00
Hypolite Petovan 46152ab400
Merge pull request #12130 from annando/fix-test
Use different parser modes for Mastodon and Twitter-API
2022-11-06 18:01:25 -05:00
Michael 210200d330 Use different parser modes for Mastodon and Twitter-API 2022-11-06 20:02:43 +00:00
Philipp 5d2a25a86e
Merge pull request #12128 from tobiasd/20221106-viercontacts
[vier] Fix contacts display
2022-11-06 20:23:51 +01:00
Philipp bf638b6bf6
Merge pull request #12129 from tobiasd/20221106-issue12013
the filebrowser.tpl file was missing an "
2022-11-06 20:23:31 +01:00
Tobias Diekershoff fb07ba2e3b the filebrowser.tpl file was missing an " 2022-11-06 19:21:37 +01:00
Tobias Diekershoff 1f4ca51cc8 [vier] Fix contacts display 2022-11-06 17:41:10 +01:00
Tobias Diekershoff 205f19da38
Merge pull request #12126 from annando/import-contacts
Support "fedifinder" to import contacts
2022-11-06 13:09:30 +01:00
Michael 1d7d8788bd Support "fedifinder" to import contacts 2022-11-06 10:05:54 +00:00
Tobias Diekershoff e582cd4543
Merge pull request #12125 from annando/pending
Don't show following/followed_by on pending
2022-11-06 10:26:11 +01:00
Michael e10d714ef5 Don't show following/followed_by on pending 2022-11-06 08:18:28 +00:00
Tobias Diekershoff 4b5c6994b2
Merge pull request #12122 from annando/issue-2657
Issue 2657: Mentions will now be recognized by clients
2022-11-06 09:13:45 +01:00
Tobias Diekershoff 174151d4d0
Merge pull request #12124 from annando/issue-11832
Issue 11832: Avoid error when fetching group members
2022-11-06 09:12:22 +01:00
Tobias Diekershoff d0318b3df6
Merge pull request #12123 from annando/issue-11831
Issue 11831: Activate "notify on new post" via API
2022-11-06 09:10:34 +01:00
Michael Vogel eecd5020ac
Merge pull request #12117 from MrPetovan/bug/12113-malformed-url-containsLink
Suppress InvalidArgument exceptions handling URLs in Model\Item::containsLink
2022-11-06 08:43:14 +01:00
Michael b202354bbb Merge remote-tracking branch 'upstream/develop' into issue-2657 2022-11-06 07:08:55 +00:00
Michael fe3713b8f3 Merge remote-tracking branch 'upstream/develop' into issue-11832 2022-11-06 07:07:32 +00:00
Michael f1f40fbbf7 Merge remote-tracking branch 'upstream/develop' into issue-11831 2022-11-06 07:04:35 +00:00
Michael 92813dd2e4 Issue 11832: Avoid error when fetching group members 2022-11-06 06:42:33 +00:00
Michael bc7d21183d Issue 11831: Activate "notify on new post" via API 2022-11-06 06:11:22 +00:00
Michael 40fb820aef Unused use removed 2022-11-06 06:00:19 +00:00
Michael 56ac879c92 Issue 2657: Mentions will now be recognized by clients 2022-11-06 05:43:34 +00:00
Hypolite Petovan 3e33ec0c0f Suppress InvalidArgument exceptions handling URLs in Model\Item::containsLink 2022-11-05 20:18:14 -04:00
Michael Vogel ea49ab6e04
Merge pull request #12114 from MrPetovan/bug/12112-unFollow
Fix capitalization of unfollow links in Model\Contact
2022-11-06 00:21:27 +01:00
Michael Vogel c6ca3400ec
Merge pull request #12104 from MrPetovan/task/deprecated-themes
Deprecate themes duepuntozero, quattro and smoothly
2022-11-06 00:17:49 +01:00
Hypolite Petovan b9f0985467
Merge pull request #12116 from annando/issue-11846
Issue 11846: Fix client behaviour when following hash tags
2022-11-05 19:13:31 -04:00
Michael Vogel 52f74b6312
Update src/Object/Api/Mastodon/Status.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2022-11-05 23:51:16 +01:00
Hypolite Petovan 5bc0480fc2
Merge pull request #12115 from annando/issue-12096
Issue 12096: Improve account search
2022-11-05 18:46:06 -04:00
Michael 9fa3df3cbf "arrat" to "array" 2022-11-05 22:39:15 +00:00
Michael aa2b4e15a3 Issue 11846: Fix client behaviour when following hash tags 2022-11-05 22:35:35 +00:00
Michael db12814f3b Improved url detection 2022-11-05 22:32:56 +00:00
Michael 70d0f087b7 Issue 12096: Improve account search 2022-11-05 22:08:28 +00:00
Hypolite Petovan c7638e0d0c Updated main translation file after updating a couple of strings 2022-11-05 18:01:53 -04:00
Hypolite Petovan e763f57d29 Fix capitalization of unfollow links in Model\Contact 2022-11-05 17:54:50 -04:00
Philipp c107c5ff0d
Merge pull request #12110 from annando/quote
Transmit the quoted part in the source
2022-11-05 21:15:05 +01:00
Michael 4dd2d7ebab Transmit the quoted part in the source 2022-11-05 16:25:04 +00:00
Hypolite Petovan 9aa05eb911 Deprecate themes duepuntozero, quattro and smoothly 2022-11-05 00:06:10 -04:00
Philipp 8cec89195b
Merge pull request #12102 from MrPetovan/task/11011-frio-contact-template-link
[frio] Make the main contact row template link to the contact page
2022-11-04 19:49:34 +01:00
Philipp f7d42764de
Merge pull request #12105 from MrPetovan/task/4090-move-mod-share
Move mod/share.php to src/Module
2022-11-04 19:48:17 +01:00
Hypolite Petovan 198d38545d
Remove trailing spaces from Module\Post\Share 2022-11-04 14:14:00 -04:00
Hypolite Petovan a09558e8a8 [frio] Make the main contact row template link to the contact page
- This was preventing mobile users to access the contact page that was hidden behind a onmouseover behavior
- The now unused template for contact filtering is also removed
2022-11-04 13:03:35 -04:00
Hypolite Petovan 9bb9bf5668 Remove mod/share.php file 2022-11-04 13:02:02 -04:00
Hypolite Petovan 8124dedbf6 Create new Post/Share module class 2022-11-04 13:02:01 -04:00
Philipp 119f9d9d27
Merge pull request #12094 from MrPetovan/task/hide-reply-counts-ping
Remove non-top-level posts from notification labels when network sort order is "received"
2022-11-04 18:00:15 +01:00
Philipp 16b3db343b
Merge pull request #12103 from MrPetovan/task/4090-move-mod-suggest
Move mod/suggest.php to src/Module
2022-11-04 17:56:17 +01:00
Hypolite Petovan f50368c9cb Update main translation file after mving strings 2022-11-04 11:29:39 -04:00
Hypolite Petovan 55744b6ccb Remove mod/suggest.php file 2022-11-04 07:57:37 -04:00
Hypolite Petovan 8ec5d10bf4 Add new Contact/Suggestions module class 2022-11-04 07:57:00 -04:00
Hypolite Petovan 811e144e9e Move viewcontact_template and contact_template to contact/ folder 2022-11-04 07:03:55 -04:00
Hypolite Petovan 6c745c8522 Remove non-top-level posts from notification labels when network sort order is "received"
- These posts don't alter the network view in this sort order and so are distracting with no actionable benefits
2022-11-04 06:42:38 -04:00
Hypolite Petovan 8092bfe277 Remove dependency on DI in Notifications\Ping module 2022-11-04 06:42:38 -04:00
Hypolite Petovan 23dda5d510 Deprecate default value parameters in Session and Config interfaces
- It is more efficient to use the null coalescing operator ?? that prevents the computation of the default value if the key has been found
2022-11-04 06:42:38 -04:00
Hypolite Petovan da3041a4d4 Add new Conversation\Network::getTimelineOrderBySession method 2022-11-04 06:42:37 -04:00
Hypolite Petovan fa123bd765 Rename Repository\Notify->NotifyOnDesktop to shouldShowOnDesktop
- New name better reflect the behavior
2022-11-04 06:42:37 -04:00
Philipp 891f686dcf
Merge pull request #12100 from MrPetovan/task/4090-move-mod-tagger
Move mod/tagger.php to src/Module
2022-11-04 07:17:45 +01:00
Hypolite Petovan 3dbce995fd Updated main translation file after moving strings 2022-11-03 22:30:25 -04:00
Hypolite Petovan 7208576f67 Remove mod/tagger.php 2022-11-03 22:26:57 -04:00
Hypolite Petovan 1ba9a65fd8 Add new Post/Tag/Add module class
- Convert GET to POST
2022-11-03 22:26:48 -04:00
Hypolite Petovan 57d11d7f2e
Merge pull request #12099 from annando/issue-12097
Issue 12097: Notify for each new user registration
2022-11-03 16:31:42 -04:00
Michael f1f4561002 Updates messages.po 2022-11-03 20:18:50 +00:00
Michael a89f235044 Merge remote-tracking branch 'upstream/develop' into issue-12097 2022-11-03 20:15:53 +00:00
Michael 5b682eb5fb Merge branch 'issue-12097' of github.com:annando/friendica into issue-12097 2022-11-03 20:14:56 +00:00
Michael 9fcdb405e8 Added settings 2022-11-03 20:14:52 +00:00
Michael Vogel a20c6e3216
Apply suggestions from code review
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2022-11-03 21:13:03 +01:00
Michael 0f9e2b6da4 Issue 12097: Notify for each new user registration 2022-11-03 19:59:33 +00:00
Hypolite Petovan 78d063f35a
Merge pull request #12095 from annando/bulk
Improved bulk delivery / don't redistribute activities
2022-11-03 07:59:44 -04:00
Philipp 0d4c7f769e
Merge pull request #12093 from MrPetovan/task/4090-move-mod-tagrm
Move mod/tagrm.php to src/Module
2022-11-03 07:44:48 +01:00
Michael 12a352f441 Simplified else case 2022-11-03 04:27:30 +00:00
Hypolite Petovan fcd7819f95 Updated main translation file after moving strings 2022-11-03 00:27:09 -04:00
Hypolite Petovan 88d04dfbdb Remove mod/tagrm.php 2022-11-03 00:27:09 -04:00
Hypolite Petovan e0dc7a471e Create Post/Tag/Remove module class and route
- Fix tag name parameter in single tag removal link in mod/photos
- Remove "/post" from backend routes as it was preventing sessions from working in this module. No existing module had a route starting with "/post".
2022-11-03 00:27:08 -04:00
Michael 1847347c3a Improved logging 2022-11-03 04:23:04 +00:00
Michael 842e51194e Improved bulk delivery / don't redistribute activities 2022-11-03 04:03:39 +00:00
Philipp da1c13368b
Merge pull request #12087 from MrPetovan/task/4090-move-mod-uimport
Move mod/uimport.php to src/Module
2022-11-02 19:19:17 +01:00
Hypolite Petovan dbc9bde97a Update main translation file after changing strings 2022-11-02 11:32:21 -04:00
Hypolite Petovan 2b2fa4471f Remove mod/uimport.php 2022-11-02 11:27:32 -04:00
Hypolite Petovan 4ab260042c Create new User\Import module class
- Merge Core\UserImport class in Module class
2022-11-02 11:27:31 -04:00
Hypolite Petovan ffa31d6641
Merge pull request #12086 from nupplaphil/feat/move_cal
Move event export to src/Module/Events/Export
2022-11-02 10:39:25 -04:00
Philipp e56d34c2b7
Update messages.po 2022-11-02 15:17:48 +01:00
Hypolite Petovan eb22f6732b
Improve alignment in static/routes.config.php 2022-11-02 15:16:25 +01:00
Philipp 998e425a15
adapt route 2022-11-02 15:16:25 +01:00
Philipp 7c4a7bff2e
Move new events routes to calendar routes 2022-11-02 15:16:24 +01:00
Philipp 2c90ab69d6
Move event export to src/Module/Events/Export 2022-11-02 15:16:23 +01:00
Tobias Diekershoff 97722177d5
Merge pull request #12091 from MrPetovan/bug/12085-view-logs-detail
Fix wrong class name in logs view template
2022-11-01 16:46:38 +01:00
Philipp cf2b28fffd
Merge pull request #12092 from MrPetovan/bug/12090-contact-route
Replace remaining "follow" route instances to "contact/follow"
2022-11-01 15:13:19 +01:00
Hypolite Petovan 2c7a60eb0e Replace remaining "follow" route instances to "contact/follow" 2022-11-01 09:41:39 -04:00
Hypolite Petovan 64d02c6636 Fix wrong class name in logs view template
- This was stunting the Javascript responsible for showing log entry details
2022-11-01 09:17:42 -04:00
Hypolite Petovan d05ee962f9
Merge pull request #12089 from annando/query-performance
(Hopefully) query performance improvements
2022-11-01 08:48:16 -04:00
Hypolite Petovan 2cf1e1074b Fix documentation typo in src/Protocol/Diaspora.php 2022-11-01 08:45:25 -04:00
Michael 1f1c2d8ca6 (Hopefully) query performance improvements 2022-11-01 08:45:25 -04:00
Philipp cdacc3f4fb
Merge pull request #12088 from MrPetovan/bug/probe-atom
Also look for Atom feeds when probing link URLs
2022-11-01 06:45:12 +01:00
Hypolite Petovan 5ef76e8f14 Also look for Atom feeds when probing link URLs 2022-11-01 00:45:46 -04:00
Hypolite Petovan df69dc0edb
Merge pull request #12077 from nupplaphil/feat/move_follow
Move mod/follow.php to src/Module
2022-10-31 19:36:11 -04:00
Philipp baa97febef
hopefully last feedback :) 2022-11-01 00:09:30 +01:00
Philipp 41565326e3
Make CS happy 2022-10-31 21:03:58 +01:00
Philipp 94d615fbb7
Update messages.po 2022-10-31 21:00:30 +01:00
Philipp 8f62278703
Rename $action because of PR before 2022-10-31 21:00:23 +01:00
Philipp 82cd6ff91d
Fixing the non-auto follow process ... 2022-10-31 20:58:37 +01:00
Philipp eb9da2967e
Fixups ... hopefully the last one :-/ 2022-10-31 20:58:37 +01:00
Philipp 87291e30a4
Found some more follow-links 2022-10-31 20:58:34 +01:00
Philipp b5d01337d9
Move Follow to /contact namespace 2022-10-31 20:58:27 +01:00
Philipp 3554894577
Fixup post 2022-10-31 20:56:44 +01:00
Philipp 437472d0a6
Move Follow to Contact namespace 2022-10-31 20:56:43 +01:00
Philipp 0e47d5b0aa
make CS happy 2022-10-31 20:56:43 +01:00
Philipp 8e6f676719
Move mod/follow to src/Modules 2022-10-31 20:56:41 +01:00
Philipp 170d776a2b
Merge pull request #12083 from MrPetovan/task/4090-move-mod-unfollow
Move mod/unfollow.php to src/Module
2022-10-31 20:55:20 +01:00
Hypolite Petovan 2907b84eb2 Update main translation file after changing strings 2022-10-31 15:34:41 -04:00
Hypolite Petovan d9075add1a Remove mod/unfollow.php file 2022-10-31 15:31:44 -04:00
Hypolite Petovan 58d6e7e2bb Create Contact\Unfollow module class 2022-10-31 15:31:44 -04:00
Hypolite Petovan a1e6e13a9f Move remote follow module to profile folder 2022-10-31 15:31:43 -04:00
Hypolite Petovan 5de8fe3a48 Fix unfollowing not showing on contact page
- Deleted contact rows kept the relationship status which would keep showing
- Deleting contact rows would also not update the corresponding user-contact record
2022-10-31 15:30:23 -04:00
Hypolite Petovan 3020dfbeeb Rename auto_request.tpl form action template variable 2022-10-31 15:30:23 -04:00
Philipp c9d6a3f044
Merge pull request #12082 from MrPetovan/task/4090-move-mod-wall_attach
Move mod/wall_attach.php to src/Module
2022-10-31 20:06:47 +01:00
Hypolite Petovan e9e7a73a63 Update main translation file after changing strings 2022-10-31 14:57:26 -04:00
Hypolite Petovan 4d3c0e1c57 Remove mod/wall_upload.php file 2022-10-31 14:57:25 -04:00
Hypolite Petovan 969b4f991e Create Profile\Attachment\Upload module class
- Add missing response type in AjaxUpload initializition
2022-10-31 14:57:25 -04:00
Philipp 6bf65eb515
Merge pull request #12081 from MrPetovan/task/4090-move-mod-wall_upload
Move mod/wall_upload.php to src/Module
2022-10-31 07:43:05 +01:00
Hypolite Petovan 2ffa8e6516 Update main translation file after changing strings 2022-10-30 14:22:48 -04:00
Hypolite Petovan 54ac93a4fc Remove mod/wall_upload.php file 2022-10-30 14:20:02 -04:00
Hypolite Petovan 39765e6018 Create Profile\Photos\Upload class 2022-10-30 14:20:01 -04:00
Philipp f826ce70ce
Merge pull request #12078 from MrPetovan/task/4090-move-mod-wallmessage
Move mod/wallmessage.php to src/Module
2022-10-30 19:04:47 +01:00
Hypolite Petovan c5076bec18 Updated main translation file after changing strings 2022-10-30 10:49:48 -04:00
Hypolite Petovan 07dd548a10 Remove mod/wallmessage module 2022-10-30 10:49:47 -04:00
Hypolite Petovan 9561910e83 Create Profile\UnkMail module class 2022-10-30 10:49:47 -04:00
Hypolite Petovan 3865733e18 Move Model\Profile::getMyUrl to UserSessions 2022-10-30 10:49:47 -04:00
Hypolite Petovan 6a205b2e10
Merge pull request #12076 from annando/quote
Improved handling of native quotes
2022-10-30 08:43:19 -04:00
Michael eae1383f48 Merge remote-tracking branch 'upstream/develop' into quote 2022-10-30 11:38:17 +00:00
Michael b402a760a8 Symplified code 2022-10-30 10:02:12 +00:00
Michael a183723254 Improved handling of contact links 2022-10-30 10:02:01 +00:00
Michael 96a36568e2 Add quote to API 2022-10-30 01:20:05 +00:00
Michael f569ccbbc2 Code is simplyfied 2022-10-29 22:55:39 +00:00
Michael 3c169b534e Improved handling of native quotes 2022-10-29 22:11:39 +00:00
Hypolite Petovan e24078a4d2
Merge pull request #12074 from annando/fix-notification
Accepting contact request does finally work per Mastodon API
2022-10-29 15:55:40 -04:00
Michael 8bba8663fb Only fetch the needed field 2022-10-29 19:11:26 +00:00
Michael f44c9e7975 Accepting contact request does finally work per Mastodon API 2022-10-29 19:04:29 +00:00
Philipp 01c0c0a1ba
Merge pull request #12072 from MrPetovan/bug/12054-advancedcontentfilter-static-vue
[Composer] Remove bower-asset/vue dependency
2022-10-29 19:34:48 +02:00
Hypolite Petovan fed17d031c [Composer] Remove bower-asset/vue dependency
- The Bower package doesn't have the dist/vue.min.js anymore (?) which is required for the advancedcontentfilter addon
2022-10-28 21:13:45 -04:00
Hypolite Petovan 2bdf2b02e3
Merge pull request #12071 from guzzisti/patch-2
fix exception when adding a poll option without votes
2022-10-28 13:45:27 -04:00
Hypolite Petovan a2adb1cd93
Remove unused argument from L10n->tt() call in Model/Item.php 2022-10-28 13:45:09 -04:00
René Wagner b99e7a9e92
fix exception when adding an poll option without votes 2022-10-28 18:51:35 +02:00
Hypolite Petovan f418687a71
Merge pull request #12070 from annando/share
Some more improvements for posts with shares
2022-10-27 08:19:23 -04:00
Michael e31533d0d3 Possibly fix test 2022-10-27 06:31:09 +00:00
Michael deccea0228 More functions moved to content class 2022-10-27 05:44:44 +00:00
Michael c65fff6f93 Some more improvements for posts with shares 2022-10-26 17:00:55 +00:00
Hypolite Petovan 0c4ebce391
Merge pull request #12067 from Quix0r/cleanup/type-hints-002
Cleanup: missing type-hints, double-quotes, reformatted array
2022-10-26 12:03:04 -04:00
Roland Häder 498d7f690a
Changes:
- php-cs is now happy with it
2022-10-26 17:59:10 +02:00
Roland Häder 03e09627e4
Used $this->isThreaded() instead as suggested by @MrPetovan 2022-10-26 17:59:07 +02:00
Hypolite Petovan 4189e01987
Merge pull request #12069 from tobiasd/20221026-de
DE translation update
2022-10-26 01:36:58 -04:00
Hypolite Petovan 80dc593159
Merge pull request #12068 from tobiasd/20221026-nofollow
add a nofollow to the blocklist export link
2022-10-26 01:36:15 -04:00
Tobias Diekershoff 606dd9f5e6 DE translation update 2022-10-26 07:33:51 +02:00
Tobias Diekershoff 80a897f2f3 add a nofollow to the blocklist export link 2022-10-26 07:30:46 +02:00
Michael Vogel ff2af0a2e3
Merge pull request #12066 from MrPetovan/task/12062-revert-block-list-email
Revert "Add email notification to all users on server domain pattern block list update"
2022-10-26 05:35:25 +02:00
Roland Häder 3c50d5b70f
Changes:
- made code more readable
2022-10-26 01:31:34 +02:00
Roland Häder 2f1336339f
Changes:
- added missing type-hints
- added missing documentation
- changed double-quotes to single
- Setters do ALWAYS return void
2022-10-26 01:29:01 +02:00
Hypolite Petovan 42199d9264 Updated main translation file after removing strings 2022-10-25 19:07:55 -04:00
Hypolite Petovan 22bfd3b4d6 Revert "Add email notification to all users on server domain pattern block list update"
This reverts commit 5045f9e188 because the main stakeholder isn't using the feature and it's putting a strain on email server accountability vis-a-vis spam lists.

# Conflicts:
#	src/Moderation/DomainPatternBlocklist.php
2022-10-25 19:02:55 -04:00
Hypolite Petovan 3456ae7809
Merge pull request #12065 from Quix0r/cleanup/renaming-more-logging
Cleanups: renaming variables and more logging
2022-10-25 17:17:46 -04:00
Hypolite Petovan 158d21db14
Merge pull request #12064 from Quix0r/phpunit/temporal-test
Unit test added for Temporal utilities class
2022-10-25 17:16:58 -04:00
Roland Häder 039a4b8c72
Fixed issues by php-cs 2022-10-25 23:09:30 +02:00
Roland Häder 913a4a5dc0
Fixed code-standards complain by php-cs, thanks to @MrPetovan 2022-10-25 22:45:50 +02:00
Roland Häder ceffd0ef6c
Changed:
- here `Logger::level()` is okay to use
- added more logging in wall_upload.php
- formatted array and put all $array['foo'] = $foo; into a single statement
- <include|require[_once]> are all no functions, but keywords
2022-10-25 21:36:59 +02:00
Roland Häder 71e82bc861
Changed:
- added logger for any reason when upload is aborted
- renamed variables a bit to camel-case style
2022-10-25 21:35:36 +02:00
Roland Häder b1cf4cbbd5
Changes:
- added unit-test for `Temporal::getRelativeDate()` method
2022-10-25 21:30:56 +02:00
Hypolite Petovan db82bdfc44
Merge pull request #12063 from Quix0r/fixes/type-hints-reformatting
Added more type-hints + reformatted code
2022-10-25 14:54:22 -04:00
Roland Häder 5306bb3e31
Changes:
- added more missing type-hints (checked them in body of the method)
- reformatted code a little (code-style)
- moved '/.well-known/host-meta' to constant Probe::HOST_META
2022-10-25 20:25:13 +02:00
Hypolite Petovan a7e9457ef2
Merge pull request #12061 from annando/share-rework
The "share" handling is improved
2022-10-25 09:04:16 -04:00
Michael 842a4bb904 Changed function name 2022-10-25 12:40:22 +00:00
Hypolite Petovan 2555596158
Merge pull request #12055 from nupplaphil/feat/usersess_decorator
Extend `IHandleUserSessions` from `IHandleSessions` and adapt classes
2022-10-25 07:52:23 -04:00
Michael ebd175872d Improved description 2022-10-25 08:45:41 +00:00
Michael 1a0b63659b Merge remote-tracking branch 'upstream/develop' into share-rework 2022-10-25 08:31:01 +00:00
Michael f54a886a5e The "share" handling is improved 2022-10-25 06:37:23 +00:00
Philipp f03c5c7f89
implement feeback 2022-10-25 08:07:42 +02:00
Tobias Diekershoff 9b310b0dd7
Merge pull request #12060 from MrPetovan/bug/9920-contact-export
Fix condition for follows export
2022-10-25 06:57:25 +02:00
Hypolite Petovan 5f92473c6e Update main translation file after changing a string 2022-10-24 18:21:50 -04:00
Hypolite Petovan dc2d96a502 Fix condition for follows export
- Select follows instead of followers
- Filter out archived contacts
2022-10-24 18:21:10 -04:00
Hypolite Petovan 142b399c84 Reformat Module\Settings\UserExport
- Import IHandleUserSessions and DbaDefinition object in constructor
- Convert remaining double quotes to single quotes
- Convert static methods to dynamic to use class properties
- Remove unused POST permission from route
2022-10-24 18:14:59 -04:00
Hypolite Petovan a3651e464d
Merge pull request #12057 from Quix0r/rewrites/type-hints
Added missing type-hints and formatted some arrays
2022-10-24 16:10:33 -04:00
Roland Häder bf9f09182e
Changes:
- added some missing type-hints
- no need for local array `$t` (changed to "anonymous" varriant)
- formatted some arrays
2022-10-24 20:32:24 +02:00
Philipp 05b15f2824
Merge pull request #12058 from Quix0r/fixes/get-remote-userid
Fixed: Undefined property: Friendica\Core\Session\Model\UserSession::$getRemoteUserId
2022-10-24 19:40:02 +02:00
Roland Häder 54b89365bb
Fixed:
- Added missing `()` to `getRemoteUserId` which is a method, and not a property
- `Undefined property: Friendica\Core\Session\Model\UserSession::$getRemoteUserId in /var/www/.../htdocs/mod/display.php on line 192`
2022-10-24 18:29:28 +02:00
Philipp b5bc1b0844
Extend IHandleUserSessions from IHandleSessions and adapt classes 2022-10-23 20:41:17 +02:00
Tobias Diekershoff b72d727a06
Merge pull request #12051 from Quix0r/hotfix/one-dollar-to-much
Hotfix: One `$` to much ...
2022-10-23 16:25:46 +02:00
Tobias Diekershoff 19155a4bb2
Merge pull request #12050 from nupplaphil/bug/notf_session_fix
Fix missing/wrong IHandleUserSessions usages
2022-10-23 16:23:01 +02:00
Roland Häder e8fe0c52e7
Hotfix: One $ to much ... 2022-10-23 13:15:34 +02:00
Philipp b4b9f426db
Fix missing/wrong IHandleUserSessions usages 2022-10-23 11:32:43 +02:00
Hypolite Petovan 6040dfa5e8
Merge pull request #12049 from nupplaphil/bug/ci
Fix CI with Session
2022-10-22 16:57:14 -04:00
Philipp c3df570324
Fix CI with Session 2022-10-22 20:03:15 +02:00
Hypolite Petovan 52cc6ff3cb
Merge pull request #12048 from tobiasd/20221022-ru
RU translation update THX SpcCw
2022-10-22 08:13:12 -04:00
Tobias Diekershoff 965314f213 RU translation update THX SpcCw 2022-10-22 06:44:08 +02:00
Hypolite Petovan 40f734da58
Merge pull request #12039 from nupplaphil/feat/session_util_Modules
UserSession class [3] - Refactor src/ files excluding Module/Model
2022-10-21 18:28:45 -04:00
Hypolite Petovan 854c8e6685
Merge pull request #12047 from friendica/revert-12044-bug/woordpecker_ci
Revert "Fix CI pipeline"
2022-10-21 18:26:05 -04:00
Philipp 4978765b90
Revert "Fix CI pipeline" 2022-10-21 19:55:29 +02:00
Philipp a9963dc54b
Remove Core\Session 2022-10-21 19:36:42 +02:00
Philipp 7b3caca276
Update src/Content/Widget.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2022-10-21 19:35:34 +02:00
Philipp 44a9683008
Move "submanage" Session value into own methods 2022-10-21 19:35:34 +02:00
Philipp cafb23f8f0
Reduce parentheses 2022-10-21 19:35:34 +02:00
Philipp f15878195c
make App\Router easier 2022-10-21 19:35:34 +02:00
Philipp 7b35c570f9
Move DI dependency for App class 2022-10-21 19:35:33 +02:00
Philipp 134f98e22e
Move DI dependency for Navigation\Notifications\Factory\Introduction class 2022-10-21 19:35:33 +02:00
Philipp a1997d73c2
Move DI dependency for Navigation\Notifications\Factory\FormattedNotify class 2022-10-21 19:35:33 +02:00
Philipp f1cbb41a60
Move DI dependency for Navigation\Notifications\Factory\FormattedNavNotification class 2022-10-21 19:35:33 +02:00
Philipp d76a2b6ad6
Move DI dependency for Content\Item class 2022-10-21 19:35:32 +02:00
Philipp 37ff477b55
Move DI dependency for App\Conversation class 2022-10-21 19:35:32 +02:00
Philipp fa8a32e83c
Move DI dependency for App\Router class 2022-10-21 19:35:32 +02:00
Philipp f83784cc63
Move DI dependency for App\Page class 2022-10-21 19:35:32 +02:00
Philipp b3f9cef94a
UserSession class [3] - Refactor src/ files excluding Module/Model 2022-10-21 19:35:32 +02:00
Hypolite Petovan a11c125f81
Merge pull request #12042 from nupplaphil/feat/usersession_Module_DepInj
UserSession class [6] - Refactor src/Module/ files without DI
2022-10-21 13:21:48 -04:00
Hypolite Petovan fc2cdd3992
Merge pull request #12046 from nupplaphil/bug/DI_missing
Add missing DI
2022-10-21 13:20:41 -04:00
Philipp 8ad83e5d5c
Add missing DI 2022-10-21 19:16:25 +02:00
Hypolite Petovan 0ac1c5fbf2
Merge pull request #12043 from nupplaphil/feat/usersession_view
UserSession class [7] - Refactor view/ files
2022-10-21 11:13:32 -04:00
Hypolite Petovan c815bbab52
Merge pull request #12045 from nupplaphil/bug/messages_po
Fix messages.po issue
2022-10-21 11:13:21 -04:00
Philipp 84201f0915
Update view/theme/vier/config.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2022-10-21 10:25:42 +02:00
Philipp fad1763e28
Update view/theme/quattro/config.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2022-10-21 10:25:41 +02:00
Philipp ee71086133
UserSession class [7] - Refactor view/ files 2022-10-21 10:25:41 +02:00
Philipp 22198ea495
UserSession class [6] - Refactor src/Module/ files without DI 2022-10-21 10:25:07 +02:00
Philipp bf39b5a948
Fix messages.po issue 2022-10-21 10:19:13 +02:00
Hypolite Petovan f609386ca1
Merge pull request #12041 from nupplaphil/feat/usersession_Module
UserSession class [5] - Refactor src/Module/ files with DI
2022-10-20 20:32:54 -04:00
Hypolite Petovan 1235814b02
Merge pull request #12040 from nupplaphil/feat/usersession_Model
UserSession class [4] - Refactor src/Model/ files
2022-10-20 20:07:41 -04:00
Hypolite Petovan 5868e5ac90
Merge pull request #12044 from nupplaphil/bug/woordpecker_ci
Fix CI pipeline
2022-10-20 19:52:56 -04:00
Philipp dd1482d791
Fix CI pipeline 2022-10-21 00:49:38 +02:00
Hypolite Petovan 5985563149
Merge pull request #12038 from nupplaphil/feat/session_util_2
UserSession class [2] - Refactor mod/ files
2022-10-20 18:13:48 -04:00
Philipp eecc456e0c
UserSession class [5] - Refactor src/Module/ files with DI 2022-10-20 22:59:39 +02:00
Philipp b4ffb0bde0
UserSession class [4] - Refactor src/Model/ files 2022-10-20 22:14:50 +02:00
Philipp 8dda6144a9
Remove unnecessary "use" 2022-10-20 21:06:06 +02:00
Philipp bfe68702db
UserSession class [2] - Refactor mod/ files 2022-10-20 21:02:49 +02:00
Hypolite Petovan a729f3255d
Merge pull request #12021 from nupplaphil/feat/session_util
UserSession class [1] - Add class and tests
2022-10-20 14:54:42 -04:00
Philipp 7c4611af19
Update tests/src/Core/Session/UserSessionTest.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2022-10-20 20:47:43 +02:00
Philipp 0b66b6e0d5
Move Session "exists" and "expire" to new class 2022-10-20 20:27:35 +02:00
Philipp 940619325d
Add SessionUsers class including tests 2022-10-20 20:27:34 +02:00
Michael Vogel 66a4c30eb7
Merge pull request #12037 from MrPetovan/bug/blocklist-clobbered
Fix using wrong variable in DomainPatterBlocklist::extractFromCSVFile
2022-10-20 15:57:22 +02:00
Hypolite Petovan eaf1485c6f Fix using wrong variable in DomainPatterBlocklist::extractFromCSVFile
- This was clobbering the internal block list structure from an associative array to a simple list
2022-10-20 09:45:40 -04:00
Michael Vogel 92f1a4533b
Merge pull request #12036 from tobiasd/20221020-breakingnote
added a breaking note for custom addons to the CHANGELOG
2022-10-20 10:29:38 +02:00
Tobias Diekershoff ce64148c8d
Merge pull request #12034 from annando/no-include
Legacy "include" fragments have been removed
2022-10-20 09:57:38 +02:00
Tobias Diekershoff 5a21458ae9 added a breaking note for custom addons to the CHANGELOG
With the movement of all the function from the boot.php into fitting classes
custom addons will break (e.g. local_user() calls). The note in the CHANGELOG
should be a warning and a reminder for the release notes of 2022.12.
2022-10-20 09:46:59 +02:00
Michael 4930737cc4 Legacy "include" fragments have been removed 2022-10-20 04:21:00 +00:00
Hypolite Petovan 660912351c
Merge pull request #12033 from annando/no-boot
All references to boot.php are now removed
2022-10-19 16:53:51 -04:00
Michael d3e167c77c All references to boot.php are now removed 2022-10-19 20:38:25 +00:00
Hypolite Petovan 693db1b750
Merge pull request #12032 from annando/error
Fix Error: Uncaught Exception Error: "Class "Friendica\Content\Session" not found"
2022-10-19 15:20:07 -04:00
Michael cfbba97e0a Fix Error: Uncaught Exception Error: "Class "Friendica\Content\Session" not found" 2022-10-19 19:16:01 +00:00
Hypolite Petovan 5b2af862d4
Merge pull request #12028 from annando/no-boot-src-module-4
old boot.php functions replaced in src/module (4)
2022-10-19 09:48:29 -04:00
Michael 867e23054d Updated messages.po 2022-10-19 09:23:13 -04:00
Michael d47d78f2d4 old boot.php functions replaced in src/module (4) 2022-10-19 09:23:12 -04:00
Hypolite Petovan de6eabde58
Merge pull request #12027 from annando/no-boot-src-module-3
old boot.php functions replaced in src/module (3)
2022-10-19 09:22:41 -04:00
Hypolite Petovan 956f196f7c Align pConfig calls in Module\Settings\Display 2022-10-19 09:20:48 -04:00
Hypolite Petovan 979e226d27 Suppress repetitive "missing cache key ping:events:XX" when there are no upcoming events 2022-10-19 09:17:28 -04:00
Michael ae6d67ed1f old boot.php functions replaced in src/module (3) 2022-10-19 09:14:24 -04:00
Hypolite Petovan 83390d4b00
Merge pull request #12026 from annando/no-boot-src-module-2
old boot.php functions replaced in src/module (2)
2022-10-19 09:13:45 -04:00
Michael c9f17e1ef5 old boot.php functions replaced in src/module (2) 2022-10-19 09:06:09 -04:00
Hypolite Petovan b36d4eb0dd
Merge pull request #12025 from annando/no-boot-src-module
old boot.php functions replaced in src/module
2022-10-19 09:03:20 -04:00
Hypolite Petovan 47d9f91009 Add missing use statements in modules classes 2022-10-19 09:02:53 -04:00
Michael d2da2492b7 old boot.php functions replaced in src/module 2022-10-19 08:53:45 -04:00
Hypolite Petovan ba9f145ef7
Merge pull request #12024 from annando/no-boot-src-1
old boot.php functions replaced in varous placed under /src
2022-10-19 08:05:56 -04:00
Hypolite Petovan 058abc0336
Simplify boolean statements in Content\Conversation 2022-10-19 08:05:31 -04:00
Michael ee1acba9eb old boot.php functions replaced in /src 2022-10-19 07:56:25 -04:00
Hypolite Petovan 7fc37832f7
Merge pull request #12022 from annando/no-boot-various
old boot.php functions replaced in various places
2022-10-19 07:50:42 -04:00
Hypolite Petovan 429b2e0992
Apply code standards in documentation 2022-10-19 07:50:28 -04:00
Michael 11944dda32 old boot.php functions replaced in various places 2022-10-19 07:44:08 -04:00
Hypolite Petovan c54bfd423a
Merge pull request #12020 from annando/no-boot
old boot.php functions replaced in /mod
2022-10-19 07:42:48 -04:00
Tobias Diekershoff 95fe66e0b9
Merge pull request #12030 from nupplaphil/bug/error
Fix ERROR IHandleSessions
2022-10-19 08:18:05 +02:00
Philipp 692566d93b
Fix ERROR IHandleSessions 2022-10-19 08:07:12 +02:00
Tobias Diekershoff d8fe8b1e8b
Merge pull request #12029 from annando/warning
Suppress warning on load check
2022-10-19 07:51:24 +02:00
Michael 196dda9487 Suppress warning on load check 2022-10-19 04:49:57 +00:00
Michael 5874de4743 old boot.functions replaced in /mod 2022-10-19 04:14:42 +00:00
Hypolite Petovan 69b13155f9
Merge pull request #12019 from tobiasd/20221018-fr
FR translation update THX Nicolas Derive
2022-10-18 17:00:54 -04:00
Tobias Diekershoff f4dbd69e0e FR translation update THX Nicolas Derive 2022-10-18 22:18:01 +02:00
Hypolite Petovan d369f1e1e0
Merge pull request #12018 from nupplaphil/feat/session_util
Replace Core\Session functions with DI::session methods
2022-10-18 15:45:14 -04:00
Philipp 4a2f67aa9a
Move Core\Session::clear() to DI::session()->clear() 2022-10-18 21:13:58 +02:00
Philipp a2eb0c7378
Move Core\Session::remove() to DI::session()->remove() 2022-10-18 21:13:28 +02:00
Philipp 315ed3ed22
Remove unused Core\Session::setMultiple() 2022-10-18 21:12:48 +02:00
Philipp 3a8bcb3fbf
Move Core\Session::set() to DI::session()->set() 2022-10-18 21:12:23 +02:00
Philipp dfb5792773
Remove unused Core\Session::pop() method 2022-10-18 21:11:19 +02:00
Philipp fb2b2f5c58
Remove unused Core\Session::create() method 2022-10-18 21:11:00 +02:00
Philipp 7ac86e49d1
Move Core\Session::get() to DI::session()->get() 2022-10-18 21:10:37 +02:00
Hypolite Petovan 99d5441007
Merge pull request #12017 from annando/gravity
Fix errors introduced by PR #11997
2022-10-18 14:47:13 -04:00
Michael ae82737445 Fix errors introduced by PR #11997 2022-10-18 18:32:20 +00:00
Hypolite Petovan f3abef0979
Merge pull request #11996 from Quix0r/fixes/get-relative-time-null-parameter
Fixed: "Argument 1 passed to Friendica\Util\Temporal::getRelativeDate() must be of the type string, null given"
2022-10-18 12:33:51 -04:00
Roland Häder c36da392f8
Changed:
- re-added `null` again https://github.com/friendica/friendica/pull/11900#discussion_r979248182
- removed null coalescing operator
2022-10-18 18:21:45 +02:00
Roland Häder 2773ac9909
Changed according feedback:
- $posted_date should not allow NULL, instead use `?? ''` instead
- this happened in e.g. 2FA app-specific password listing
2022-10-18 17:47:15 +02:00
Roland Häder 66b9cace9f
Changed:
- first parameter can be null
2022-10-18 17:47:15 +02:00
Hypolite Petovan bbe05f523f
Merge pull request #11997 from Quix0r/rewrite/gravity-constants
Moved GRAVITY_* constants to Item model class
2022-10-18 11:31:51 -04:00
Roland Häder 54d3d03252
Ops, code-convention not followed 2022-10-18 16:34:45 +02:00
Roland Häder 26e0469de7
Merge branch 'develop' into rewrite/gravity-constants 2022-10-18 16:34:40 +02:00
Roland Häder abe02a646c
Added missing use statement (again), thanks to @MrPetovan
Yes, we need more unit-testing! Not only to rely on your IDE that it will locate
it for you.
2022-10-18 16:26:35 +02:00
Roland Häder 3a2f5091d9
Added missing use statement, thanks to @MrPetovan 2022-10-18 16:20:21 +02:00
Hypolite Petovan 33a7260c35
Merge pull request #12016 from annando/no-eol
The EOL constant is removed
2022-10-18 10:16:12 -04:00
Michael 6f68679375 The EOL constant is removed 2022-10-18 12:29:50 +00:00
Hypolite Petovan abf52c0c11
Merge pull request #12012 from nupplaphil/feat/move_monolog
Move Monolog to Addons
2022-10-18 07:31:59 -04:00
Hypolite Petovan ab9b60b9d2
Merge pull request #12014 from annando/usertosession
The user related functions moved to the session class
2022-10-18 07:30:21 -04:00
Tobias Diekershoff 27376a3dae
Merge pull request #12015 from annando/proc-access
Check the readability before acessing /proc/loadavg
2022-10-18 11:14:19 +02:00
Michael d43122c6d8 Check the readability before acessing /proc/loadavg 2022-10-18 08:02:55 +00:00
Michael Vogel 810ea228f0
Apply suggestions from code review
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2022-10-18 07:57:59 +02:00
Michael 27e9f2b223 SIGTERM moved 2022-10-18 04:35:06 +00:00
Michael 33ac39c335 The user related functions moved to the session class 2022-10-17 21:11:00 +00:00
Philipp 497fc4e432
Move Monolog to Addons 2022-10-17 22:22:00 +02:00
Hypolite Petovan e198edf652
Merge pull request #12010 from annando/notice
Notice and Info is moved
2022-10-17 15:13:07 -04:00
Michael fdfa1f8630 The notice and info have been moved 2022-10-17 18:55:22 +00:00
Michael 20291ddc2b Merge remote-tracking branch 'upstream/develop' into notice 2022-10-17 13:32:10 +00:00
Philipp 8c084fedad
Merge pull request #12007 from annando/more-constants
The friendica constants have been moved to the app class
2022-10-17 14:27:59 +02:00
Michael e96fd5166a Fix wrong constant 2022-10-17 11:28:54 +00:00
Michael 4ff7c37f85 Replace "notice" calls 2022-10-17 11:27:32 +00:00
Michael 62a0d55fc8 The friendica constants have been moved to the app class 2022-10-17 10:37:48 +00:00
Tobias Diekershoff 54951b7be6
Merge pull request #12006 from annando/constants
Some more constants are moved to their specific classes
2022-10-17 11:42:13 +02:00
Michael b1de40cb42 Updated messages.po 2022-10-17 09:33:29 +00:00
Michael 9bac8153ae Some more constants are moved to their specific classes 2022-10-17 09:24:32 +00:00
Michael Vogel 66b0d5e847
Merge pull request #12005 from tobiasd/20221017-de
DE translation update
2022-10-17 08:30:32 +02:00
Tobias Diekershoff a994b76ebc DE translation update 2022-10-17 08:27:48 +02:00
Tobias Diekershoff 3a158d00eb
Merge pull request #12004 from annando/priorities
The priority is now a class constant
2022-10-17 08:00:14 +02:00
Michael 018858934b The priority is now a class constant 2022-10-17 05:49:55 +00:00
Hypolite Petovan b33b70f0ab
Merge pull request #12003 from annando/linked-posts
Detect linked posts and add them as quote
2022-10-16 20:04:56 -04:00
Michael 9ffa053c90 Merge remote-tracking branch 'upstream/develop' into linked-posts 2022-10-16 21:51:26 +00:00
Michael Vogel f371095d3a
Merge pull request #12002 from MrPetovan/task/11941-compose-setting
[frio] Add new frio.always_open_compose setting
2022-10-16 23:50:37 +02:00
Michael b4661b35fd Improved database.sql 2022-10-16 21:43:48 +00:00
Michael f8f0dfa91a Detect linked posts and add them as quote 2022-10-16 21:37:05 +00:00
Hypolite Petovan bcc1350f1d Updated main translation file after adding strings 2022-10-16 13:21:43 -04:00
Hypolite Petovan e556dc3c31 Add new frio.always_open_compose setting
- This setting allows the New Post button to always open the Compose page instead of the modal by default
2022-10-16 11:49:27 -04:00
Hypolite Petovan d826fe0a3b Refactor files related to the Compose page and frio theme settings
- Use dependencies instead of most DI calls in Module\Item\Compose
- Group translation strings in a subkey of the template variables array
- Rewrite array initializations in theme/frio/config
2022-10-16 11:48:28 -04:00
Hypolite Petovan 7e06127d74
Merge pull request #12001 from tobiasd/20221016-docsmysql
[docs] note the preference of MariaDB over other MySQL implementation…
2022-10-16 08:38:58 -04:00
Tobias Diekershoff a192e099ab [docs] note the preference of MariaDB over other MySQL implementation in the install docs 2022-10-16 10:14:18 +02:00
Hypolite Petovan d6fe212a49
Merge pull request #12000 from tobiasd/20221015-vagrant
updates to the vagrant VM provision and config
2022-10-15 12:23:37 -04:00
Tobias Diekershoff 9383d7849b adopt IP change in the Vagrant docs 2022-10-15 17:33:47 +02:00
Tobias Diekershoff 49ed627aed change IP of Vagrant VM 2022-10-15 17:31:57 +02:00
Hypolite Petovan 1585f711ee
Merge pull request #11999 from annando/quote-uri-id
Improve quote generation
2022-10-15 09:11:22 -04:00
Michael 8e1af9277a Improve quite generation 2022-10-15 13:00:52 +00:00
Hypolite Petovan f71a5b20e5
Merge pull request #11995 from annando/quote-uri-id
New field "quote-uri-id" for quoted posts
2022-10-15 08:51:24 -04:00
Tobias Diekershoff f862d73f49 added PHP GMP module to the installation section of the Vagrant VM provision 2022-10-15 09:25:11 +02:00
Michael 34c3f189fc Updated database.sql and messages.po 2022-10-14 22:48:03 +00:00
Roland Häder 1f9fc13d03
Rewrites:
From:
````
<?php
$arr = [];
$arr['foo'] = "FOO";
````

To:
````
<?php
$arr['foo'] = "FOO";
````
2022-10-15 00:44:37 +02:00
Roland Häder ebf3b7e62d
Changes:
- Content\Item versus Model\Item solved (?)
2022-10-15 00:44:07 +02:00
Roland Häder 85ed0742cf
Fixed:
- Content\Item versus Model\Item is really confusing!
2022-10-15 00:44:07 +02:00
Roland Häder 8f92d1cc8e
Changes:
- unified class import, we had these both:

````
use Friendica\Model\Item as ModelItem;
use Friendica\Object\Post as PostObject;
````

In first version the namespace was prefixing class name, in second suffixing it.
2022-10-15 00:44:07 +02:00
Roland Häder da66730e4f
Rewrite:
- moved constants GRAVITY_* from boot.php to Friendica\Model\Item
- also rewrote some array initialization:

From:
````
<?php
$arr = [];
$arr['foo'] = "FOO";
````

To:
````
<?php
$arr['foo'] = "FOO";
````
- added a few type-hints
2022-10-15 00:44:06 +02:00
Michael 1cf66ba0cc Merge remote-tracking branch 'upstream/develop' into quote-uri-id 2022-10-14 22:03:32 +00:00
Michael 3e868416c7 Check for post existence 2022-10-14 22:02:25 +00:00
Michael 88aceeb27f Merge remote-tracking branch 'upstream/2022.09-rc' into quote-uri-id 2022-10-14 19:11:15 +00:00
Tobias Diekershoff e5ae5c7e67 renewed the expiration date for the security.txt file 2022-10-14 20:54:05 +02:00
Tobias Diekershoff 5a800e2d09 prepare the CHANGELOG for 2022.12 2022-10-14 20:52:58 +02:00
Tobias Diekershoff b5d3651f3f bump version to 2022.12-dev 2022-10-14 20:52:38 +02:00
Michael a67a364b91 Merge remote-tracking branch 'upstream/2022.09-rc' into quote-uri-id 2022-10-11 05:19:21 +00:00
Michael aeb4645ba6 New field "quote-uri-id" for quoted posts 2022-10-10 22:39:30 +00:00
752 changed files with 47493 additions and 38840 deletions

258
.ddev/config.yaml Normal file
View File

@ -0,0 +1,258 @@
name: my-friendica
type: php
docroot: ""
php_version: "7.3"
webserver_type: apache-fpm
router_http_port: "80"
router_https_port: "443"
xdebug_enabled: false
additional_hostnames: []
additional_fqdns: []
database:
type: mariadb
version: "10.4"
nfs_mount_enabled: false
mutagen_enabled: false
use_dns_when_possible: true
composer_version: "1"
web_environment: []
nodejs_version: "16"
webimage_extra_packages: [php7.3-gmp]
# Key features of ddev's config.yaml:
# name: <projectname> # Name of the project, automatically provides
# http://projectname.ddev.site and https://projectname.ddev.site
# type: <projecttype> # drupal6/7/8, backdrop, typo3, wordpress, php
# docroot: <relative_path> # Relative path to the directory containing index.php.
# php_version: "7.4" # PHP version to use, "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2"
# You can explicitly specify the webimage but this
# is not recommended, as the images are often closely tied to ddev's' behavior,
# so this can break upgrades.
# webimage: <docker_image> # nginx/php docker image.
# database:
# type: <dbtype> # mysql, mariadb
# version: <version> # database version, like "10.3" or "8.0"
# Note that mariadb_version or mysql_version from v1.18 and earlier
# will automatically be converted to this notation with just a "ddev config --auto"
# router_http_port: <port> # Port to be used for http (defaults to port 80)
# router_https_port: <port> # Port for https (defaults to 443)
# xdebug_enabled: false # Set to true to enable xdebug and "ddev start" or "ddev restart"
# Note that for most people the commands
# "ddev xdebug" to enable xdebug and "ddev xdebug off" to disable it work better,
# as leaving xdebug enabled all the time is a big performance hit.
# xhprof_enabled: false # Set to true to enable xhprof and "ddev start" or "ddev restart"
# Note that for most people the commands
# "ddev xhprof" to enable xhprof and "ddev xhprof off" to disable it work better,
# as leaving xhprof enabled all the time is a big performance hit.
# webserver_type: nginx-fpm # or apache-fpm
# timezone: Europe/Berlin
# This is the timezone used in the containers and by PHP;
# it can be set to any valid timezone,
# see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
# For example Europe/Dublin or MST7MDT
# composer_root: <relative_path>
# Relative path to the composer root directory from the project root. This is
# the directory which contains the composer.json and where all Composer related
# commands are executed.
# composer_version: "2"
# You can set it to "" or "2" (default) for Composer v2 or "1" for Composer v1
# to use the latest major version available at the time your container is built.
# It is also possible to use each other Composer version channel. This includes:
# - 2.2 (latest Composer LTS version)
# - stable
# - preview
# - snapshot
# Alternatively, an explicit Composer version may be specified, for example "2.2.18".
# To reinstall Composer after the image was built, run "ddev debug refresh".
# nodejs_version: "16"
# change from the default system Node.js version to another supported version, like 12, 14, 17, 18.
# Note that you can use 'ddev nvm' or nvm inside the web container to provide nearly any
# Node.js version, including v6, etc.
# additional_hostnames:
# - somename
# - someothername
# would provide http and https URLs for "somename.ddev.site"
# and "someothername.ddev.site".
# additional_fqdns:
# - example.com
# - sub1.example.com
# would provide http and https URLs for "example.com" and "sub1.example.com"
# Please take care with this because it can cause great confusion.
# upload_dir: custom/upload/dir
# would set the destination path for ddev import-files to <docroot>/custom/upload/dir
# When mutagen is enabled this path is bind-mounted so that all the files
# in the upload_dir don't have to be synced into mutagen
# working_dir:
# web: /var/www/html
# db: /home
# would set the default working directory for the web and db services.
# These values specify the destination directory for ddev ssh and the
# directory in which commands passed into ddev exec are run.
# omit_containers: [db, dba, ddev-ssh-agent]
# Currently only these containers are supported. Some containers can also be
# omitted globally in the ~/.ddev/global_config.yaml. Note that if you omit
# the "db" container, several standard features of ddev that access the
# database container will be unusable. In the global configuration it is also
# possible to omit ddev-router, but not here.
# nfs_mount_enabled: false
# Great performance improvement but requires host configuration first.
# See https://ddev.readthedocs.io/en/latest/users/install/performance/#nfs
# mutagen_enabled: false
# Performance improvement using mutagen asynchronous updates.
# See https://ddev.readthedocs.io/en/latest/users/install/performance/#mutagen
# fail_on_hook_fail: False
# Decide whether 'ddev start' should be interrupted by a failing hook
# host_https_port: "59002"
# The host port binding for https can be explicitly specified. It is
# dynamic unless otherwise specified.
# This is not used by most people, most people use the *router* instead
# of the localhost port.
# host_webserver_port: "59001"
# The host port binding for the ddev-webserver can be explicitly specified. It is
# dynamic unless otherwise specified.
# This is not used by most people, most people use the *router* instead
# of the localhost port.
# host_db_port: "59002"
# The host port binding for the ddev-dbserver can be explicitly specified. It is dynamic
# unless explicitly specified.
# phpmyadmin_port: "8036"
# phpmyadmin_https_port: "8037"
# The PHPMyAdmin ports can be changed from the default 8036 and 8037
# host_phpmyadmin_port: "8036"
# The phpmyadmin (dba) port is not normally bound on the host at all, instead being routed
# through ddev-router, but it can be specified and bound.
# mailhog_port: "8025"
# mailhog_https_port: "8026"
# The MailHog ports can be changed from the default 8025 and 8026
# host_mailhog_port: "8025"
# The mailhog port is not normally bound on the host at all, instead being routed
# through ddev-router, but it can be bound directly to localhost if specified here.
# webimage_extra_packages: [php7.4-tidy, php-bcmath]
# Extra Debian packages that are needed in the webimage can be added here
# dbimage_extra_packages: [telnet,netcat]
# Extra Debian packages that are needed in the dbimage can be added here
# use_dns_when_possible: true
# If the host has internet access and the domain configured can
# successfully be looked up, DNS will be used for hostname resolution
# instead of editing /etc/hosts
# Defaults to true
# project_tld: ddev.site
# The top-level domain used for project URLs
# The default "ddev.site" allows DNS lookup via a wildcard
# If you prefer you can change this to "ddev.local" to preserve
# pre-v1.9 behavior.
# ngrok_args: --basic-auth username:pass1234
# Provide extra flags to the "ngrok http" command, see
# https://ngrok.com/docs#http or run "ngrok http -h"
# disable_settings_management: false
# If true, ddev will not create CMS-specific settings files like
# Drupal's settings.php/settings.ddev.php or TYPO3's AdditionalConfiguration.php
# In this case the user must provide all such settings.
# You can inject environment variables into the web container with:
# web_environment:
# - SOMEENV=somevalue
# - SOMEOTHERENV=someothervalue
# no_project_mount: false
# (Experimental) If true, ddev will not mount the project into the web container;
# the user is responsible for mounting it manually or via a script.
# This is to enable experimentation with alternate file mounting strategies.
# For advanced users only!
# bind_all_interfaces: false
# If true, host ports will be bound on all network interfaces,
# not just the localhost interface. This means that ports
# will be available on the local network if the host firewall
# allows it.
# default_container_timeout: 120
# The default time that ddev waits for all containers to become ready can be increased from
# the default 120. This helps in importing huge databases, for example.
#web_extra_exposed_ports:
#- name: nodejs
# container_port: 3000
# http_port: 2999
# https_port: 3000
#- name: something
# container_port: 4000
# https_port: 4000
# http_port: 3999
# Allows a set of extra ports to be exposed via ddev-router
# The port behavior on the ddev-webserver must be arranged separately, for example
# using web_extra_daemons.
# For example, with a web app on port 3000 inside the container, this config would
# expose that web app on https://<project>.ddev.site:9999 and http://<project>.ddev.site:9998
# web_extra_exposed_ports:
# - container_port: 3000
# http_port: 9998
# https_port: 9999
#web_extra_daemons:
#- name: "http-1"
# command: "/var/www/html/node_modules/.bin/http-server -p 3000"
# directory: /var/www/html
#- name: "http-2"
# command: "/var/www/html/node_modules/.bin/http-server /var/www/html/sub -p 3000"
# directory: /var/www/html
# override_config: false
# By default, config.*.yaml files are *merged* into the configuration
# But this means that some things can't be overridden
# For example, if you have 'nfs_mount_enabled: true'' you can't override it with a merge
# and you can't erase existing hooks or all environment variables.
# However, with "override_config: true" in a particular config.*.yaml file,
# 'nfs_mount_enabled: false' can override the existing values, and
# hooks:
# post-start: []
# or
# web_environment: []
# or
# additional_hostnames: []
# can have their intended affect. 'override_config' affects only behavior of the
# config.*.yaml file it exists in.
# Many ddev commands can be extended to run tasks before or after the
# ddev command is executed, for example "post-start", "post-import-db",
# "pre-composer", "post-composer"
# See https://ddev.readthedocs.io/en/stable/users/extend/custom-commands/ for more
# information on the commands that can be extended and the tasks you can define
# for them. Example:
#hooks:

7
.gitignore vendored
View File

@ -10,10 +10,9 @@ home.html
robots.txt
#ignore local config
/config/local.config.php
/config/addon.config.php
/config/local.ini.php
/config/addon.ini.php
!/config/local-sample.config.php
/config/*.config.php
/config/*.ini.php
#ignore documentation, it should be newly built
/doc/api

View File

@ -51,6 +51,6 @@ AddType audio/ogg .oga
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?pagename=$1 [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]
RewriteRule ^(.*)$ index.php?pagename=$1 [E=REMOTE_USER:%{HTTP:Authorization},L,QSA,B]
</IfModule>

View File

@ -39,7 +39,7 @@ pipeline:
branch: [ develop, '*-rc' ]
event: push
composer_install:
image: friendicaci/php7.4:php7.4.18
image: friendicaci/php7.4:php7.4.33
commands:
- export COMPOSER_HOME=.composer
- composer validate

View File

@ -1,7 +1,7 @@
matrix:
include:
- PHP_MAJOR_VERSION: 7.4
PHP_VERSION: 7.4.18
PHP_VERSION: 7.4.33
branches:
exclude: [ stable ]

View File

@ -1,11 +1,17 @@
matrix:
include:
- PHP_MAJOR_VERSION: 7.3
PHP_VERSION: 7.3.28
PHP_VERSION: 7.3.33
- PHP_MAJOR_VERSION: 7.4
PHP_VERSION: 7.4.18
PHP_VERSION: 7.4.33
- PHP_MAJOR_VERSION: 8.0
PHP_VERSION: 8.0.5
PHP_VERSION: 8.0.25
- PHP_MAJOR_VERSION: 8.1
PHP_VERSION: 8.1.12
# This forces PHP Unit executions at the "opensocial" labeled location (because of much more power...)
labels:
location: opensocial
pipeline:
php-lint:

View File

@ -37,7 +37,7 @@ pipeline:
branch: stable
event: tag
composer_install:
image: friendicaci/php7.4:php7.4.18
image: friendicaci/php7.4:php7.4.33
commands:
- export COMPOSER_HOME=.composer
- composer validate

View File

@ -1,3 +1,70 @@
Version 2022.12 (2022-12-20)
Friendica Core
Updates to the translations DE, FR, HU, PL, RU
Updated to the documentation [foss-, MarekBenjamin, MrPetovan, tobiasd]
Updates to the themes (frio, vier) [loma-one, MarekBenjamin, MrPetovan, tobiasd]
Improved the display of the system settings in the admin panel [MarekBenjamin]
Improved the API [annando, HankG, Schnoop]
Improved getting system information [VVelox]
Improved the PHP 8.1 compatibility [MrPetovan]
Improved the bulk delivery of postings [annando]
Improved the display of attached images to postings [MarekBenjamin]
General code cleanup [annando, MrPetovan, nupplaphil, Quix0r]
Added a blur hash for images else not displayable [annando]
Added a /about route for the /friendica page [nupplaphil]
Added reporting endpoints to the API [annando]
Added support for the "fedifinder" [annando]
Added rel-me verification for the profile homepage [tobiasd]
Added admin notification for new registrations [annando]
Added a moderation section to the admin panel [annando]
Added an option to make the calendar public [matthiasmoritz]
Fixed a bug in the federation with Diaspora* [annando]
Fixec a problem in the federation with GoTo Social and Owncast [annando]
Deprecated old themes (duepuntozero, quattro, smoothy)
NOTE: The Apache2 rewrite rule in the .htaccess-dist has been changed.
The change has to be applied manually to the existing .htaccess.
Friendica Addons
Updates to the translations DE, FR, HU, SV
fancybox:
Added an addon to display images in postings with a fancybox [brockhaus]
impressum:
Fixed a bug when saving informations [tobiasd]
js_upload:
Improved wording [MarekBenjamin]
monolog:
Moved the functionality into an addon [nupplaphil]
nitter:
Updated the wording [AndyHee]
nsfw:
Enhanced regex handling [MrPetovan]
pumpio:
Fixed logger message [MrPetovan]
rendertime:
Fixed empty minimal time [nupplaphil]
Adapt ignored_modules [nupplaphil]
twitter:
Fixed a problem when the image array was missing [MrPetovan]
Added an option to automatically follow contacts in the Fediverse [annando]
Deprecated unmaintained addons: namethingy, superblock, windowsphonepush
BREAKING: The functions from the boot.php file have been moved into better
fitting classes this may break your custom addons. See the pull
requests #1293 and #1294 in the addon repository about the needed
changes to your addons.
Closed Issues
5095, 7574, 9286, 9920, 10100, 10188, 10518, 10875, 11011, 11284,
11553, 11774, 11804, 11875, 11911, 11941, 11998, 12009, 12013, 12023,
12035, 12054, 12059, 12073, 12084, 12085, 12090, 12096, 12112, 12149,
12163, 12182, 12191, 12192, 12193, 12197, 12199, 12201, 12219, 12220,
12229, 12237, 12245, 12262, 12266, 12273, 12275, 12285, 12312, 12327,
12338, 12339, 12342, 12344, 12345, 12355, 12373, 12376, 12382, 12386,
12399, 12401, 12405, 12406, 12408, 12411, 12413, 12421, 12431, 12437,
12441, 12448, 12450, 12456, 12466, 12468, 12476
Version 2022.10 (2022-10-14)
Friendica Core
Added GD translation, updates to the translations AR, DE, FR, HU, PL, SV, ZH CN

View File

@ -38,6 +38,7 @@ aweiher
axelt
balderino
Balázs Úr
Bartosz Małkowski
Beanow
beardyunixer
Beatriz Vital
@ -108,7 +109,7 @@ Filip Bugaj
Filip H.F. "FiXato" Slagter
Finn Dean
FlxAlbroscheit
foss
foss-
Francesco Apruzzese
Frank Dieckmann
Frederico Gonçalves Guimarães
@ -119,7 +120,9 @@ Gidi Kroon
GLComo
greeneyedred
Gregory Smith
Grischa Brockhaus
gudzpoz
GunChleoc
guzzisti
Haakon Meland Eriksen
Hank Grabowski
@ -164,6 +167,7 @@ Koyu Berteon
kPherox
Kris
Kristoffer Grundström
KulikAlex
Lea1995polish
Leberwurscht
Leonard Lausen
@ -175,10 +179,12 @@ Ludovic Grossard
Lynn Stephenson
maase2
Mai Anh Nguyen
Makary
Manuel Pérez Monís
Marcin Klessa
Marcin Mikołajczak
Marcus Müller
Marek Bachmann
Marie Olive
Mariusz Pisz
marmor
@ -216,6 +222,7 @@ pankraz
Paolo Wave
Pascal
Pascal Deklerck
Paul Saunders
Pavel Morozov
PerigGouanvic
peter
@ -251,11 +258,13 @@ RJ Madsen
Roger Meyer
Roland Häder
rwa
Ryan Voots
S.Krumbholz
Sakałoŭ Alaksiej
Sam
Samuli Valavuo
Sandro Santilli
Schnoop
Sebastian Egbers
sella
Senex Petrovic
@ -287,6 +296,7 @@ teho
Thecross
Thomas
Thomas Willingham
Thorsten
thorsten23
Till Mohr
Tim Stahel
@ -318,7 +328,6 @@ very-ape
Viktor Nilsson
Vinzenz Vietzke
vislav
vladimir N
Vladimir Núñez
VVelox
Vít Šesták 'v6ak'

View File

@ -1,4 +1,4 @@
INPUT = README.md index.php boot.php update.php bin/ mod/ include/ view/ src/ VERSION
INPUT = README.md index.php update.php bin/ mod/ view/ src/ VERSION
RECURSIVE = YES
PROJECT_NAME = "Friendica"
PROJECT_LOGO = images/friendica-64.png

View File

@ -9,7 +9,7 @@ Our mission is to free friends, family and colleagues from data-harvesting corpo
Friendica connects you effortlessly to a federated communications network of several thousand servers, with more than half a million user registrations. You can directly connect to anyone on [Friendica]( https://friendi.ca), [Mastodon](https://joinmastodon.org/), [Diaspora](https://diasporafoundation.org/), [GnuSocial](https://gnu.io/social/), [Pleroma](https://pleroma.social/), or [Hubzilla](https://hubzilla.org/), regardless where each user profile is hosted.
With Friendica, you can also fully interact with anyone on Twitter, post on Facebook and receive any content on Tumblr, Wordpress or RSS. Friendica allows you to integrate most things on the web via a range of addons such as ITTT, Buffer; you will be able to easily control your own data as you decide.
With Friendica, you can also fully interact with anyone on Twitter and receive any content from Tumblr, Wordpress or RSS. Friendica allows you to integrate most things on the web via a range of addons such as ITTT, Buffer; you will be able to easily control your own data as you decide.
Join today and [get your Friendica profile!](https://dir.friendica.social/servers 'Join Friendica today!')

View File

@ -1 +1 @@
2022.10
2022.12

2
Vagrantfile vendored
View File

@ -1,5 +1,5 @@
server_ip = "192.168.22.10"
server_ip = "192.168.56.10"
server_memory = "2048" # MB
server_timezone = "UTC"

View File

@ -26,6 +26,7 @@ if (php_sapi_name() !== 'cli') {
}
use Dice\Dice;
use Friendica\DI;
use Psr\Log\LoggerInterface;
require dirname(__DIR__) . '/vendor/autoload.php';
@ -33,6 +34,8 @@ require dirname(__DIR__) . '/vendor/autoload.php';
$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php');
$dice = $dice->addRule(LoggerInterface::class,['constructParams' => ['console']]);
/// @fixme Necessary until Hooks inside the Logger can get loaded without the DI-class
DI::init($dice);
\Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class));
(new Friendica\Core\Console($dice, $argv))->execute();

View File

@ -45,7 +45,7 @@ $longopts = ['foreground'];
$options = getopt($shortopts, $longopts);
// Ensure that daemon.php is executed from the base path of the installation
if (!file_exists('boot.php') && (sizeof($_SERVER['argv']) != 0)) {
if (!file_exists('index.php') && (sizeof($_SERVER['argv']) != 0)) {
$directory = dirname($_SERVER['argv'][0]);
if (substr($directory, 0, 1) != '/') {

View File

@ -45,13 +45,13 @@ apt-get install -qq apache2
a2enmod rewrite actions ssl
cp /vagrant/bin/dev/vagrant_vhost.sh /usr/local/bin/vhost
chmod guo+x /usr/local/bin/vhost
vhost -s 192.168.22.10.xip.io -d /var/www -p /etc/ssl/xip.io -c xip.io -a friendica.local
vhost -s 192.168.56.10.xip.io -d /var/www -p /etc/ssl/xip.io -c xip.io -a friendica.local
a2dissite 000-default
service apache2 restart
#Install php
echo ">>> Installing PHP7"
apt-get install -qq php libapache2-mod-php php-cli php-mysql php-curl php-gd php-mbstring php-xml imagemagick php-imagick php-zip
apt-get install -qq php libapache2-mod-php php-cli php-mysql php-curl php-gd php-mbstring php-xml imagemagick php-imagick php-zip php-gmp
systemctl restart apache2
echo ">>> Installing PHP8"
@ -59,7 +59,7 @@ apt-get install -qq -y lsb-release ca-certificates apt-transport-https software-
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/sury-php.list
wget -qO - https://packages.sury.org/php/apt.gpg | sudo apt-key add -
apt update
apt-get install -qq php8.0 php8.0-cli php8.0-mysql php8.0-curl php8.0-gd php8.0-mbstring php8.0-xml php8.0-imagick php8.0-zip
apt-get install -qq php8.0 php8.0-cli php8.0-mysql php8.0-curl php8.0-gd php8.0-mbstring php8.0-xml php8.0-imagick php8.0-zip php8.0-gmp
systemctl restart apache2
#Install mysql

View File

@ -40,7 +40,7 @@ $longopts = ['spawn', 'no_cron'];
$options = getopt($shortopts, $longopts);
// Ensure that worker.php is executed from the base path of the installation
if (!file_exists("boot.php") && (sizeof($_SERVER["argv"]) != 0)) {
if (!file_exists("index.php") && (sizeof($_SERVER["argv"]) != 0)) {
$directory = dirname($_SERVER["argv"][0]);
if (substr($directory, 0, 1) != '/') {

194
boot.php
View File

@ -1,194 +0,0 @@
<?php
/**
* @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* Friendica is a communications platform for integrated social communications
* utilising decentralised communications and linkage to several indie social
* projects - as well as popular mainstream providers.
*
* Our mission is to free our friends and families from the clutches of
* data-harvesting corporations, and pave the way to a future where social
* communications are free and open and flow between alternate providers as
* easily as email does today.
*/
use Friendica\Model\Contact;
define('FRIENDICA_PLATFORM', 'Friendica');
define('FRIENDICA_CODENAME', 'Giant Rhubarb');
define('FRIENDICA_VERSION', '2022.10');
define('DFRN_PROTOCOL_VERSION', '2.23');
define('NEW_TABLE_STRUCTURE_VERSION', 1288);
/**
* Constant with a HTML line break.
*
* Contains a HTML line break (br) element and a real carriage return with line
* feed for the source.
* This can be used in HTML and JavaScript where needed a line break.
*/
define('EOL', "<br />\r\n");
/**
* @name CP
*
* Type of the community page
* @{
*/
define('CP_NO_INTERNAL_COMMUNITY', -2);
define('CP_NO_COMMUNITY_PAGE', -1);
define('CP_USERS_ON_SERVER', 0);
define('CP_GLOBAL_COMMUNITY', 1);
define('CP_USERS_AND_GLOBAL', 2);
/**
* @}
*/
/**
* @name Gravity
*
* Item weight for query ordering
* @{
*/
define('GRAVITY_PARENT', 0);
define('GRAVITY_ACTIVITY', 3);
define('GRAVITY_COMMENT', 6);
define('GRAVITY_UNKNOWN', 9);
/* @}*/
/**
* @name Priority
*
* Process priority for the worker
* @{
*/
define('PRIORITY_UNDEFINED', 0);
define('PRIORITY_CRITICAL', 10);
define('PRIORITY_HIGH', 20);
define('PRIORITY_MEDIUM', 30);
define('PRIORITY_LOW', 40);
define('PRIORITY_NEGLIGIBLE', 50);
define('PRIORITIES', [PRIORITY_CRITICAL, PRIORITY_HIGH, PRIORITY_MEDIUM, PRIORITY_LOW, PRIORITY_NEGLIGIBLE]);
/* @}*/
// Normally this constant is defined - but not if "pcntl" isn't installed
if (!defined('SIGTERM')) {
define('SIGTERM', 15);
}
/**
* Depending on the PHP version this constant does exist - or not.
* See here: http://php.net/manual/en/curl.constants.php#117928
*/
if (!defined('CURLE_OPERATION_TIMEDOUT')) {
define('CURLE_OPERATION_TIMEDOUT', CURLE_OPERATION_TIMEOUTED);
}
if (!function_exists('exif_imagetype')) {
function exif_imagetype($file)
{
$size = getimagesize($file);
return $size[2];
}
}
/**
* Returns the user id of locally logged in user or false.
*
* @return int|bool user id or false
*/
function local_user()
{
if (!empty($_SESSION['authenticated']) && !empty($_SESSION['uid'])) {
return intval($_SESSION['uid']);
}
return false;
}
/**
* Returns the public contact id of logged in user or false.
*
* @return int|bool public contact id or false
*/
function public_contact()
{
static $public_contact_id = false;
if (!$public_contact_id && !empty($_SESSION['authenticated'])) {
if (!empty($_SESSION['my_address'])) {
// Local user
$public_contact_id = intval(Contact::getIdForURL($_SESSION['my_address'], 0, false));
} elseif (!empty($_SESSION['visitor_home'])) {
// Remote user
$public_contact_id = intval(Contact::getIdForURL($_SESSION['visitor_home'], 0, false));
}
} elseif (empty($_SESSION['authenticated'])) {
$public_contact_id = false;
}
return $public_contact_id;
}
/**
* Returns public contact id of authenticated site visitor or false
*
* @return int|bool visitor_id or false
*/
function remote_user()
{
if (empty($_SESSION['authenticated'])) {
return false;
}
if (!empty($_SESSION['visitor_id'])) {
return intval($_SESSION['visitor_id']);
}
return false;
}
/**
* Show an error message to user.
*
* This function save text in session, to be shown to the user at next page load
*
* @param string $s - Text of notice
*
* @return void
* @deprecated since version 2022.09, use \Friendica\Navigation\SystemMessages instead
*/
function notice(string $s)
{
\Friendica\DI::sysmsg()->addNotice($s);
}
/**
* Show an info message to user.
*
* This function save text in session, to be shown to the user at next page load
*
* @param string $s - Text of notice
*
* @return void
* @deprecated since version 2022.09, use \Friendica\Navigation\SystemMessages instead
*/
function info(string $s)
{
\Friendica\DI::sysmsg()->addInfo($s);
}

View File

@ -41,15 +41,15 @@
"michelf/php-markdown": "^1.7",
"minishlink/web-push": "^6.0",
"mobiledetect/mobiledetectlib": "^2.8",
"monolog/monolog": "^1.25",
"nikic/fast-route": "^1.3",
"paragonie/hidden-string": "^1.0",
"patrickschur/language-detection": "^5.0.0",
"pear/console_table": "^1.3",
"phpseclib/phpseclib": "^2.0",
"phpseclib/phpseclib": "^3.0",
"pragmarx/google2fa": "^5.0",
"pragmarx/recovery": "^0.2",
"psr/container": "^1.0",
"psr/log": "^1.1",
"seld/cli-prompt": "^1.0",
"smarty/smarty": "^4",
"ua-parser/uap-php": "^3.9",
@ -59,7 +59,6 @@
"bower-asset/chart-js": "^2.8",
"bower-asset/dompurify": "^1.0",
"bower-asset/fork-awesome": "^1.1",
"bower-asset/vue": "^2.6",
"npm-asset/cropperjs": "1.2.2",
"npm-asset/es-jquery-sortable": "^0.9.13",
"npm-asset/fullcalendar": "^3.10",
@ -71,7 +70,9 @@
"npm-asset/moment": "^2.24",
"npm-asset/perfect-scrollbar": "0.6.16",
"npm-asset/textcomplete": "^0.18.2",
"npm-asset/typeahead.js": "^0.11.1"
"npm-asset/typeahead.js": "^0.11.1",
"kornrunner/blurhash": "^1.2",
"psr/clock": "^1.0"
},
"repositories": [
{
@ -83,10 +84,7 @@
"psr-4": {
"Friendica\\": "src/",
"Friendica\\Addon\\": "addon/"
},
"files": [
"boot.php"
]
}
},
"autoload-dev": {
"psr-4": {

212
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "f5922f03b367e68a5930df6ed80c5c2f",
"content-hash": "5af9ac9003f4653f3aa1860dd5a4d821",
"packages": [
{
"name": "asika/simple-console",
@ -241,22 +241,6 @@
],
"time": "2021-08-26T18:46:39+00:00"
},
{
"name": "bower-asset/vue",
"version": "v2.7.10",
"source": {
"type": "git",
"url": "https://github.com/vuejs/vue.git",
"reference": "ee57d9fd1d51abe245c6c37e6f8f2d45977b929e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/vuejs/vue/zipball/ee57d9fd1d51abe245c6c37e6f8f2d45977b929e",
"reference": "ee57d9fd1d51abe245c6c37e6f8f2d45977b929e",
"shasum": ""
},
"type": "bower-asset-library"
},
{
"name": "brick/math",
"version": "0.9.3",
@ -1132,6 +1116,50 @@
],
"time": "2022-06-20T21:43:03+00:00"
},
{
"name": "kornrunner/blurhash",
"version": "v1.2.2",
"source": {
"type": "git",
"url": "https://github.com/kornrunner/php-blurhash.git",
"reference": "bc8a4596cb0a49874f0158696a382ab3933fefe4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/kornrunner/php-blurhash/zipball/bc8a4596cb0a49874f0158696a382ab3933fefe4",
"reference": "bc8a4596cb0a49874f0158696a382ab3933fefe4",
"shasum": ""
},
"require": {
"php": "^7.3|^8.0"
},
"require-dev": {
"ext-gd": "*",
"ocramius/package-versions": "^1.4|^2.0",
"phpstan/phpstan": "^0.12",
"phpunit/phpunit": "^9",
"vimeo/psalm": "^4.3"
},
"type": "library",
"autoload": {
"psr-4": {
"kornrunner\\Blurhash\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Boris Momčilović",
"email": "boris.momcilovic@gmail.com"
}
],
"description": "Pure PHP implementation of Blurhash",
"homepage": "https://github.com/kornrunner/php-blurhash",
"time": "2022-07-13T19:38:39+00:00"
},
{
"name": "league/html-to-markdown",
"version": "4.10.0",
@ -1543,88 +1571,6 @@
],
"time": "2022-02-17T19:24:25+00:00"
},
{
"name": "monolog/monolog",
"version": "1.27.1",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/monolog.git",
"reference": "904713c5929655dc9b97288b69cfeedad610c9a1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/904713c5929655dc9b97288b69cfeedad610c9a1",
"reference": "904713c5929655dc9b97288b69cfeedad610c9a1",
"shasum": ""
},
"require": {
"php": ">=5.3.0",
"psr/log": "~1.0"
},
"provide": {
"psr/log-implementation": "1.0.0"
},
"require-dev": {
"aws/aws-sdk-php": "^2.4.9 || ^3.0",
"doctrine/couchdb": "~1.0@dev",
"graylog2/gelf-php": "~1.0",
"php-amqplib/php-amqplib": "~2.4",
"php-console/php-console": "^3.1.3",
"phpstan/phpstan": "^0.12.59",
"phpunit/phpunit": "~4.5",
"ruflin/elastica": ">=0.90 <3.0",
"sentry/sentry": "^0.13",
"swiftmailer/swiftmailer": "^5.3|^6.0"
},
"suggest": {
"aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB",
"doctrine/couchdb": "Allow sending log messages to a CouchDB server",
"ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)",
"ext-mongo": "Allow sending log messages to a MongoDB server",
"graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server",
"mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver",
"php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib",
"php-console/php-console": "Allow sending log messages to Google Chrome",
"rollbar/rollbar": "Allow sending log messages to Rollbar",
"ruflin/elastica": "Allow sending log messages to an Elastic Search server",
"sentry/sentry": "Allow sending log messages to a Sentry server"
},
"type": "library",
"autoload": {
"psr-4": {
"Monolog\\": "src/Monolog"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jordi Boggiano",
"email": "j.boggiano@seld.be",
"homepage": "http://seld.be"
}
],
"description": "Sends your logs to files, sockets, inboxes, databases and various web services",
"homepage": "http://github.com/Seldaek/monolog",
"keywords": [
"log",
"logging",
"psr-3"
],
"funding": [
{
"url": "https://github.com/Seldaek",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/monolog/monolog",
"type": "tidelift"
}
],
"time": "2022-06-09T08:53:42+00:00"
},
{
"name": "nikic/fast-route",
"version": "v1.3.0",
@ -3050,32 +2996,32 @@
},
{
"name": "phpseclib/phpseclib",
"version": "2.0.38",
"version": "3.0.17",
"source": {
"type": "git",
"url": "https://github.com/phpseclib/phpseclib.git",
"reference": "b03536539f43a4f9aa33c4f0b2f3a1c752088fcd"
"reference": "dbc2307d5c69aeb22db136c52e91130d7f2ca761"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/b03536539f43a4f9aa33c4f0b2f3a1c752088fcd",
"reference": "b03536539f43a4f9aa33c4f0b2f3a1c752088fcd",
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/dbc2307d5c69aeb22db136c52e91130d7f2ca761",
"reference": "dbc2307d5c69aeb22db136c52e91130d7f2ca761",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
"paragonie/constant_time_encoding": "^1|^2",
"paragonie/random_compat": "^1.4|^2.0|^9.99.99",
"php": ">=5.6.1"
},
"require-dev": {
"phing/phing": "~2.7",
"phpunit/phpunit": "^4.8.35|^5.7|^6.0|^9.4",
"squizlabs/php_codesniffer": "~2.0"
"phpunit/phpunit": "*"
},
"suggest": {
"ext-dom": "Install the DOM extension to load XML formatted public keys.",
"ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.",
"ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.",
"ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.",
"ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations.",
"ext-xml": "Install the XML extension to load XML formatted public keys."
"ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations."
},
"type": "library",
"autoload": {
@ -3083,7 +3029,7 @@
"phpseclib/bootstrap.php"
],
"psr-4": {
"phpseclib\\": "phpseclib/"
"phpseclib3\\": "phpseclib/"
}
},
"notification-url": "https://packagist.org/downloads/",
@ -3152,7 +3098,7 @@
"type": "tidelift"
}
],
"time": "2022-09-02T17:04:26+00:00"
"time": "2022-10-24T10:51:50+00:00"
},
{
"name": "pragmarx/google2fa",
@ -3383,6 +3329,50 @@
],
"time": "2016-08-06T20:24:11+00:00"
},
{
"name": "psr/clock",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/clock.git",
"reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d",
"reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d",
"shasum": ""
},
"require": {
"php": "^7.0 || ^8.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Psr\\Clock\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "https://www.php-fig.org/"
}
],
"description": "Common interface for reading the clock.",
"homepage": "https://github.com/php-fig/clock",
"keywords": [
"clock",
"now",
"psr",
"psr-20",
"time"
],
"time": "2022-11-25T14:36:26+00:00"
},
{
"name": "psr/container",
"version": "1.1.1",

View File

@ -1,12 +0,0 @@
<?php
// Addon configuration
// Copy this configuration file to addon.config.php and edit it if you want to configure addons, see below example for the twitter addon
return [
'twitter' => [
'consumerkey' => '1234567890',
'consumersecret' => 'ABCDEFGHIJKLMONPQRSTUVWXYZ',
],
];

View File

@ -1,6 +1,6 @@
-- ------------------------------------------
-- Friendica 2022.09-rc (Giant Rhubarb)
-- DB_UPDATE_VERSION 1484
-- Friendica 2022.12 (Giant Rhubarb)
-- DB_UPDATE_VERSION 1502
-- ------------------------------------------
@ -59,6 +59,7 @@ CREATE TABLE IF NOT EXISTS `user` (
`language` varchar(32) NOT NULL DEFAULT 'en' COMMENT 'default language',
`register_date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'timestamp of registration',
`login_date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'timestamp of last login',
`last-activity` date COMMENT 'Day of the last activity',
`default-location` varchar(255) NOT NULL DEFAULT '' COMMENT 'Default for item.location',
`allow_location` boolean NOT NULL DEFAULT '0' COMMENT '1 allows to display the location',
`theme` varchar(255) NOT NULL DEFAULT '' COMMENT 'user theme preference',
@ -80,7 +81,7 @@ CREATE TABLE IF NOT EXISTS `user` (
`pwdreset` varchar(255) COMMENT 'Password reset request token',
`pwdreset_time` datetime COMMENT 'Timestamp of the last password reset request',
`maxreq` int unsigned NOT NULL DEFAULT 10 COMMENT '',
`expire` int unsigned NOT NULL DEFAULT 0 COMMENT '',
`expire` int unsigned NOT NULL DEFAULT 0 COMMENT 'Delay in days before deleting user-related posts. Scope is controlled by pConfig.',
`account_removed` boolean NOT NULL DEFAULT '0' COMMENT 'if 1 the account is removed',
`account_expired` boolean NOT NULL DEFAULT '0' COMMENT '',
`account_expires_on` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'timestamp when account expires and will be deleted',
@ -128,6 +129,7 @@ CREATE TABLE IF NOT EXISTS `contact` (
`xmpp` varchar(255) NOT NULL DEFAULT '' COMMENT 'XMPP address',
`matrix` varchar(255) NOT NULL DEFAULT '' COMMENT 'Matrix address',
`avatar` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
`blurhash` varbinary(255) COMMENT 'BlurHash representation of the avatar',
`header` varbinary(383) COMMENT 'Header picture',
`url` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
`nurl` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
@ -309,6 +311,20 @@ CREATE TABLE IF NOT EXISTS `2fa_trusted_browser` (
FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Two-factor authentication trusted browsers';
--
-- TABLE account-suggestion
--
CREATE TABLE IF NOT EXISTS `account-suggestion` (
`uri-id` int unsigned NOT NULL COMMENT 'Id of the item-uri table entry that contains the account url',
`uid` mediumint unsigned NOT NULL COMMENT 'User ID',
`level` smallint unsigned COMMENT 'level of closeness',
`ignore` boolean NOT NULL DEFAULT '0' COMMENT 'If set, this account will not be suggested again',
PRIMARY KEY(`uid`,`uri-id`),
INDEX `uri-id_uid` (`uri-id`,`uid`),
FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Account suggestion';
--
-- TABLE account-user
--
@ -563,6 +579,40 @@ CREATE TABLE IF NOT EXISTS `delayed-post` (
FOREIGN KEY (`wid`) REFERENCES `workerqueue` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Posts that are about to be distributed at a later time';
--
-- TABLE diaspora-contact
--
CREATE TABLE IF NOT EXISTS `diaspora-contact` (
`uri-id` int unsigned NOT NULL COMMENT 'Id of the item-uri table entry that contains the contact URL',
`addr` varchar(255) COMMENT '',
`alias` varchar(255) COMMENT '',
`nick` varchar(255) COMMENT '',
`name` varchar(255) COMMENT '',
`given-name` varchar(255) COMMENT '',
`family-name` varchar(255) COMMENT '',
`photo` varchar(255) COMMENT '',
`photo-medium` varchar(255) COMMENT '',
`photo-small` varchar(255) COMMENT '',
`batch` varchar(255) COMMENT '',
`notify` varchar(255) COMMENT '',
`poll` varchar(255) COMMENT '',
`subscribe` varchar(255) COMMENT '',
`searchable` boolean COMMENT '',
`pubkey` text COMMENT '',
`gsid` int unsigned COMMENT 'Global Server ID',
`created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
`updated` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
`interacting_count` int unsigned DEFAULT 0 COMMENT 'Number of contacts this contact interactes with',
`interacted_count` int unsigned DEFAULT 0 COMMENT 'Number of contacts that interacted with this contact',
`post_count` int unsigned DEFAULT 0 COMMENT 'Number of posts and comments',
PRIMARY KEY(`uri-id`),
UNIQUE INDEX `addr` (`addr`),
INDEX `alias` (`alias`),
INDEX `gsid` (`gsid`),
FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
FOREIGN KEY (`gsid`) REFERENCES `gserver` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Diaspora compatible contacts - used in the Diaspora implementation';
--
-- TABLE diaspora-interaction
--
@ -618,39 +668,6 @@ CREATE TABLE IF NOT EXISTS `event` (
FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Events';
--
-- TABLE fcontact
--
CREATE TABLE IF NOT EXISTS `fcontact` (
`id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
`guid` varbinary(255) NOT NULL DEFAULT '' COMMENT 'unique id',
`url` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
`uri-id` int unsigned COMMENT 'Id of the item-uri table entry that contains the fcontact url',
`name` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`photo` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
`request` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
`nick` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`addr` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`batch` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
`notify` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
`poll` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
`confirm` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
`priority` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
`network` char(4) NOT NULL DEFAULT '' COMMENT '',
`alias` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
`pubkey` text COMMENT '',
`created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
`updated` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
`interacting_count` int unsigned DEFAULT 0 COMMENT 'Number of contacts this contact interactes with',
`interacted_count` int unsigned DEFAULT 0 COMMENT 'Number of contacts that interacted with this contact',
`post_count` int unsigned DEFAULT 0 COMMENT 'Number of posts and comments',
PRIMARY KEY(`id`),
INDEX `addr` (`addr`(32)),
UNIQUE INDEX `url` (`url`(190)),
UNIQUE INDEX `uri-id` (`uri-id`),
FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Diaspora compatible contacts - used in the Diaspora implementation';
--
-- TABLE fetch-entry
--
@ -1073,6 +1090,7 @@ CREATE TABLE IF NOT EXISTS `photo` (
`height` smallint unsigned NOT NULL DEFAULT 0 COMMENT '',
`width` smallint unsigned NOT NULL DEFAULT 0 COMMENT '',
`datasize` int unsigned NOT NULL DEFAULT 0 COMMENT '',
`blurhash` varbinary(255) COMMENT 'BlurHash representation of the photo',
`data` mediumblob NOT NULL COMMENT '',
`scale` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
`profile` boolean NOT NULL DEFAULT '0' COMMENT '',
@ -1186,6 +1204,7 @@ CREATE TABLE IF NOT EXISTS `post-content` (
`content-warning` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`body` mediumtext COMMENT 'item body content',
`raw-body` mediumtext COMMENT 'Body without embedded media links',
`quote-uri-id` int unsigned COMMENT 'Id of the item-uri table that contains the quoted uri',
`location` varchar(255) NOT NULL DEFAULT '' COMMENT 'text location where this item originated',
`coord` varchar(255) NOT NULL DEFAULT '' COMMENT 'longitude/latitude pair representing location where this item originated',
`language` text COMMENT 'Language information about this post',
@ -1202,7 +1221,9 @@ CREATE TABLE IF NOT EXISTS `post-content` (
INDEX `plink` (`plink`(191)),
INDEX `resource-id` (`resource-id`),
FULLTEXT INDEX `title-content-warning-body` (`title`,`content-warning`,`body`),
FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
INDEX `quote-uri-id` (`quote-uri-id`),
FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
FOREIGN KEY (`quote-uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Content for all posts';
--
@ -1277,6 +1298,9 @@ CREATE TABLE IF NOT EXISTS `post-link` (
`uri-id` int unsigned NOT NULL COMMENT 'Id of the item-uri table entry that contains the item uri',
`url` varbinary(511) NOT NULL COMMENT 'External URL',
`mimetype` varchar(60) COMMENT '',
`height` smallint unsigned COMMENT 'Height of the media',
`width` smallint unsigned COMMENT 'Width of the media',
`blurhash` varbinary(255) COMMENT 'BlurHash representation of the link',
PRIMARY KEY(`id`),
UNIQUE INDEX `uri-id-url` (`uri-id`,`url`),
FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
@ -1289,11 +1313,13 @@ CREATE TABLE IF NOT EXISTS `post-media` (
`id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
`uri-id` int unsigned NOT NULL COMMENT 'Id of the item-uri table entry that contains the item uri',
`url` varbinary(1024) NOT NULL COMMENT 'Media URL',
`media-uri-id` int unsigned COMMENT 'Id of the item-uri table entry that contains the activities uri-id',
`type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'Media type',
`mimetype` varchar(60) COMMENT '',
`height` smallint unsigned COMMENT 'Height of the media',
`width` smallint unsigned COMMENT 'Width of the media',
`size` bigint unsigned COMMENT 'Media size',
`blurhash` varbinary(255) COMMENT 'BlurHash representation of the image',
`preview` varbinary(512) COMMENT 'Preview URL',
`preview-height` smallint unsigned COMMENT 'Height of the preview picture',
`preview-width` smallint unsigned COMMENT 'Width of the preview picture',
@ -1308,7 +1334,9 @@ CREATE TABLE IF NOT EXISTS `post-media` (
PRIMARY KEY(`id`),
UNIQUE INDEX `uri-id-url` (`uri-id`,`url`(512)),
INDEX `uri-id-id` (`uri-id`,`id`),
FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
INDEX `media-uri-id` (`media-uri-id`),
FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
FOREIGN KEY (`media-uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Attached media';
--
@ -1571,6 +1599,7 @@ CREATE TABLE IF NOT EXISTS `profile` (
`education` text COMMENT 'Deprecated',
`contact` text COMMENT 'Deprecated',
`homepage` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`homepage_verified` boolean NOT NULL DEFAULT '0' COMMENT 'was the homepage verified by a rel-me link back to the profile',
`xmpp` varchar(255) NOT NULL DEFAULT '' COMMENT 'XMPP address',
`matrix` varchar(255) NOT NULL DEFAULT '' COMMENT 'Matrix address',
`photo` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
@ -1639,6 +1668,37 @@ CREATE TABLE IF NOT EXISTS `register` (
FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='registrations requiring admin approval';
--
-- TABLE report
--
CREATE TABLE IF NOT EXISTS `report` (
`id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
`uid` mediumint unsigned COMMENT 'Reporting user',
`cid` int unsigned NOT NULL COMMENT 'Reported contact',
`comment` text COMMENT 'Report',
`forward` boolean COMMENT 'Forward the report to the remote server',
`created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
`status` tinyint unsigned COMMENT 'Status of the report',
PRIMARY KEY(`id`),
INDEX `uid` (`uid`),
INDEX `cid` (`cid`),
FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE,
FOREIGN KEY (`cid`) REFERENCES `contact` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='';
--
-- TABLE report-post
--
CREATE TABLE IF NOT EXISTS `report-post` (
`rid` int unsigned NOT NULL COMMENT 'Report id',
`uri-id` int unsigned NOT NULL COMMENT 'Uri-id of the reported post',
`status` tinyint unsigned COMMENT 'Status of the reported post',
PRIMARY KEY(`rid`,`uri-id`),
INDEX `uri-id` (`uri-id`),
FOREIGN KEY (`rid`) REFERENCES `report` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='';
--
-- TABLE search
--
@ -1807,6 +1867,8 @@ CREATE VIEW `post-user-view` AS SELECT
`post-user`.`thr-parent-id` AS `thr-parent-id`,
`conversation-item-uri`.`uri` AS `conversation`,
`post-thread-user`.`conversation-id` AS `conversation-id`,
`quote-item-uri`.`uri` AS `quote-uri`,
`post-content`.`quote-uri-id` AS `quote-uri-id`,
`item-uri`.`guid` AS `guid`,
`post-user`.`wall` AS `wall`,
`post-user`.`gravity` AS `gravity`,
@ -1944,9 +2006,7 @@ CREATE VIEW `post-user-view` AS SELECT
`parent-post-author`.`url` AS `parent-author-link`,
`parent-post-author`.`name` AS `parent-author-name`,
`parent-post-author`.`nick` AS `parent-author-nick`,
`parent-post-author`.`network` AS `parent-author-network`,
`parent-post-author`.`blocked` AS `parent-author-blocked`,
`parent-post-author`.`hidden` AS `parent-author-hidden`
`parent-post-author`.`network` AS `parent-author-network`
FROM `post-user`
STRAIGHT_JOIN `post-thread-user` ON `post-thread-user`.`uri-id` = `post-user`.`parent-uri-id` AND `post-thread-user`.`uid` = `post-user`.`uid`
STRAIGHT_JOIN `contact` ON `contact`.`id` = `post-user`.`contact-id`
@ -1962,6 +2022,7 @@ CREATE VIEW `post-user-view` AS SELECT
LEFT JOIN `event` ON `event`.`id` = `post-user`.`event-id`
LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post-user`.`uri-id`
LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post-user`.`uri-id`
LEFT JOIN `item-uri` AS `quote-item-uri` ON `quote-item-uri`.`id` = `post-content`.`quote-uri-id`
LEFT JOIN `post-delivery-data` ON `post-delivery-data`.`uri-id` = `post-user`.`uri-id` AND `post-user`.`origin`
LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post-user`.`uri-id`
LEFT JOIN `permissionset` ON `permissionset`.`id` = `post-user`.`psid`
@ -1985,6 +2046,8 @@ CREATE VIEW `post-thread-user-view` AS SELECT
`post-user`.`thr-parent-id` AS `thr-parent-id`,
`conversation-item-uri`.`uri` AS `conversation`,
`post-thread-user`.`conversation-id` AS `conversation-id`,
`quote-item-uri`.`uri` AS `quote-uri`,
`post-content`.`quote-uri-id` AS `quote-uri-id`,
`item-uri`.`guid` AS `guid`,
`post-thread-user`.`wall` AS `wall`,
`post-user`.`gravity` AS `gravity`,
@ -2120,9 +2183,7 @@ CREATE VIEW `post-thread-user-view` AS SELECT
`parent-post`.`author-id` AS `parent-author-id`,
`parent-post-author`.`url` AS `parent-author-link`,
`parent-post-author`.`name` AS `parent-author-name`,
`parent-post-author`.`network` AS `parent-author-network`,
`parent-post-author`.`blocked` AS `parent-author-blocked`,
`parent-post-author`.`hidden` AS `parent-author-hidden`
`parent-post-author`.`network` AS `parent-author-network`
FROM `post-thread-user`
INNER JOIN `post-user` ON `post-user`.`id` = `post-thread-user`.`post-user-id`
STRAIGHT_JOIN `contact` ON `contact`.`id` = `post-thread-user`.`contact-id`
@ -2138,6 +2199,7 @@ CREATE VIEW `post-thread-user-view` AS SELECT
LEFT JOIN `event` ON `event`.`id` = `post-user`.`event-id`
LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post-thread-user`.`uri-id`
LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post-thread-user`.`uri-id`
LEFT JOIN `item-uri` AS `quote-item-uri` ON `quote-item-uri`.`id` = `post-content`.`quote-uri-id`
LEFT JOIN `post-delivery-data` ON `post-delivery-data`.`uri-id` = `post-thread-user`.`uri-id` AND `post-thread-user`.`origin`
LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post-thread-user`.`uri-id`
LEFT JOIN `permissionset` ON `permissionset`.`id` = `post-thread-user`.`psid`
@ -2157,6 +2219,8 @@ CREATE VIEW `post-view` AS SELECT
`post`.`thr-parent-id` AS `thr-parent-id`,
`conversation-item-uri`.`uri` AS `conversation`,
`post-thread`.`conversation-id` AS `conversation-id`,
`quote-item-uri`.`uri` AS `quote-uri`,
`post-content`.`quote-uri-id` AS `quote-uri-id`,
`item-uri`.`guid` AS `guid`,
`post`.`gravity` AS `gravity`,
`external-item-uri`.`uri` AS `extid`,
@ -2263,9 +2327,7 @@ CREATE VIEW `post-view` AS SELECT
`parent-post`.`author-id` AS `parent-author-id`,
`parent-post-author`.`url` AS `parent-author-link`,
`parent-post-author`.`name` AS `parent-author-name`,
`parent-post-author`.`network` AS `parent-author-network`,
`parent-post-author`.`blocked` AS `parent-author-blocked`,
`parent-post-author`.`hidden` AS `parent-author-hidden`
`parent-post-author`.`network` AS `parent-author-network`
FROM `post`
STRAIGHT_JOIN `post-thread` ON `post-thread`.`uri-id` = `post`.`parent-uri-id`
STRAIGHT_JOIN `contact` AS `author` ON `author`.`id` = `post`.`author-id`
@ -2279,6 +2341,7 @@ CREATE VIEW `post-view` AS SELECT
LEFT JOIN `verb` ON `verb`.`id` = `post`.`vid`
LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post`.`uri-id`
LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post`.`uri-id`
LEFT JOIN `item-uri` AS `quote-item-uri` ON `quote-item-uri`.`id` = `post-content`.`quote-uri-id`
LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post`.`uri-id`
LEFT JOIN `post` AS `parent-post` ON `parent-post`.`uri-id` = `post`.`parent-uri-id`
LEFT JOIN `contact` AS `parent-post-author` ON `parent-post-author`.`id` = `parent-post`.`author-id`;
@ -2296,6 +2359,8 @@ CREATE VIEW `post-thread-view` AS SELECT
`post`.`thr-parent-id` AS `thr-parent-id`,
`conversation-item-uri`.`uri` AS `conversation`,
`post-thread`.`conversation-id` AS `conversation-id`,
`quote-item-uri`.`uri` AS `quote-uri`,
`post-content`.`quote-uri-id` AS `quote-uri-id`,
`item-uri`.`guid` AS `guid`,
`post`.`gravity` AS `gravity`,
`external-item-uri`.`uri` AS `extid`,
@ -2396,15 +2461,15 @@ CREATE VIEW `post-thread-view` AS SELECT
`post-question`.`end-time` AS `question-end-time`,
0 AS `has-categories`,
EXISTS(SELECT `id` FROM `post-media` WHERE `post-media`.`uri-id` = `post-thread`.`uri-id`) AS `has-media`,
(SELECT COUNT(*) FROM `post` WHERE `parent-uri-id` = `post-thread`.`uri-id` AND `gravity` = 6) AS `total-comments`,
(SELECT COUNT(DISTINCT(`author-id`)) FROM `post` WHERE `parent-uri-id` = `post-thread`.`uri-id` AND `gravity` = 6) AS `total-actors`,
`diaspora-interaction`.`interaction` AS `signed_text`,
`parent-item-uri`.`guid` AS `parent-guid`,
`parent-post`.`network` AS `parent-network`,
`parent-post`.`author-id` AS `parent-author-id`,
`parent-post-author`.`url` AS `parent-author-link`,
`parent-post-author`.`name` AS `parent-author-name`,
`parent-post-author`.`network` AS `parent-author-network`,
`parent-post-author`.`blocked` AS `parent-author-blocked`,
`parent-post-author`.`hidden` AS `parent-author-hidden`
`parent-post-author`.`network` AS `parent-author-network`
FROM `post-thread`
INNER JOIN `post` ON `post`.`uri-id` = `post-thread`.`uri-id`
STRAIGHT_JOIN `contact` AS `author` ON `author`.`id` = `post-thread`.`author-id`
@ -2418,6 +2483,7 @@ CREATE VIEW `post-thread-view` AS SELECT
LEFT JOIN `verb` ON `verb`.`id` = `post`.`vid`
LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post-thread`.`uri-id`
LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post-thread`.`uri-id`
LEFT JOIN `item-uri` AS `quote-item-uri` ON `quote-item-uri`.`id` = `post-content`.`quote-uri-id`
LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post-thread`.`uri-id`
LEFT JOIN `post` AS `parent-post` ON `parent-post`.`uri-id` = `post`.`parent-uri-id`
LEFT JOIN `contact` AS `parent-post-author` ON `parent-post-author`.`id` = `parent-post`.`author-id`;
@ -2457,6 +2523,24 @@ CREATE VIEW `collection-view` AS SELECT
INNER JOIN `post` ON `post-collection`.`uri-id` = `post`.`uri-id`
INNER JOIN `post-thread` ON `post-thread`.`uri-id` = `post`.`parent-uri-id`;
--
-- VIEW media-view
--
DROP VIEW IF EXISTS `media-view`;
CREATE VIEW `media-view` AS SELECT
`post-media`.`uri-id` AS `uri-id`,
`post-media`.`type` AS `type`,
`post`.`received` AS `received`,
`post`.`created` AS `created`,
`post`.`private` AS `private`,
`post`.`visible` AS `visible`,
`post`.`deleted` AS `deleted`,
`post`.`thr-parent-id` AS `thr-parent-id`,
`post`.`author-id` AS `author-id`,
`post`.`gravity` AS `gravity`
FROM `post-media`
INNER JOIN `post` ON `post-media`.`uri-id` = `post`.`uri-id`;
--
-- VIEW tag-view
--
@ -2616,6 +2700,7 @@ CREATE VIEW `owner-view` AS SELECT
`user`.`language` AS `language`,
`user`.`register_date` AS `register_date`,
`user`.`login_date` AS `login_date`,
`user`.`last-activity` AS `last-activity`,
`user`.`default-location` AS `default-location`,
`user`.`allow_location` AS `allow_location`,
`user`.`theme` AS `theme`,
@ -2656,6 +2741,7 @@ CREATE VIEW `owner-view` AS SELECT
`profile`.`postal-code` AS `postal-code`,
`profile`.`country-name` AS `country-name`,
`profile`.`homepage` AS `homepage`,
`profile`.`homepage_verified` AS `homepage_verified`,
`profile`.`dob` AS `dob`
FROM `user`
INNER JOIN `contact` ON `contact`.`uid` = `user`.`uid` AND `contact`.`self`
@ -2721,11 +2807,11 @@ CREATE VIEW `account-view` AS SELECT
`contact`.`blocked` AS `blocked`,
`contact`.`notify` AS `dfrn-notify`,
`contact`.`poll` AS `dfrn-poll`,
`fcontact`.`guid` AS `diaspora-guid`,
`fcontact`.`batch` AS `diaspora-batch`,
`fcontact`.`notify` AS `diaspora-notify`,
`fcontact`.`poll` AS `diaspora-poll`,
`fcontact`.`alias` AS `diaspora-alias`,
`item-uri`.`guid` AS `diaspora-guid`,
`diaspora-contact`.`batch` AS `diaspora-batch`,
`diaspora-contact`.`notify` AS `diaspora-notify`,
`diaspora-contact`.`poll` AS `diaspora-poll`,
`diaspora-contact`.`alias` AS `diaspora-alias`,
`apcontact`.`uuid` AS `ap-uuid`,
`apcontact`.`type` AS `ap-type`,
`apcontact`.`following` AS `ap-following`,
@ -2743,7 +2829,7 @@ CREATE VIEW `account-view` AS SELECT
FROM `contact`
LEFT JOIN `item-uri` ON `item-uri`.`id` = `contact`.`uri-id`
LEFT JOIN `apcontact` ON `apcontact`.`uri-id` = `contact`.`uri-id`
LEFT JOIN `fcontact` ON `fcontact`.`uri-id` = contact.`uri-id`
LEFT JOIN `diaspora-contact` ON `diaspora-contact`.`uri-id` = contact.`uri-id`
LEFT JOIN `gserver` ON `gserver`.`id` = contact.`gsid`
WHERE `contact`.`uid` = 0;
@ -2822,14 +2908,14 @@ CREATE VIEW `account-user-view` AS SELECT
`ucontact`.`reason` AS `reason`,
`contact`.`notify` AS `dfrn-notify`,
`contact`.`poll` AS `dfrn-poll`,
`fcontact`.`guid` AS `diaspora-guid`,
`fcontact`.`batch` AS `diaspora-batch`,
`fcontact`.`notify` AS `diaspora-notify`,
`fcontact`.`poll` AS `diaspora-poll`,
`fcontact`.`alias` AS `diaspora-alias`,
`fcontact`.`interacting_count` AS `diaspora-interacting_count`,
`fcontact`.`interacted_count` AS `diaspora-interacted_count`,
`fcontact`.`post_count` AS `diaspora-post_count`,
`item-uri`.`guid` AS `diaspora-guid`,
`diaspora-contact`.`batch` AS `diaspora-batch`,
`diaspora-contact`.`notify` AS `diaspora-notify`,
`diaspora-contact`.`poll` AS `diaspora-poll`,
`diaspora-contact`.`alias` AS `diaspora-alias`,
`diaspora-contact`.`interacting_count` AS `diaspora-interacting_count`,
`diaspora-contact`.`interacted_count` AS `diaspora-interacted_count`,
`diaspora-contact`.`post_count` AS `diaspora-post_count`,
`apcontact`.`uuid` AS `ap-uuid`,
`apcontact`.`type` AS `ap-type`,
`apcontact`.`following` AS `ap-following`,
@ -2848,7 +2934,7 @@ CREATE VIEW `account-user-view` AS SELECT
INNER JOIN `contact` ON `contact`.`uri-id` = `ucontact`.`uri-id` AND `contact`.`uid` = 0
LEFT JOIN `item-uri` ON `item-uri`.`id` = `ucontact`.`uri-id`
LEFT JOIN `apcontact` ON `apcontact`.`uri-id` = `ucontact`.`uri-id`
LEFT JOIN `fcontact` ON `fcontact`.`uri-id` = `ucontact`.`uri-id` AND `fcontact`.`network` = 'dspr'
LEFT JOIN `diaspora-contact` ON `diaspora-contact`.`uri-id` = `ucontact`.`uri-id`
LEFT JOIN `gserver` ON `gserver`.`id` = contact.`gsid`;
--
@ -2925,3 +3011,37 @@ CREATE VIEW `profile_field-view` AS SELECT
`profile_field`.`edited` AS `edited`
FROM `profile_field`
INNER JOIN `permissionset` ON `permissionset`.`id` = `profile_field`.`psid`;
--
-- VIEW diaspora-contact-view
--
DROP VIEW IF EXISTS `diaspora-contact-view`;
CREATE VIEW `diaspora-contact-view` AS SELECT
`diaspora-contact`.`uri-id` AS `uri-id`,
`item-uri`.`uri` AS `url`,
`item-uri`.`guid` AS `guid`,
`diaspora-contact`.`addr` AS `addr`,
`diaspora-contact`.`alias` AS `alias`,
`diaspora-contact`.`nick` AS `nick`,
`diaspora-contact`.`name` AS `name`,
`diaspora-contact`.`given-name` AS `given-name`,
`diaspora-contact`.`family-name` AS `family-name`,
`diaspora-contact`.`photo` AS `photo`,
`diaspora-contact`.`photo-medium` AS `photo-medium`,
`diaspora-contact`.`photo-small` AS `photo-small`,
`diaspora-contact`.`batch` AS `batch`,
`diaspora-contact`.`notify` AS `notify`,
`diaspora-contact`.`poll` AS `poll`,
`diaspora-contact`.`subscribe` AS `subscribe`,
`diaspora-contact`.`searchable` AS `searchable`,
`diaspora-contact`.`pubkey` AS `pubkey`,
`gserver`.`url` AS `baseurl`,
`diaspora-contact`.`gsid` AS `gsid`,
`diaspora-contact`.`created` AS `created`,
`diaspora-contact`.`updated` AS `updated`,
`diaspora-contact`.`interacting_count` AS `interacting_count`,
`diaspora-contact`.`interacted_count` AS `interacted_count`,
`diaspora-contact`.`post_count` AS `post_count`
FROM `diaspora-contact`
INNER JOIN `item-uri` ON `item-uri`.`id` = `diaspora-contact`.`uri-id`
LEFT JOIN `gserver` ON `gserver`.`id` = `diaspora-contact`.`gsid`;

View File

@ -47,6 +47,7 @@ These endpoints use the [Mastodon API entities](https://docs.joinmastodon.org/en
- [`POST /api/v1/accounts/:id/unmute`](https://docs.joinmastodon.org/methods/accounts/)
- [`GET /api/v1/accounts/relationships`](https://docs.joinmastodon.org/methods/accounts/)
- [`GET /api/v1/accounts/search`](https://docs.joinmastodon.org/methods/accounts)
- [`PATCH /api/v1/accounts/update_credentials`](https://docs.joinmastodon.org/methods/accounts/#update_credentials)
- [`GET /api/v1/accounts/verify_credentials`](https://docs.joinmastodon.org/methods/accounts)
- [`POST /api/v1/apps`](https://docs.joinmastodon.org/methods/apps/)
- [`GET /api/v1/apps/verify_credentials`](https://docs.joinmastodon.org/methods/apps/)
@ -72,7 +73,7 @@ These endpoints use the [Mastodon API entities](https://docs.joinmastodon.org/en
- `:id` is a follow request ID, not a regular account id
- Returns a [Relationship](https://docs.joinmastodon.org/entities/relationship) object.
- [`GET /api/v1/followed_tags'](https://docs.joinmastodon.org/methods/followed_tags/)
- [`GET /api/v1/instance`](https://docs.joinmastodon.org/methods/instance#fetch-instance)
- `GET /api/v1/instance/rules` Undocumented, returns Terms of Service
- [`GET /api/v1/instance/peers`](https://docs.joinmastodon.org/methods/instance#list-of-connected-domains)
@ -100,35 +101,44 @@ These endpoints use the [Mastodon API entities](https://docs.joinmastodon.org/en
- [`GET /api/v1/push/subscription`](https://docs.joinmastodon.org/methods/notifications/push/)
- [`PUSH /api/v1/push/subscription`](https://docs.joinmastodon.org/methods/notifications/push/)
- [`PUT /api/v1/push/subscription`](https://docs.joinmastodon.org/methods/notifications/push/)
- [`POST /api/v1/reports`](https://docs.joinmastodon.org/methods/accounts/reports/)
- [`GET /api/v1/scheduled_statuses`](https://docs.joinmastodon.org/methods/statuses/scheduled_statuses/)
- [`DELETE /api/v1/scheduled_statuses/:id`](https://docs.joinmastodon.org/methods/statuses/scheduled_statuses/)
- [`GET /api/v1/scheduled_statuses/:id`](https://docs.joinmastodon.org/methods/statuses/scheduled_statuses/)
- [`GET /api/v1/search`](https://docs.joinmastodon.org/methods/search/)
- [`POST /api/v1/statuses`](https://docs.joinmastodon.org/methods/statuses/)
- [`POST /api/v1/statuses`](https://docs.joinmastodon.org/methods/statuses/#create)
- Additionally to the static values `public`, `unlisted` and `private`, the `visibility` parameter can contain a numeric value with a group id.
- [`GET /api/v1/statuses/:id`](https://docs.joinmastodon.org/methods/statuses/)
- [`DELETE /api/v1/statuses/:id`](https://docs.joinmastodon.org/methods/statuses/)
- [`GET /api/v1/statuses/:id/card`](https://docs.joinmastodon.org/methods/statuses/)
- [`GET /api/v1/statuses/:id/context`](https://docs.joinmastodon.org/methods/statuses/)
- [`GET /api/v1/statuses/:id/reblogged_by`](https://docs.joinmastodon.org/methods/statuses/)
- [`GET /api/v1/statuses/:id/favourited_by`](https://docs.joinmastodon.org/methods/statuses/)
- [`POST /api/v1/statuses/:id/favourite`](https://docs.joinmastodon.org/methods/statuses/)
- [`POST /api/v1/statuses/:id/unfavourite`](https://docs.joinmastodon.org/methods/statuses/)
- [`POST /api/v1/statuses/:id/reblog`](https://docs.joinmastodon.org/methods/statuses/)
- [`POST /api/v1/statuses/:id/unreblog`](https://docs.joinmastodon.org/methods/statuses/)
- [`POST /api/v1/statuses/:id/bookmark`](https://docs.joinmastodon.org/methods/statuses/)
- [`POST /api/v1/statuses/:id/unbookmark`](https://docs.joinmastodon.org/methods/statuses/)
- [`POST /api/v1/statuses/:id/mute`](https://docs.joinmastodon.org/methods/statuses/)
- [`POST /api/v1/statuses/:id/unmute`](https://docs.joinmastodon.org/methods/statuses/)
- [`POST /api/v1/statuses/:id/pin`](https://docs.joinmastodon.org/methods/statuses/)
- [`POST /api/v1/statuses/:id/unpin`](https://docs.joinmastodon.org/methods/statuses/)
- [`GET /api/v1/statuses/:id`](https://docs.joinmastodon.org/methods/statuses/#get)
- [`DELETE /api/v1/statuses/:id`](https://docs.joinmastodon.org/methods/statuses/#delete)
- [`GET /api/v1/statuses/:id/context`](https://docs.joinmastodon.org/methods/statuses/#context)
- [`GET /api/v1/statuses/:id/reblogged_by`](https://docs.joinmastodon.org/methods/statuses/#reblogged_by)
- [`GET /api/v1/statuses/:id/favourited_by`](https://docs.joinmastodon.org/methods/statuses/#favourited_by)
- [`POST /api/v1/statuses/:id/favourite`](https://docs.joinmastodon.org/methods/statuses/#favourite)
- [`POST /api/v1/statuses/:id/unfavourite`](https://docs.joinmastodon.org/methods/statuses/#unfavourite)
- [`POST /api/v1/statuses/:id/reblog`](https://docs.joinmastodon.org/methods/statuses/#boost)
- [`POST /api/v1/statuses/:id/unreblog`](https://docs.joinmastodon.org/methods/statuses/#unreblog)
- [`POST /api/v1/statuses/:id/bookmark`](https://docs.joinmastodon.org/methods/statuses/#bookmark)
- [`POST /api/v1/statuses/:id/unbookmark`](https://docs.joinmastodon.org/methods/statuses/#unbookmark)
- [`POST /api/v1/statuses/:id/mute`](https://docs.joinmastodon.org/methods/statuses/#mute)
- [`POST /api/v1/statuses/:id/unmute`](https://docs.joinmastodon.org/methods/statuses/#unmute)
- [`POST /api/v1/statuses/:id/pin`](https://docs.joinmastodon.org/methods/statuses/#pin)
- [`POST /api/v1/statuses/:id/unpin`](https://docs.joinmastodon.org/methods/statuses/#unpin)
- [`POST /api/v1/statuses/:id`](https://docs.joinmastodon.org/methods/statuses/#edit)
- [`GET /api/v1/statuses/:id/source`](https://docs.joinmastodon.org/methods/statuses/#source)
- [`GET /api/v1/statuses/:id/card`](https://docs.joinmastodon.org/methods/statuses/#card)
- [`GET /api/v1/suggestions`](https://docs.joinmastodon.org/methods/accounts/suggestions/)
- [`GET /api/v1/tags/:id`](https://docs.joinmastodon.org/methods/tags/#get)
- [`GET /api/v1/tags/:id/follow`](https://docs.joinmastodon.org/methods/tags/#follow)
- [`GET /api/v1/tags/:id/unfollow`](https://docs.joinmastodon.org/methods/tags/#unfollow)
- [`GET /api/v1/timelines/direct`](https://docs.joinmastodon.org/methods/timelines/)
- [`GET /api/v1/timelines/home`](https://docs.joinmastodon.org/methods/timelines/)
- [`GET /api/v1/timelines/list/:id`](https://docs.joinmastodon.org/methods/timelines/)
- [`GET /api/v1/timelines/public`](https://docs.joinmastodon.org/methods/timelines/)
- [`GET /api/v1/timelines/tag/:hashtag`](https://docs.joinmastodon.org/methods/timelines/)
- [`GET /api/v1/trends`](https://docs.joinmastodon.org/methods/instance/trends/)
- [`GET /api/v1/trends/links`](https://github.com/mastodon/mastodon/pull/16917)
- [`GET /api/v1/trends/statuses`](https://docs.joinmastodon.org/methods/trends/#statuses)
- [`GET /api/v1/trends/tags`](https://docs.joinmastodon.org/methods/trends/#tags)
- [`GET /api/v2/search`](https://docs.joinmastodon.org/methods/search/)
@ -136,15 +146,10 @@ These endpoints use the [Mastodon API entities](https://docs.joinmastodon.org/en
These emdpoints are planned to be implemented somewhere in the future.
- [`PATCH /api/v1/accounts/update_credentials`](https://docs.joinmastodon.org/methods/accounts/)
- [`POST /api/v1/accounts/:id/remove_from_followers`](https://github.com/mastodon/mastodon/pull/16864)
- [`GET /api/v1/accounts/familiar_followers`](https://github.com/mastodon/mastodon/pull/17700)
- [`GET /api/v1/accounts/lookup`](https://github.com/mastodon/mastodon/pull/15740)
- [`GET /api/v1/trends/links`](https://github.com/mastodon/mastodon/pull/16917)
- [`GET /api/v1/trends/statuses`](https://github.com/mastodon/mastodon/pull/17431)
- [`GET /api/v1/trends/tags`](https://github.com/mastodon/mastodon/pull/16917)
- [`POST /api/v1/polls/:id/votes`](https://docs.joinmastodon.org/methods/statuses/polls/)
- [`GET /api/v1/statuses/{id:\d+}/source`](https://github.com/mastodon/mastodon/pull/16697)
- [`GET /api/v1/featured_tags`](https://docs.joinmastodon.org/methods/accounts/featured_tags/)
- [`POST /api/v1/featured_tags`](https://docs.joinmastodon.org/methods/accounts/featured_tags/)
- [`DELETE /api/v1/featured_tags/:id`](https://docs.joinmastodon.org/methods/accounts/featured_tags/)
@ -189,7 +194,6 @@ They refer to features or data that don't exist in Friendica yet.
- [`DELETE /api/v1/filters/:id`](https://docs.joinmastodon.org/methods/accounts/filters/)
- [`GET /api/v1/instance/activity`](https://docs.joinmastodon.org/methods/instance#weekly-activity)
- [`POST /api/v1/markers`](https://docs.joinmastodon.org/methods/timelines/markers/)
- [`POST /api/v1/reports`](https://docs.joinmastodon.org/methods/accounts/reports/)
- [`PUT /api/v1/scheduled_statuses/:id`](https://docs.joinmastodon.org/methods/statuses/scheduled_statuses/)
- [`GET /api/v1/statuses/{id:\d+}/history`](https://github.com/mastodon/mastodon/pull/16697)
- [`GET /api/v1/streaming`](https://docs.joinmastodon.org/methods/timelines/streaming/)

View File

@ -19,6 +19,7 @@ General
* c - Community
* s - Search
* a - Admin
* m - Moderation
* f - Notifications
* u - User menu

View File

@ -281,7 +281,7 @@ $data = [
'submit' => [
'catavatar-usecat' => DI::l10n()->t('Use Cat as Avatar'),
'catavatar-morecat' => DI::l10n()->t('Another random Cat!'),
'catavatar-emailcat' => DI::pConfig()->get(local_user(), 'catavatar', 'seed', false) ? DI::l10n()->t('Reset to email Cat') : null,
'catavatar-emailcat' => DI::pConfig()->get(Session::getLocalUser(), 'catavatar', 'seed', false) ? DI::l10n()->t('Reset to email Cat') : null,
],
];
```
@ -790,10 +790,6 @@ Here is a complete list of all hook callbacks with file locations (as of 24-Sep-
Hook::callAll('post_local', $datarray);
Hook::callAll('post_local_end', $datarray);
### mod/editpost.php
Hook::callAll('jot_tool', $jotplugins);
### src/Render/FriendicaSmartyEngine.php
Hook::callAll("template_vars", $arr);
@ -855,6 +851,10 @@ Here is a complete list of all hook callbacks with file locations (as of 24-Sep-
Hook::callAll('lockview_content', $item);
### src/Module/Post/Edit.php
Hook::callAll('jot_tool', $jotplugins);
### src/Module/Settings/Delegation.php
Hook::callAll('authenticate', $addon_auth);
@ -919,6 +919,10 @@ Here is a complete list of all hook callbacks with file locations (as of 24-Sep-
Hook::callAll('block', $hook_data);
Hook::callAll('unblock', $hook_data);
### src/Core/Logger/Factory.php
Hook::callAll('logger_instance', $data);
### src/Core/StorageManager
Hook::callAll('storage_instance', $data);

View File

@ -191,7 +191,7 @@ code</code></td>
You should not read any further if you want to be surprised.<br>
<span id="spoiler-wrap-0716e642" class="spoiler-wrap fakelink" onclick="openClose('spoiler-0716e642');">Click to open/close</span>
<blockquote class="spoiler" id="spoiler-0716e642" style="display: none;">There is a happy end.</blockquote>
<div class="body-attach"><div class="clear"></div></div>
<div class="body-attach"></div>
</div>
</td>
</tr>
@ -202,7 +202,7 @@ code</code></td>
<strong class="spoiler">Author wrote:</strong><br>
<span id="spoiler-wrap-a893765a" class="spoiler-wrap fakelink" onclick="openClose('spoiler-a893765a');">Click to open/close</span>
<blockquote class="spoiler" id="spoiler-a893765a" style="display: none;">Spoiler quote</blockquote>
<div class="body-attach"><div class="clear"></div></div>
<div class="body-attach"></div>
</div>
</td>
</tr>

View File

@ -6,7 +6,7 @@ Using Composer
Friendica uses [Composer](https://getcomposer.org) to manage dependencies libraries and the class autoloader both for libraries and namespaced Friendica classes.
It's a command-line tool that downloads required libraries into the `vendor` folder and makes any namespaced class in `src` available through the whole application through `boot.php`.
It's a command-line tool that downloads required libraries into the `vendor` folder and makes any namespaced class in `src` available through the whole application.
* [Class autoloading](help/autoloader)

View File

@ -37,8 +37,8 @@ The `config` directory holds key configuration files and can have different conf
All of them have to end with `.config.php` and must not include `-sample` in their name.
Some examples of common known configuration files:
- `local.config.php` holds the current node custom configuration.
- `addon.config.php` is optional and holds the custom configuration for specific addons.
- `local.config.php` holds the base node custom configuration.
- Any other file in this folder is meant for additional configuration (e.g. for addons).
Addons can define their own default configuration values in `addon/[addon]/config/[addon].config.php` which is loaded when the addon is activated.
@ -59,7 +59,7 @@ Currently, the following configurations are included:
The legacy `.htconfig.php` configuration file is still supported, but is deprecated and will be removed in a subsequent Friendica release.
The migration is pretty straightforward:
If you had any addon-specific configuration in your `.htconfig.php`, just copy `config/addon-sample.config.php` to `config/addon.config.php` and move your configuration values.
If you had any addon-specific configuration in your `.htconfig.php`, copy `config/local-sample.config.php` to `config/addon.config.php` and move your configuration values.
Afterwards, copy `config/local-sample.config.php` to `config/local.config.php`, move the remaining configuration values to it according to the following conversion chart, then rename your `.htconfig.php` to check your node is working as expected before deleting it.
<style>
@ -206,7 +206,7 @@ $lang = "value";
The legacy `config/local.ini.php` configuration file is still supported, but is deprecated and will be removed in a subsequent Friendica release.
The migration is pretty straightforward:
If you had any addon-specific configuration in your `config/addon.ini.php`, just copy `config/addon-sample.config.php` to `config/addon.config.php` and move your configuration values.
If you had any addon-specific configuration in your `config/addon.ini.php`, copy `config/local-sample.config.php` to `config/addon.config.php` and move your configuration values.
Afterwards, copy `config/local-sample.config.php` to `config/local.config.php`, move the remaining configuration values to it according to the following conversion chart, then rename your `config/local.ini.php` file to check your node is working as expected before deleting it.
<table class="config">
@ -278,16 +278,16 @@ key[] = value3
### Database Settings
The configuration variables database.hostname, database.username, database.password, database.database and database.charset are holding your credentials for the database connection.
If you need to specify a port to access the database, you can do so by appending ":portnumber" to the database.hostname variable.
The configuration variables `database.hostname` (or `database.socket`), `database.username`, `database.password`, `database.database` and optionally `database.charset` are holding your credentials for the database connection.
If you need to specify a port to access the database, you can do so by appending ":portnumber" to the `database.hostname` variable.
'database' => [
'hostname' => 'your.mysqlhost.com:123456',
]
If all of the following environment variables are set, Friendica will use them instead of the previously configured variables for the db:
If all the following environment variables are set, Friendica will use them instead of the previously configured variables for the db:
MYSQL_HOST
MYSQL_HOST or MYSQL_SOCKET
MYSQL_PORT
MYSQL_USERNAME
MYSQL_PASSWORD
@ -316,7 +316,7 @@ Enabling the admin panel for an account, and thus making the account holder admi
Where you have to match the email address used for the account with the one you enter to the `config/local.config.php` file.
If more then one account should be able to access the admin panel, separate the email addresses with a comma.
If more than one account should be able to access the admin panel, separate the email addresses with a comma.
'config' => [
'admin_email' => 'someone@example.com,someoneelse@example.com',

View File

@ -9,8 +9,8 @@ There is also a connector for accessing your email INBOX.
If the following network connectors are installed on your system, select the following links to visit the appropriate settings page and configure them for your account:
* [Twitter](/settings/addon)
* [GNU Social](/settings/addon)
* [Twitter](/settings/addons)
* [GNU Social](/settings/addons)
* [Email](/settings)
Instructions For Connecting To People On Specific Services

View File

@ -30,7 +30,7 @@ function doSomething(array $intros)
}
}
$intros = \Friendica\Database\DBA::selectToArray('intros', [], ['uid' => local_user()]);
$intros = \Friendica\Database\DBA::selectToArray('intros', [], ['uid' => Session::getLocalUser()]);
doSomething($intros);
```
@ -47,7 +47,7 @@ function doSomething(\Friendica\Contact\Introductions\Collection\Introductions $
}
/** @var $intros \Friendica\Contact\Introductions\Collection\Introductions */
$intros = \Friendica\DI::intro()->selecForUser(local_user());
$intros = \Friendica\DI::intro()->selecForUser(Session::getLocalUser());
doSomething($intros);
```

View File

@ -47,7 +47,7 @@ Friendica uses an implementation of [Domain-Driven-Design](help/Developer-Domain
Friendica uses [Composer](https://getcomposer.org) to manage dependencies libraries and the class autoloader both for libraries and namespaced Friendica classes.
It's a command-line tool that downloads required libraries into the `vendor` folder and makes any namespaced class in `src` available through the whole application through `boot.php`.
It's a command-line tool that downloads required libraries into the `vendor` folder and makes any namespaced class in `src` available through the whole application.
If you want to have git automatically update the dependencies with composer, you can use the `post-merge` [git-hook](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks) with a script similar to this one:

View File

@ -50,7 +50,7 @@ We recommend to talk to the admin(s) of the affected friendica server. (Admins,
### How can I upload images, files, links, videos and sound files to posts?
You can upload images from your computer using the [editor](help/Text_editor).
An overview of all uploaded images is listed at *yourpage.com/photos/profilename*.
An overview of all uploaded images is listed at *yourpage.com/profile/profilename/photos*.
On that page, you can also upload images directly and choose if your contacts will receive a message about this upload.
Generally, you can attach any kind of file to a post.
@ -178,47 +178,39 @@ The available features are client specific and may differ.
#### Android
* [AndStatus](http://andstatus.org) ([F-Droid](https://f-droid.org/repository/browse/?fdid=org.andstatus.app), [Google Play](https://play.google.com/store/apps/details?id=org.andstatus.app))
* [B4X for Pleroma & Mastodon](https://github.com/AnywhereSoftware/B4X-Pleroma)
* [Fedi](https://play.google.com/store/apps/details?id=com.fediverse.app)
* [Fedi](https://github.com/Big-Fig/Fediverse.app) ([Google Play](https://play.google.com/store/apps/details?id=com.fediverse.app))
* [Fedilab](https://fedilab.app) ([F-Droid](https://f-droid.org/app/fr.gouv.etalab.mastodon), [Google Play](https://play.google.com/store/apps/details?id=app.fedilab.android))
* [Friendiqa](https://git.friendi.ca/lubuwest/Friendiqa) ([F-Droid](https://git.friendi.ca/lubuwest/Friendiqa#install), [Google Play](https://play.google.com/store/apps/details?id=org.qtproject.friendiqa))
* [Husky](https://git.sr.ht/~captainepoch/husky) ([F-Droid](https://f-droid.org/repository/browse/?fdid=su.xash.husky), [Google Play](https://play.google.com/store/apps/details?id=su.xash.husky))
* [Mastodon for Android](https://github.com/mastodon/mastodon-android) (F-Droid: Pending, [Google-Play](https://play.google.com/store/apps/details?id=org.joinmastodon.android))
* [Subway Tooter](https://github.com/tateisu/SubwayTooter)
* [Tooot](https://tooot.app/)
* [Mastodon](https://github.com/mastodon/mastodon-android) ([F-Droid](https://f-droid.org/en/packages/org.joinmastodon.android/), [Google Play](https://play.google.com/store/apps/details?id=org.joinmastodon.android))
* [Subway Tooter](https://github.com/tateisu/SubwayTooter) ([F-Droid](https://android.izzysoft.de/repo/apk/jp.juggler.subwaytooter))
* [Tooot](https://tooot.app/) ([Google Play](https://play.google.com/store/apps/details?id=com.xmflsct.app.tooot))
* [Tusky](https://tusky.app) ([F-Droid](https://f-droid.org/repository/browse/?fdid=com.keylesspalace.tusky), [Google Play](https://play.google.com/store/apps/details?id=com.keylesspalace.tusky))
* [Twidere](https://github.com/TwidereProject/Twidere-Android) ([F-Droid](https://f-droid.org/repository/browse/?fdid=org.mariotaku.twidere), [Google Play](https://play.google.com/store/apps/details?id=com.twidere.twiderex))
* [TwidereX](https://github.com/TwidereProject/TwidereX-Android) ([F-Droid](https://f-droid.org/en/packages/com.twidere.twiderex/), [Google Play](https://play.google.com/store/apps/details?id=com.twidere.twiderex))
* [Yuito](https://github.com/accelforce/Yuito) ([Google Play](https://play.google.com/store/apps/details?id=net.accelf.yuito))
#### SailfishOS
* [Friendly](https://openrepos.net/content/fabrixxm/friendly), last update: 2018
#### iOS
* [B4X for Pleroma & Mastodon](https://github.com/AnywhereSoftware/B4X-Pleroma) ([AppStore](https://apps.apple.com/app/b4x-pleroma/id1538396871))
* [Fedi](https://fediapp.com) ([AppStore](https://apps.apple.com/de/app/fedi-for-pleroma-and-mastodon/id1478806281))
* [Mastodon for iPhone and iPad](https://joinmastodon.org/apps) ([AppStore](https://apps.apple.com/us/app/mastodon-for-iphone/id1571998974))
* [Mastodon](https://joinmastodon.org/apps) ([AppStore](https://apps.apple.com/us/app/mastodon-for-iphone/id1571998974))
* [Stella*](https://www.stella-app.net/) ([AppStore](https://apps.apple.com/us/app/stella-for-mastodon-twitter/id921372048))
* [Tooot](https://github.com/tooot-app) ([AppStore](https://apps.apple.com/app/id1549772269), Data collection (not linked to identity)
* [Tootle](https://mastodon.cloud/@tootleapp) ([AppStore](https://apps.apple.com/de/app/tootle-for-mastodon/id1236013466)), last update: 2020
* [Tooot](https://github.com/tooot-app) ([AppStore](https://apps.apple.com/app/id1549772269)
* [TwidereX](https://github.com/TwidereProject/TwidereX-iOS) ([AppStore](https://apps.apple.com/app/twidere-x/id1530314034))
#### Linux
* [Choqok](https://choqok.kde.org)
* [Whalebird](https://whalebird.social)
* [TheDesk](https://ja.mstdn.wiki/TheDesk)
* [Whalebird](https://whalebird.social/en/desktop/contents) ([GitHub](https://github.com/h3poteto/whalebird-desktop))
* [TheDesk](https://thedesk.top/en/) ([GitHub](https://github.com/cutls/TheDesk))
* [Toot](https://toot.readthedocs.io/en/latest/)
* [Tootle](https://github.com/bleakgrey/tootle)
#### macOS
* [Mastonaut](https://mastonaut.app/) ([AppStore](https://apps.apple.com/us/app/mastonaut/id1450757574)), closed source
* [TheDesk](https://thedesk.top/en/) ([GitHub](https://github.com/cutls/TheDesk))
* [Whalebird](https://whalebird.social/en/desktop/contents) ([AppStore](https://apps.apple.com/de/app/whalebird/id1378283354), [GitHub](https://github.com/h3poteto/whalebird-desktop))
#### Windows
* [TheDesk](https://thedesk.top/en/) ([GitHub](https://github.com/cutls/TheDesk))
* [Whalebird](https://whalebird.social/en/desktop/contents) ([Website Download](https://whalebird.social/en/desktop/contents/downloads#windows), [GitHub](https://github.com/h3poteto/whalebird-desktop))
#### Web Frontend

View File

@ -34,7 +34,7 @@ Due to the large variety of operating systems and PHP platforms in existence we
* The POSIX module of PHP needs to be activated (e.g. [RHEL, CentOS](http://www.bigsoft.co.uk/blog/index.php/2014/12/08/posix-php-commands-not-working-under-centos-7) have disabled it)
* Some form of email server or email gateway such that PHP mail() works.
If you cannot set up your own email server, you can use the [phpmailer](https://github.com/friendica/friendica-addons/tree/develop/phpmailer) addon and use a remote SMTP server.
* MySQL 5.6+ or an equivalent alternative for MySQL (MariaDB, Percona Server etc.)
* MySQL with support of InnoDB and Barracuda (we suggest a MariaDB server as all development is done using these, but alternatives like MySQL or Percona Server etc. might work as well)
* ability to schedule jobs with cron (Linux/Mac) or Scheduled Tasks (Windows)
* installation into a top-level domain or sub-domain (without a directory/path component in the URL) is RECOMMENDED. Directory paths will not be as convenient to use and have not been thoroughly tested. This is REQUIRED if you wish to communicate with the Diaspora network.

View File

@ -9,8 +9,8 @@ How to move your account between servers
* Go to "Settings" -> "[Export personal data](uexport)"
* Click on "Export account" to save your account data.
* **Save the file in a secure place!** It contains your details, your contacts, groups, and personal settings. It also contains your secret keys to authenticate yourself to your contacts.
* Go to your new server, and open *http://newserver.com/uimport* (there is not a direct link to this page at the moment). Please consider that this is only possible on servers with open registration. On other systems only the administrator can add accounts with an uploaded file.
* Do NOT create a new account prior to importing your old settings - uimport should be used *instead* of register.
* Go to your new server, and open *http://newserver.com/user/import* (there is not a direct link to this page at the moment). Please consider that this is only possible on servers with open registration. On other systems only the administrator can add accounts with an uploaded file.
* Do NOT create a new account prior to importing your old settings - user import should be used *instead* of register.
* Load your saved account file and click "Import".
* After the move, the account on the old server will not work reliably anymore, and should be not used.

View File

@ -5,7 +5,7 @@ Remove Account
We don't like to see people leave Friendica, but if you need to remove your account, you should visit the URL
http://sitename/removeme
http://sitename/settings/removeme
with your web browser.
You will need to be logged in at the time.

View File

@ -30,13 +30,3 @@ Here you can find an overview of the different ways to comment and sort existing
<P style="clear: both;"></p>
<img src="doc/img/post_choose.png" width="27" height="32" alt="post_choose.png" align="left"> This symbol is used to choose more than one post to delete in a single step. After selecting all posts, go to the end of the page and click "Delete Selected Items".<P style="clear: both;"></p>
**Symbols of other themes**
Darkbubble <img src="doc/img/darkbubble.png" alt="darkbubble.png" style="padding-left: 20px; vertical-align:middle;">
Darkzero <img src="doc/img/darkzero.png" alt="darkzero.png" style="padding-left: 35px; vertical-align:middle;">
<span style="padding-left: 10px; font-style:italic;">(incl. more "zero"-themes, slackr, comix, easterbunny, facepark)</span>
Dispy <img src="doc/img/dispy.png" alt="dispy.png" style="padding-left: 57px; vertical-align:middle;"> <i>(incl. smoothly, testbubble)</i>

View File

@ -24,10 +24,6 @@ Below are examples of the post editor in 3 of Friendica's common themes:
<figcaption>Post editor, with the <b>Vier</b> theme.</figcaption>
</figure>
<p style="clear:both;"></p>
<figure>
<img src="doc/img/editor_dpzero.png" alt="duepuntozero editor">
<figcaption>Post editor, with the <b>Duepuntozero</b> theme.</figcaption>
</figure>
Post title is optional, you can set it by clicking on "Set title".
@ -73,11 +69,6 @@ These icons can change depending on the theme. Some examples:
<td><img src="doc/img/vier_icons.png" alt="vier.png" style="vertical-align:middle;"></td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Smoothly: </td>
<td><img src="doc/img/editor_darkbubble.png" alt="darkbubble.png" style="vertical-align:middle;"></td>
<td>&nbsp;</td>
</tr>
</table>
<i><b>*</b> how to [upload](help/FAQ#upload) files</i>
<p style="clear:both;">&nbsp;</p>

View File

@ -10,7 +10,7 @@ Getting started
No need to setup up a webserver, database etc. before actually starting.
Vagrant creates a virtual machine for you that you can just run inside VirtualBox and start to work directly on Friendica.
It brings an Debian Bullseye with PHP 7.4 and MariaDB 10.5.11.
It brings an Debian Bullseye with PHP 8.0 and MariaDB 10.5.11.
What you need to do:
@ -24,7 +24,7 @@ This will start the virtual machine.
Be patient: When it runs for the first time, it downloads a Debian Server image and installs Friendica.
4. Run `vagrant ssh` to log into the virtual machine to log in to the VM in case you need to debug something on the server.
5. Open you test installation in a browser.
Go to friendica.local (or 192.168.22.10).
Go to friendica.local (or 192.168.56.10).
friendica.local is using a self-signed TLS certificate, so you will need to add an exception to trust the certificate the first time you are visiting the page.
The mysql database is called "friendica", the mysql user and password both are "friendica".
6. Work on Friendica's code in your git clone on your machine (not in the VM).

View File

@ -6,7 +6,7 @@ Autoloader with Composer
Friendica uses [Composer](https://getcomposer.org) to manage dependencies libraries and the class autoloader both for libraries and namespaced Friendica classes.
It's a command-line tool that downloads required libraries into the `vendor` folder and makes any namespaced class in `src` available through the whole application through `boot.php`.
It's a command-line tool that downloads required libraries into the `vendor` folder and makes any namespaced class in `src` available through the whole application.
* [Using Composer](help/Composer)
@ -39,7 +39,6 @@ Namespaces are useful to keep classes separated and avoid names conflicts (could
Let's say now that you need to load some items in a view, maybe in a fictional `mod/network.php`.
In order for the Composer autoloader to work, it must first be included.
In Friendica this is already done at the top of `boot.php`, with `require_once('vendor/autoload.php');`.
The code will be something like:

View File

@ -8,6 +8,7 @@ Database Tables
| [2fa_app_specific_password](help/database/db_2fa_app_specific_password) | Two-factor app-specific _password |
| [2fa_recovery_codes](help/database/db_2fa_recovery_codes) | Two-factor authentication recovery codes |
| [2fa_trusted_browser](help/database/db_2fa_trusted_browser) | Two-factor authentication trusted browsers |
| [account-suggestion](help/database/db_account-suggestion) | Account suggestion |
| [account-user](help/database/db_account-user) | Remote and local accounts |
| [addon](help/database/db_addon) | registered addons |
| [apcontact](help/database/db_apcontact) | ActivityPub compatible contacts - used in the ActivityPub implementation |
@ -22,10 +23,10 @@ Database Tables
| [contact-relation](help/database/db_contact-relation) | Contact relations |
| [conv](help/database/db_conv) | private messages |
| [delayed-post](help/database/db_delayed-post) | Posts that are about to be distributed at a later time |
| [diaspora-contact](help/database/db_diaspora-contact) | Diaspora compatible contacts - used in the Diaspora implementation |
| [diaspora-interaction](help/database/db_diaspora-interaction) | Signed Diaspora Interaction |
| [endpoint](help/database/db_endpoint) | ActivityPub endpoints - used in the ActivityPub implementation |
| [event](help/database/db_event) | Events |
| [fcontact](help/database/db_fcontact) | Diaspora compatible contacts - used in the Diaspora implementation |
| [fetch-entry](help/database/db_fetch-entry) | |
| [fetched-activity](help/database/db_fetched-activity) | Id of fetched activities |
| [fsuggest](help/database/db_fsuggest) | friend suggestion stuff |
@ -74,6 +75,8 @@ Database Tables
| [profile_field](help/database/db_profile_field) | Custom profile fields |
| [push_subscriber](help/database/db_push_subscriber) | Used for OStatus: Contains feed subscribers |
| [register](help/database/db_register) | registrations requiring admin approval |
| [report](help/database/db_report) | |
| [report-post](help/database/db_report-post) | |
| [search](help/database/db_search) | |
| [session](help/database/db_session) | web session storage |
| [storage](help/database/db_storage) | Data stored by Database storage backend |

View File

@ -0,0 +1,32 @@
Table account-suggestion
===========
Account suggestion
Fields
------
| Field | Description | Type | Null | Key | Default | Extra |
| ------ | ------------------------------------------------------------ | ------------------ | ---- | --- | ------- | ----- |
| uri-id | Id of the item-uri table entry that contains the account url | int unsigned | NO | PRI | NULL | |
| uid | User ID | mediumint unsigned | NO | PRI | NULL | |
| level | level of closeness | smallint unsigned | YES | | NULL | |
| ignore | If set, this account will not be suggested again | boolean | NO | | 0 | |
Indexes
------------
| Name | Fields |
| ---------- | ----------- |
| PRIMARY | uid, uri-id |
| uri-id_uid | uri-id, uid |
Foreign Keys
------------
| Field | Target Table | Target Field |
|-------|--------------|--------------|
| uri-id | [item-uri](help/database/db_item-uri) | id |
| uid | [user](help/database/db_user) | uid |
Return to [database documentation](help/database)

View File

@ -21,6 +21,7 @@ Fields
| xmpp | XMPP address | varchar(255) | NO | | | |
| matrix | Matrix address | varchar(255) | NO | | | |
| avatar | | varbinary(383) | NO | | | |
| blurhash | BlurHash representation of the avatar | varbinary(255) | YES | | NULL | |
| header | Header picture | varbinary(383) | YES | | NULL | |
| url | | varbinary(383) | NO | | | |
| nurl | | varbinary(383) | NO | | | |

View File

@ -0,0 +1,52 @@
Table diaspora-contact
===========
Diaspora compatible contacts - used in the Diaspora implementation
Fields
------
| Field | Description | Type | Null | Key | Default | Extra |
| ----------------- | ------------------------------------------------------------ | ------------ | ---- | --- | ------------------- | ----- |
| uri-id | Id of the item-uri table entry that contains the contact URL | int unsigned | NO | PRI | NULL | |
| addr | | varchar(255) | YES | | NULL | |
| alias | | varchar(255) | YES | | NULL | |
| nick | | varchar(255) | YES | | NULL | |
| name | | varchar(255) | YES | | NULL | |
| given-name | | varchar(255) | YES | | NULL | |
| family-name | | varchar(255) | YES | | NULL | |
| photo | | varchar(255) | YES | | NULL | |
| photo-medium | | varchar(255) | YES | | NULL | |
| photo-small | | varchar(255) | YES | | NULL | |
| batch | | varchar(255) | YES | | NULL | |
| notify | | varchar(255) | YES | | NULL | |
| poll | | varchar(255) | YES | | NULL | |
| subscribe | | varchar(255) | YES | | NULL | |
| searchable | | boolean | YES | | NULL | |
| pubkey | | text | YES | | NULL | |
| gsid | Global Server ID | int unsigned | YES | | NULL | |
| created | | datetime | NO | | 0001-01-01 00:00:00 | |
| updated | | datetime | NO | | 0001-01-01 00:00:00 | |
| interacting_count | Number of contacts this contact interactes with | int unsigned | YES | | 0 | |
| interacted_count | Number of contacts that interacted with this contact | int unsigned | YES | | 0 | |
| post_count | Number of posts and comments | int unsigned | YES | | 0 | |
Indexes
------------
| Name | Fields |
| ------- | ------------ |
| PRIMARY | uri-id |
| addr | UNIQUE, addr |
| alias | alias |
| gsid | gsid |
Foreign Keys
------------
| Field | Target Table | Target Field |
|-------|--------------|--------------|
| uri-id | [item-uri](help/database/db_item-uri) | id |
| gsid | [gserver](help/database/db_gserver) | id |
Return to [database documentation](help/database)

View File

@ -1,51 +0,0 @@
Table fcontact
===========
Diaspora compatible contacts - used in the Diaspora implementation
Fields
------
| Field | Description | Type | Null | Key | Default | Extra |
| ----------------- | ------------------------------------------------------------- | ---------------- | ---- | --- | ------------------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| guid | unique id | varbinary(255) | NO | | | |
| url | | varbinary(383) | NO | | | |
| uri-id | Id of the item-uri table entry that contains the fcontact url | int unsigned | YES | | NULL | |
| name | | varchar(255) | NO | | | |
| photo | | varbinary(383) | NO | | | |
| request | | varbinary(383) | NO | | | |
| nick | | varchar(255) | NO | | | |
| addr | | varchar(255) | NO | | | |
| batch | | varbinary(383) | NO | | | |
| notify | | varbinary(383) | NO | | | |
| poll | | varbinary(383) | NO | | | |
| confirm | | varbinary(383) | NO | | | |
| priority | | tinyint unsigned | NO | | 0 | |
| network | | char(4) | NO | | | |
| alias | | varbinary(383) | NO | | | |
| pubkey | | text | YES | | NULL | |
| created | | datetime | NO | | 0001-01-01 00:00:00 | |
| updated | | datetime | NO | | 0001-01-01 00:00:00 | |
| interacting_count | Number of contacts this contact interactes with | int unsigned | YES | | 0 | |
| interacted_count | Number of contacts that interacted with this contact | int unsigned | YES | | 0 | |
| post_count | Number of posts and comments | int unsigned | YES | | 0 | |
Indexes
------------
| Name | Fields |
| ------- | ---------------- |
| PRIMARY | id |
| addr | addr(32) |
| url | UNIQUE, url(190) |
| uri-id | UNIQUE, uri-id |
Foreign Keys
------------
| Field | Target Table | Target Field |
|-------|--------------|--------------|
| uri-id | [item-uri](help/database/db_item-uri) | id |
Return to [database documentation](help/database)

View File

@ -25,6 +25,7 @@ Fields
| height | | smallint unsigned | NO | | 0 | |
| width | | smallint unsigned | NO | | 0 | |
| datasize | | int unsigned | NO | | 0 | |
| blurhash | BlurHash representation of the photo | varbinary(255) | YES | | NULL | |
| data | | mediumblob | NO | | NULL | |
| scale | | tinyint unsigned | NO | | 0 | |
| profile | | boolean | NO | | 0 | |

View File

@ -13,6 +13,7 @@ Fields
| content-warning | | varchar(255) | NO | | | |
| body | item body content | mediumtext | YES | | NULL | |
| raw-body | Body without embedded media links | mediumtext | YES | | NULL | |
| quote-uri-id | Id of the item-uri table that contains the quoted uri | int unsigned | YES | | NULL | |
| location | text location where this item originated | varchar(255) | NO | | | |
| coord | longitude/latitude pair representing location where this item originated | varchar(255) | NO | | | |
| language | Language information about this post | text | YES | | NULL | |
@ -35,6 +36,7 @@ Indexes
| plink | plink(191) |
| resource-id | resource-id |
| title-content-warning-body | FULLTEXT, title, content-warning, body |
| quote-uri-id | quote-uri-id |
Foreign Keys
------------
@ -42,5 +44,6 @@ Foreign Keys
| Field | Target Table | Target Field |
|-------|--------------|--------------|
| uri-id | [item-uri](help/database/db_item-uri) | id |
| quote-uri-id | [item-uri](help/database/db_item-uri) | id |
Return to [database documentation](help/database)

View File

@ -6,12 +6,15 @@ Post related external links
Fields
------
| Field | Description | Type | Null | Key | Default | Extra |
| -------- | --------------------------------------------------------- | -------------- | ---- | --- | ------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| uri-id | Id of the item-uri table entry that contains the item uri | int unsigned | NO | | NULL | |
| url | External URL | varbinary(511) | NO | | NULL | |
| mimetype | | varchar(60) | YES | | NULL | |
| Field | Description | Type | Null | Key | Default | Extra |
| -------- | --------------------------------------------------------- | ----------------- | ---- | --- | ------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| uri-id | Id of the item-uri table entry that contains the item uri | int unsigned | NO | | NULL | |
| url | External URL | varbinary(511) | NO | | NULL | |
| mimetype | | varchar(60) | YES | | NULL | |
| height | Height of the media | smallint unsigned | YES | | NULL | |
| width | Width of the media | smallint unsigned | YES | | NULL | |
| blurhash | BlurHash representation of the link | varbinary(255) | YES | | NULL | |
Indexes
------------

View File

@ -6,36 +6,39 @@ Attached media
Fields
------
| Field | Description | Type | Null | Key | Default | Extra |
| --------------- | --------------------------------------------------------- | ----------------- | ---- | --- | ------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| uri-id | Id of the item-uri table entry that contains the item uri | int unsigned | NO | | NULL | |
| url | Media URL | varbinary(1024) | NO | | NULL | |
| type | Media type | tinyint unsigned | NO | | 0 | |
| mimetype | | varchar(60) | YES | | NULL | |
| height | Height of the media | smallint unsigned | YES | | NULL | |
| width | Width of the media | smallint unsigned | YES | | NULL | |
| size | Media size | bigint unsigned | YES | | NULL | |
| preview | Preview URL | varbinary(512) | YES | | NULL | |
| preview-height | Height of the preview picture | smallint unsigned | YES | | NULL | |
| preview-width | Width of the preview picture | smallint unsigned | YES | | NULL | |
| description | | text | YES | | NULL | |
| name | Name of the media | varchar(255) | YES | | NULL | |
| author-url | URL of the author of the media | varbinary(383) | YES | | NULL | |
| author-name | Name of the author of the media | varchar(255) | YES | | NULL | |
| author-image | Image of the author of the media | varbinary(383) | YES | | NULL | |
| publisher-url | URL of the publisher of the media | varbinary(383) | YES | | NULL | |
| publisher-name | Name of the publisher of the media | varchar(255) | YES | | NULL | |
| publisher-image | Image of the publisher of the media | varbinary(383) | YES | | NULL | |
| Field | Description | Type | Null | Key | Default | Extra |
| --------------- | ------------------------------------------------------------------ | ----------------- | ---- | --- | ------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| uri-id | Id of the item-uri table entry that contains the item uri | int unsigned | NO | | NULL | |
| url | Media URL | varbinary(1024) | NO | | NULL | |
| media-uri-id | Id of the item-uri table entry that contains the activities uri-id | int unsigned | YES | | NULL | |
| type | Media type | tinyint unsigned | NO | | 0 | |
| mimetype | | varchar(60) | YES | | NULL | |
| height | Height of the media | smallint unsigned | YES | | NULL | |
| width | Width of the media | smallint unsigned | YES | | NULL | |
| size | Media size | bigint unsigned | YES | | NULL | |
| blurhash | BlurHash representation of the image | varbinary(255) | YES | | NULL | |
| preview | Preview URL | varbinary(512) | YES | | NULL | |
| preview-height | Height of the preview picture | smallint unsigned | YES | | NULL | |
| preview-width | Width of the preview picture | smallint unsigned | YES | | NULL | |
| description | | text | YES | | NULL | |
| name | Name of the media | varchar(255) | YES | | NULL | |
| author-url | URL of the author of the media | varbinary(383) | YES | | NULL | |
| author-name | Name of the author of the media | varchar(255) | YES | | NULL | |
| author-image | Image of the author of the media | varbinary(383) | YES | | NULL | |
| publisher-url | URL of the publisher of the media | varbinary(383) | YES | | NULL | |
| publisher-name | Name of the publisher of the media | varchar(255) | YES | | NULL | |
| publisher-image | Image of the publisher of the media | varbinary(383) | YES | | NULL | |
Indexes
------------
| Name | Fields |
| ---------- | ------------------------ |
| PRIMARY | id |
| uri-id-url | UNIQUE, uri-id, url(512) |
| uri-id-id | uri-id, id |
| Name | Fields |
| ------------ | ------------------------ |
| PRIMARY | id |
| uri-id-url | UNIQUE, uri-id, url(512) |
| uri-id-id | uri-id, id |
| media-uri-id | media-uri-id |
Foreign Keys
------------
@ -43,5 +46,6 @@ Foreign Keys
| Field | Target Table | Target Field |
|-------|--------------|--------------|
| uri-id | [item-uri](help/database/db_item-uri) | id |
| media-uri-id | [item-uri](help/database/db_item-uri) | id |
Return to [database documentation](help/database)

View File

@ -6,51 +6,52 @@ user profiles data
Fields
------
| Field | Description | Type | Null | Key | Default | Extra |
| ------------ | --------------------------------------------- | ------------------ | ---- | --- | ---------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| uid | Owner User id | mediumint unsigned | NO | | 0 | |
| profile-name | Deprecated | varchar(255) | YES | | NULL | |
| is-default | Deprecated | boolean | YES | | NULL | |
| hide-friends | Hide friend list from viewers of this profile | boolean | NO | | 0 | |
| name | | varchar(255) | NO | | | |
| pdesc | Deprecated | varchar(255) | YES | | NULL | |
| dob | Day of birth | varchar(32) | NO | | 0000-00-00 | |
| address | | varchar(255) | NO | | | |
| locality | | varchar(255) | NO | | | |
| region | | varchar(255) | NO | | | |
| postal-code | | varchar(32) | NO | | | |
| country-name | | varchar(255) | NO | | | |
| hometown | Deprecated | varchar(255) | YES | | NULL | |
| gender | Deprecated | varchar(32) | YES | | NULL | |
| marital | Deprecated | varchar(255) | YES | | NULL | |
| with | Deprecated | text | YES | | NULL | |
| howlong | Deprecated | datetime | YES | | NULL | |
| sexual | Deprecated | varchar(255) | YES | | NULL | |
| politic | Deprecated | varchar(255) | YES | | NULL | |
| religion | Deprecated | varchar(255) | YES | | NULL | |
| pub_keywords | | text | YES | | NULL | |
| prv_keywords | | text | YES | | NULL | |
| likes | Deprecated | text | YES | | NULL | |
| dislikes | Deprecated | text | YES | | NULL | |
| about | Profile description | text | YES | | NULL | |
| summary | Deprecated | varchar(255) | YES | | NULL | |
| music | Deprecated | text | YES | | NULL | |
| book | Deprecated | text | YES | | NULL | |
| tv | Deprecated | text | YES | | NULL | |
| film | Deprecated | text | YES | | NULL | |
| interest | Deprecated | text | YES | | NULL | |
| romance | Deprecated | text | YES | | NULL | |
| work | Deprecated | text | YES | | NULL | |
| education | Deprecated | text | YES | | NULL | |
| contact | Deprecated | text | YES | | NULL | |
| homepage | | varchar(255) | NO | | | |
| xmpp | XMPP address | varchar(255) | NO | | | |
| matrix | Matrix address | varchar(255) | NO | | | |
| photo | | varbinary(383) | NO | | | |
| thumb | | varbinary(383) | NO | | | |
| publish | publish default profile in local directory | boolean | NO | | 0 | |
| net-publish | publish profile in global directory | boolean | NO | | 0 | |
| Field | Description | Type | Null | Key | Default | Extra |
| ----------------- | -------------------------------------------------------------- | ------------------ | ---- | --- | ---------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| uid | Owner User id | mediumint unsigned | NO | | 0 | |
| profile-name | Deprecated | varchar(255) | YES | | NULL | |
| is-default | Deprecated | boolean | YES | | NULL | |
| hide-friends | Hide friend list from viewers of this profile | boolean | NO | | 0 | |
| name | | varchar(255) | NO | | | |
| pdesc | Deprecated | varchar(255) | YES | | NULL | |
| dob | Day of birth | varchar(32) | NO | | 0000-00-00 | |
| address | | varchar(255) | NO | | | |
| locality | | varchar(255) | NO | | | |
| region | | varchar(255) | NO | | | |
| postal-code | | varchar(32) | NO | | | |
| country-name | | varchar(255) | NO | | | |
| hometown | Deprecated | varchar(255) | YES | | NULL | |
| gender | Deprecated | varchar(32) | YES | | NULL | |
| marital | Deprecated | varchar(255) | YES | | NULL | |
| with | Deprecated | text | YES | | NULL | |
| howlong | Deprecated | datetime | YES | | NULL | |
| sexual | Deprecated | varchar(255) | YES | | NULL | |
| politic | Deprecated | varchar(255) | YES | | NULL | |
| religion | Deprecated | varchar(255) | YES | | NULL | |
| pub_keywords | | text | YES | | NULL | |
| prv_keywords | | text | YES | | NULL | |
| likes | Deprecated | text | YES | | NULL | |
| dislikes | Deprecated | text | YES | | NULL | |
| about | Profile description | text | YES | | NULL | |
| summary | Deprecated | varchar(255) | YES | | NULL | |
| music | Deprecated | text | YES | | NULL | |
| book | Deprecated | text | YES | | NULL | |
| tv | Deprecated | text | YES | | NULL | |
| film | Deprecated | text | YES | | NULL | |
| interest | Deprecated | text | YES | | NULL | |
| romance | Deprecated | text | YES | | NULL | |
| work | Deprecated | text | YES | | NULL | |
| education | Deprecated | text | YES | | NULL | |
| contact | Deprecated | text | YES | | NULL | |
| homepage | | varchar(255) | NO | | | |
| homepage_verified | was the homepage verified by a rel-me link back to the profile | boolean | NO | | 0 | |
| xmpp | XMPP address | varchar(255) | NO | | | |
| matrix | Matrix address | varchar(255) | NO | | | |
| photo | | varbinary(383) | NO | | | |
| thumb | | varbinary(383) | NO | | | |
| publish | publish default profile in local directory | boolean | NO | | 0 | |
| net-publish | publish profile in global directory | boolean | NO | | 0 | |
Indexes
------------

View File

@ -0,0 +1,31 @@
Table report-post
===========
Fields
------
| Field | Description | Type | Null | Key | Default | Extra |
| ------ | --------------------------- | ---------------- | ---- | --- | ------- | ----- |
| rid | Report id | int unsigned | NO | PRI | NULL | |
| uri-id | Uri-id of the reported post | int unsigned | NO | PRI | NULL | |
| status | Status of the reported post | tinyint unsigned | YES | | NULL | |
Indexes
------------
| Name | Fields |
| ------- | ----------- |
| PRIMARY | rid, uri-id |
| uri-id | uri-id |
Foreign Keys
------------
| Field | Target Table | Target Field |
|-------|--------------|--------------|
| rid | [report](help/database/db_report) | id |
| uri-id | [item-uri](help/database/db_item-uri) | id |
Return to [database documentation](help/database)

36
doc/database/db_report.md Normal file
View File

@ -0,0 +1,36 @@
Table report
===========
Fields
------
| Field | Description | Type | Null | Key | Default | Extra |
| ------- | --------------------------------------- | ------------------ | ---- | --- | ------------------- | -------------- |
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
| uid | Reporting user | mediumint unsigned | YES | | NULL | |
| cid | Reported contact | int unsigned | NO | | NULL | |
| comment | Report | text | YES | | NULL | |
| forward | Forward the report to the remote server | boolean | YES | | NULL | |
| created | | datetime | NO | | 0001-01-01 00:00:00 | |
| status | Status of the report | tinyint unsigned | YES | | NULL | |
Indexes
------------
| Name | Fields |
| ------- | ------ |
| PRIMARY | id |
| uid | uid |
| cid | cid |
Foreign Keys
------------
| Field | Target Table | Target Field |
|-------|--------------|--------------|
| uid | [user](help/database/db_user) | uid |
| cid | [contact](help/database/db_contact) | id |
Return to [database documentation](help/database)

View File

@ -6,53 +6,54 @@ The local users
Fields
------
| Field | Description | Type | Null | Key | Default | Extra |
| ------------------------ | --------------------------------------------------------- | ------------------ | ---- | --- | ------------------- | -------------- |
| uid | sequential ID | mediumint unsigned | NO | PRI | NULL | auto_increment |
| parent-uid | The parent user that has full control about this user | mediumint unsigned | YES | | NULL | |
| guid | A unique identifier for this user | varchar(64) | NO | | | |
| username | Name that this user is known by | varchar(255) | NO | | | |
| password | encrypted password | varchar(255) | NO | | | |
| legacy_password | Is the password hash double-hashed? | boolean | NO | | 0 | |
| nickname | nick- and user name | varchar(255) | NO | | | |
| email | the users email address | varchar(255) | NO | | | |
| openid | | varchar(255) | NO | | | |
| timezone | PHP-legal timezone | varchar(128) | NO | | | |
| language | default language | varchar(32) | NO | | en | |
| register_date | timestamp of registration | datetime | NO | | 0001-01-01 00:00:00 | |
| login_date | timestamp of last login | datetime | NO | | 0001-01-01 00:00:00 | |
| default-location | Default for item.location | varchar(255) | NO | | | |
| allow_location | 1 allows to display the location | boolean | NO | | 0 | |
| theme | user theme preference | varchar(255) | NO | | | |
| pubkey | RSA public key 4096 bit | text | YES | | NULL | |
| prvkey | RSA private key 4096 bit | text | YES | | NULL | |
| spubkey | | text | YES | | NULL | |
| sprvkey | | text | YES | | NULL | |
| verified | user is verified through email | boolean | NO | | 0 | |
| blocked | 1 for user is blocked | boolean | NO | | 0 | |
| blockwall | Prohibit contacts to post to the profile page of the user | boolean | NO | | 0 | |
| hidewall | Hide profile details from unkown viewers | boolean | NO | | 0 | |
| blocktags | Prohibit contacts to tag the post of this user | boolean | NO | | 0 | |
| unkmail | Permit unknown people to send private mails to this user | boolean | NO | | 0 | |
| cntunkmail | | int unsigned | NO | | 10 | |
| notify-flags | email notification options | smallint unsigned | NO | | 65535 | |
| page-flags | page/profile type | tinyint unsigned | NO | | 0 | |
| account-type | | tinyint unsigned | NO | | 0 | |
| prvnets | | boolean | NO | | 0 | |
| pwdreset | Password reset request token | varchar(255) | YES | | NULL | |
| pwdreset_time | Timestamp of the last password reset request | datetime | YES | | NULL | |
| maxreq | | int unsigned | NO | | 10 | |
| expire | | int unsigned | NO | | 0 | |
| account_removed | if 1 the account is removed | boolean | NO | | 0 | |
| account_expired | | boolean | NO | | 0 | |
| account_expires_on | timestamp when account expires and will be deleted | datetime | NO | | 0001-01-01 00:00:00 | |
| expire_notification_sent | timestamp of last warning of account expiration | datetime | NO | | 0001-01-01 00:00:00 | |
| def_gid | | int unsigned | NO | | 0 | |
| allow_cid | default permission for this user | mediumtext | YES | | NULL | |
| allow_gid | default permission for this user | mediumtext | YES | | NULL | |
| deny_cid | default permission for this user | mediumtext | YES | | NULL | |
| deny_gid | default permission for this user | mediumtext | YES | | NULL | |
| openidserver | | text | YES | | NULL | |
| Field | Description | Type | Null | Key | Default | Extra |
| ------------------------ | --------------------------------------------------------------------------------- | ------------------ | ---- | --- | ------------------- | -------------- |
| uid | sequential ID | mediumint unsigned | NO | PRI | NULL | auto_increment |
| parent-uid | The parent user that has full control about this user | mediumint unsigned | YES | | NULL | |
| guid | A unique identifier for this user | varchar(64) | NO | | | |
| username | Name that this user is known by | varchar(255) | NO | | | |
| password | encrypted password | varchar(255) | NO | | | |
| legacy_password | Is the password hash double-hashed? | boolean | NO | | 0 | |
| nickname | nick- and user name | varchar(255) | NO | | | |
| email | the users email address | varchar(255) | NO | | | |
| openid | | varchar(255) | NO | | | |
| timezone | PHP-legal timezone | varchar(128) | NO | | | |
| language | default language | varchar(32) | NO | | en | |
| register_date | timestamp of registration | datetime | NO | | 0001-01-01 00:00:00 | |
| login_date | timestamp of last login | datetime | NO | | 0001-01-01 00:00:00 | |
| last-activity | Day of the last activity | date | YES | | NULL | |
| default-location | Default for item.location | varchar(255) | NO | | | |
| allow_location | 1 allows to display the location | boolean | NO | | 0 | |
| theme | user theme preference | varchar(255) | NO | | | |
| pubkey | RSA public key 4096 bit | text | YES | | NULL | |
| prvkey | RSA private key 4096 bit | text | YES | | NULL | |
| spubkey | | text | YES | | NULL | |
| sprvkey | | text | YES | | NULL | |
| verified | user is verified through email | boolean | NO | | 0 | |
| blocked | 1 for user is blocked | boolean | NO | | 0 | |
| blockwall | Prohibit contacts to post to the profile page of the user | boolean | NO | | 0 | |
| hidewall | Hide profile details from unkown viewers | boolean | NO | | 0 | |
| blocktags | Prohibit contacts to tag the post of this user | boolean | NO | | 0 | |
| unkmail | Permit unknown people to send private mails to this user | boolean | NO | | 0 | |
| cntunkmail | | int unsigned | NO | | 10 | |
| notify-flags | email notification options | smallint unsigned | NO | | 65535 | |
| page-flags | page/profile type | tinyint unsigned | NO | | 0 | |
| account-type | | tinyint unsigned | NO | | 0 | |
| prvnets | | boolean | NO | | 0 | |
| pwdreset | Password reset request token | varchar(255) | YES | | NULL | |
| pwdreset_time | Timestamp of the last password reset request | datetime | YES | | NULL | |
| maxreq | | int unsigned | NO | | 10 | |
| expire | Delay in days before deleting user-related posts. Scope is controlled by pConfig. | int unsigned | NO | | 0 | |
| account_removed | if 1 the account is removed | boolean | NO | | 0 | |
| account_expired | | boolean | NO | | 0 | |
| account_expires_on | timestamp when account expires and will be deleted | datetime | NO | | 0001-01-01 00:00:00 | |
| expire_notification_sent | timestamp of last warning of account expiration | datetime | NO | | 0001-01-01 00:00:00 | |
| def_gid | | int unsigned | NO | | 0 | |
| allow_cid | default permission for this user | mediumtext | YES | | NULL | |
| allow_gid | default permission for this user | mediumtext | YES | | NULL | |
| deny_cid | default permission for this user | mediumtext | YES | | NULL | |
| deny_gid | default permission for this user | mediumtext | YES | | NULL | |
| openidserver | | text | YES | | NULL | |
Indexes
------------

View File

@ -309,10 +309,6 @@ Eine komplette Liste aller Hook-Callbacks mit den zugehörigen Dateien (am 01-Ap
Hook::callAll('post_local', $datarray);
Hook::callAll('post_local_end', $datarray);
### mod/editpost.php
Hook::callAll('jot_tool', $jotplugins);
### src/Network/FKOAuth1.php
Hook::callAll('logged_in', $a->user);
@ -405,6 +401,10 @@ Eine komplette Liste aller Hook-Callbacks mit den zugehörigen Dateien (am 01-Ap
Hook::callAll('block', $hook_data);
Hook::callAll('unblock', $hook_data);
### src/Core/Logger/Factory.php
Hook::callAll('logger_instance', $data);
### src/Core/StorageManager
Hook::callAll('storage_instance', $data);
@ -418,6 +418,10 @@ Eine komplette Liste aller Hook-Callbacks mit den zugehörigen Dateien (am 01-Ap
Hook::callAll('lockview_content', $item);
### src/Module/Post/Edit.php
Hook::callAll('jot_tool', $jotplugins);
### src/Worker/Directory.php
Hook::callAll('globaldir_update', $arr);

View File

@ -192,7 +192,7 @@ Zeilen</code></td>
Du solltest nicht weiter lesen, wenn du das Ende des Films nicht vorher erfahren willst. <br>
<span id="spoiler-wrap-0716e642" class="spoiler-wrap fakelink" onclick="openClose('spoiler-0716e642');">Zum &ouml;ffnen/schlie&szlig;en klicken</span>
<blockquote class="spoiler" id="spoiler-0716e642" style="display: none;">Es gibt ein Happy End.</blockquote>
<div class="body-attach"><div class="clear"></div></div>
<div class="body-attach"></div>
</div>
</td>
</tr>
@ -203,7 +203,7 @@ Zeilen</code></td>
<strong class="spoiler">Autor hat geschrieben</strong><br>
<span id="spoiler-wrap-a893765a" class="spoiler-wrap fakelink" onclick="openClose('spoiler-a893765a');">Zum &ouml;ffnen/schlie&szlig;en klicken</span>
<blockquote class="spoiler" id="spoiler-a893765a" style="display: none;">Spoiler Alarm</blockquote>
<div class="body-attach"><div class="clear"></div></div>
<div class="body-attach"></div>
</div>
</td>
</tr>

View File

@ -69,7 +69,7 @@ Andere erlauben nur kostenpflichtige Zertifikate als eigenes Angebot bzw. von an
### Wie kann ich Bilder, Dateien, Links, Video und Audio in Beiträge einfügen?
Bilder können direkt im [Beitragseditor](help/Text_editor) vom Computer hochgeladen werden.
Eine Übersicht aller Bilder, die auf Deinem Server liegen, findest Du unter <i>deineSeite.de/photos/profilname</i>.
Eine Übersicht aller Bilder, die auf Deinem Server liegen, findest Du unter <i>deineSeite.de/profile/profilname/photos</i>.
Dort kannst Du auch direkt Bilder hochladen und festlegen, ob Deine Kontakte eine Nachricht über das neue Bild bekommen.
Alle Arten von Dateien können grundsätzlich als Anhang in Friendica hochgeladen werden.

View File

@ -31,7 +31,7 @@ Requirements
* Das POSIX Modul muss aktiviert sein ([CentOS, RHEL](http://www.bigsoft.co.uk/blog/index.php/2014/12/08/posix-php-commands-not-working-under-centos-7http://www.bigsoft.co.uk/blog/index.php/2014/12/08/posix-php-commands-not-working-under-centos-7) haben dies z.B. deaktiviert)
* Einen E-Mail Server, so dass PHP `mail()` funktioniert.
Wenn kein eigener E-Mail Server zur Verfügung steht, kann alternativ das [phpmailer](https://github.com/friendica/friendica-addons/tree/develop/phpmailer) Addon mit einem externen SMTP Account verwendet werden.
* Mysql 5.6+ (oder eine äquivalente Alternative: MariaDB, Percona Server etc.)
* Mysql Server mit Unterstützung vom InnoDB und Barracuda (wir empfehlen MariaDB da die Entwicklung mit solchen Server erfolgt, aber Alternativen wie MySQL, Percona Server etc. sollten auch funktionieren)
* die Möglichkeit, wiederkehrende Aufgaben mit cron (Linux/Mac) oder "Scheduled Tasks" einzustellen (Windows) [Beachte: andere Optionen sind in Abschnitt 7 dieser Dokumentation zu finden]
* Installation in einer Top-Level-Domain oder Subdomain (ohne eine Verzeichnis/Pfad-Komponente in der URL) wird bevorzugt. Verzeichnispfade sind für diesen Zweck nicht so günstig und wurden auch nicht ausführlich getestet.

View File

@ -15,14 +15,14 @@ Außerdem enthält sie deinen geheimen Schlüssel mit dem du dich deinen Kontakt
**Speichere diese Datei an einem sicheren Ort**!
Rufe nun dem neuen Server die Seite *http://newserver.com/uimport* auf (es gibt derzeit keinen direkten Link auf diese Seite).
Rufe nun dem neuen Server die Seite *http://newserver.com/user/import* auf (es gibt derzeit keinen direkten Link auf diese Seite).
Bitte beachte, dass dies nur auf Servern möglich ist, an denen man sich offen anmelden kann.
Bei Servern, bei denen der Administrator Accounts freigeben muss, ist das Hochladen nicht möglich.
Hier kann dies nur der Administrator selber durchführen.
Lege auf dem neuen Server auf keinen Fall einen gleichnamigen Account an!
uimport muss anstelle des Registrierens verwendet werden.
user import muss anstelle des Registrierens verwendet werden.
Wähle die gesicherte Account Datei aus und klicke "Importieren".

View File

@ -5,7 +5,7 @@ Accounts löschen
Wir freuen uns nicht, wenn Leute Friendica verlassen, aber wenn du deinen Account löschen willst, dann besuche die folgende URL
[Lösche mich (http://NamederSeite/removeme)](../removeme)
[Lösche mich (http://NamederSeite/settings/removeme)](../settings/removeme)
in deinem Webbrowser. Du musst dabei eingeloggt sein.

View File

@ -47,13 +47,3 @@ Wähle eine vorhandene Gruppe oder gib einen neuen Namen ein. Die erstellten Gru
<img src="doc/img/post_choose.png" width="27" height="32" alt="post_choose.png" align="left"> Mit diesem Symbol kannst du mehrere Beiträge auswählen und gesammelt löschen.
Hierfür gehst du nach dem Markieren aller gewünschten Beiträge auf "Lösche die markierten Beiträge" am Ende der Seite mit allen Beiträgen.
<P style="clear: both;"></p>
**Im Folgenden findest du Symbole weiterer Themen**
Darkbubble <img src="doc/img/darkbubble.png" alt="darkbubble.png" style="padding-left: 20px; vertical-align:middle;">
Darkzero <img src="doc/img/darkzero.png" alt="darkzero.png" style="padding-left: 35px; vertical-align:middle;">
<span style="padding-left: 10px; font-style:italic;">(inkl. weiterer "zero"-Themen, slackr, comix, easterbunny, facepark)</span>
Dispy <img src="doc/img/dispy.png" alt="dispy.png" style="padding-left: 57px; vertical-align:middle;"> <i>(inkl. smoothly, testbubble)</i>

View File

@ -9,35 +9,35 @@ Achtung: für dieses Beispiel wurde das Thema <b>"Diabook"</b> genutzt.
Wenn du ein anderes Design benutzt, wirst du manche dieser Symbole gar nicht oder in anderer Form vorfinden.
</span>
<img src="doc/img/friendica_editor.png" width="538" height="218" alt="editor">
<img src="doc/img/friendica_rich_editor.png" width="538" height="218" alt="editor">
<i>Die einzelnen Symbole</i>
<img src="doc/img/camera.png" width="44" height="33" alt="editor" align="left" style="padding-bottom: 20px;"> Wenn du auf dieses Symbol klickst, dann kannst du ein Bild von deinem Computer hinzufügen.
<img src="doc/img/camera.png" alt="editor" align="left" style="margin: 0 10px 10px 0;"> Wenn du auf dieses Symbol klickst, dann kannst du ein Bild von deinem Computer hinzufügen.
Wenn du eine Internetadresse (URL) eingeben willst, dann kannst du das "Baum"-Symbol im oberen Teil des Editors nutzen.
Wenn du ein Bild ausgewählt hast, dann erscheint eine Miniaturdarstellung des Bildes im Editor.*
<p style="clear:both;"></p>
<img src="doc/img/paper_clip.png" width="44" height="33" alt="paper_clip" align="left"> Wenn du dieses Symbol anklickst, dann kannst du weitere Dateien von deinem Computer einfügen. Eine Vorschau des Dateiinhalts erfolgt nicht.*
<img src="doc/img/paper_clip.png" alt="paper_clip" align="left" style="margin: 0 10px 10px 0;"> Wenn du dieses Symbol anklickst, dann kannst du weitere Dateien von deinem Computer einfügen. Eine Vorschau des Dateiinhalts erfolgt nicht.*
<p style="clear:both;"></p>
<img src="doc/img/chain.png" width="44" height="33" alt="chain" align="left"> Wenn du die Kette anklickst, dann kannst du eine Internetadresse (URL) einfügen.
<img src="doc/img/chain.png" alt="chain" align="left" style="margin: 0 10px 10px 0;"> Wenn du die Kette anklickst, dann kannst du eine Internetadresse (URL) einfügen.
Im Editor erscheint automatisch eine kurze Information zum eingefügten Link.*
<p style="clear:both;"></p>
<img src="doc/img/video.png" width="44" height="33" alt="video" align="left" style="padding-bottom: 40px;"> Mit dieser Funktion kannst du die Internetadresse (URL) einer Videodatei einfügen.
<img src="doc/img/video.png" alt="video" align="left" style="margin: 0 10px 10px 0;"> Mit dieser Funktion kannst du die Internetadresse (URL) einer Videodatei einfügen.
Das Video erscheint dann mit einem Player in deinem Beitrag.
Da Friendica zur Einbindung [HTML5](http://en.wikipedia.org/wiki/HTML5_video) verwendet, werden je nach Browser verschiedene Videoformate unterstützt (z.B. WebM oder MP4).
Außerdem kannst du hier die URLs von Videos auf Youtube, Vimeo und manchen anderen Videohostern eingeben.
Die Videos werden dann mit Vorschaubild angezeigt, nach einem Klick öffnet sich ein eingebetteter Player.*
<p style="clear:both;"></p>
<img src="doc/img/mic.png" width="44" height="33" alt="mic" align="left" style="padding-bottom: 40px;"> Mit dieser Funktion kannst du die Internetadresse (URL) einer Sound-Datei einfügen.
<img src="doc/img/mic.png" alt="mic" align="left" style="margin: 0 10px 10px 0;"> Mit dieser Funktion kannst du die Internetadresse (URL) einer Sound-Datei einfügen.
Da Friendica zur Einbindung [HTML5](http://en.wikipedia.org/wiki/HTML5_video) verwendet, werden je nach Browser und Betriebssystem MP3, Ogg oder AAC unterstützt.
Außerdem kannst du hier auch URLs von manchen Audiohostern wie Soundcloud eingeben, um eine dort gespeicherte Audiodatei mit Player in deinem Beitrag anzuzeigen.*
<p style="clear:both;"></p>
<img src="doc/img/globe.png" width="44" height="33" alt="globe" align="left"> Wenn du dieses Symbol wählst, dann kannst du deinen Standort festlegen.
<img src="doc/img/globe.png" alt="globe" align="left" style="margin: 0 10px 10px 0;"> Wenn du dieses Symbol wählst, dann kannst du deinen Standort festlegen.
Hier reicht schon eine Angabe wie "Berlin" oder "10775".
Dieser Eintrag führt anschließend zu einer Suchanfrage bei Google Maps.
<p style="clear:both;"></p>
@ -46,12 +46,6 @@ Dieser Eintrag führt anschließend zu einer Suchanfrage bei Google Maps.
**Im Folgenden findest du Symbole weiterer Themen**
Cleanzero <img src="doc/img/editor_zero.png" alt="cleanzero.png" style="padding-left: 20px; vertical-align:middle;">
<span style="padding-left: 10px; font-style:italic;">(inkl. weiterer "zero"-Themen, comix, easterbunny, facepark, slackr </span>
Darkbubble <img src="doc/img/editor_darkbubble.png" alt="darkbubble.png" style="padding-left: 14px; vertical-align:middle;"> <i>(inkl. smoothly, testbubble)</i>
Frio <img src="doc/img/editor_frio.png" alt="frio.png" style="padding-left: 44px; vertical-align:middle;">
Vier <img src="doc/img/editor_vier.png" alt="vier.png" style="padding-left: 44px; vertical-align:middle;"> <i>(inkl. dispy)</i>
Vier <img src="doc/img/editor_vier.png" alt="vier.png" style="padding-left: 44px; vertical-align:middle;">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -17,7 +17,7 @@ The below for a more detailed description of theme heritage.
Some themes also allow users to select *variants* of the theme.
Those theme variants most often contain an additional [CSS](https://en.wikipedia.org/wiki/CSS) file to override some styling of the default theme values.
From the themes in the main repository *duepunto zero* and *vier* are using this methods for variations.
From the themes in the main repository *vier* and *vier* are using this methods for variations.
Quattro is using a slightly different approach.
Third you can start your theme from scratch.
@ -60,145 +60,6 @@ they will be overwritten by files in
/view/theme/**your-theme-name**/js.
## Expand an existing Theme
### Theme Variations
Many themes are more *theme families* than only one theme.
*duepunto zero* and *vier* allow easily to add new theme variation.
We will go through the process of creating a new variation for *duepunto zero*.
The same (well almost, some names change) procedure applies to the *vier* theme.
And similar steps are needed for *quattro* but this theme is using [lesscss](http://lesscss.org/#docs) to maintain the CSS files..
In
/view/theme/duepuntozero/deriv
you find a couple of CSS files that define color derivations from the duepunto theme.
These resemble some of the now as unsupported marked themes, that were inherited by the duepunto theme.
Darkzero and Easter Bunny for example.
The selection of the colorset is done in a combination of a template for a new form in the settings and aome functions in the theme.php file.
The template (theme_settings.tpl)
{{include file="field_select.tpl" field=$colorset}}
<div class="settings-submit-wrapper">
<input type="submit" value="{{$submit}}" class="settings-submit" name="duepuntozero-settings-submit" />
</div>
defines a formular consisting of a [select](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select) pull-down which contains all aviable variants and s submit button.
See the documentation about [SMARTY3 templates](/help/snarty3-templates.md) for a summary of friendica specific blocks other than the select element.
But we don't really need to change anything at the template itself.
The template alone wont work though.
You make friendica aware of its existance and tell it how to use the template file, by defining a config.php file.
It needs to define at least the following functions
* theme_content
* theme_post
and may also define functions for the admin interface
* theme_admin
* theme_admin_post.
theme_content and theme_admin are used to make the form available in the settings, repectively the admin panel.
The _post functions handle the processing of the send form, in this case they save to selected variand in friendicas database.
To make your own variation appear in the menu, all you need to do is to create a new CSS file in the deriv directoy and include it in the array in the config.php:
$colorset = array(
'default'=>DI::l10n()->t('default'),
'greenzero'=>DI::l10n()->t('greenzero'),
'purplezero'=>DI::l10n()->t('purplezero'),
'easterbunny'=>DI::l10n()->t('easterbunny'),
'darkzero'=>DI::l10n()->t('darkzero'),
'comix'=>DI::l10n()->t('comix'),
'slackr'=>DI::l10n()->t('slackr'),
);
the 1st part of the line is the name of the CSS file (without the .css) the 2nd part is the common name of the variant.
Calling the DI::l10n()->t() function with the common name makes the string translateable.
The selected 1st part will be saved in the database by the theme_post function.
function theme_post(App $a){
// non local users shall not pass
if (! local_user()) {
return;
}
// if the one specific submit button was pressed then proceed
if (isset($_POST['duepuntozero-settings-submit'])){
// and save the selection key into the personal config of the user
DI::pConfig()->set(local_user(), 'duepuntozero', 'colorset', $_POST['duepuntozero_colorset']);
}
}
Now that this information is set in the database, what should friendica do with it?
For this, have a look at the theme.php file of the *duepunto zero*.
There you'll find somethink alike
$colorset = DI::pConfig()->get( local_user(), 'duepuntozero','colorset');
if (!$colorset)
$colorset = DI::config()->get('duepuntozero', 'colorset');
if ($colorset) {
if ($colorset == 'greenzero')
DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/greenzero.css" type="text/css" media="screen" />'."\n";
/* some more variants */
}
which tells friendica to get the personal config of a user.
Check if it is set and if not look for the global config.
And finally if a config for the colorset was found, apply it by adding a link to the CSS file into the HTML header of the page.
So you'll just need to add a if selection, fitting your variant keyword and link to the CSS file of it.
Done.
Now you can use the variant on your system.
But remember once the theme.php or the config.php you have to readd your variant to them.
If you think your color variation could be benifical for other friendica users as well, feel free to generate a pull request at github so we can include your work into the repository.
### Inheritation
Say, you like the duepuntozero but you want to have the content of the outer columns left and right exchanged.
That would be not a color variation as shown above.
Instead we will create a new theme, duepuntozero_lr, inherit the properties of duepuntozero and make small changes to the underlying php files.
So create a directory called duepunto_lr and create a file called theme.php with your favorite text editor.
The content of this file should be something like
<?php
/* meta informations for the theme, see below */
use Friendica\App;
function duepuntozero_lr_init(App $a) {
$a->setThemeInfoValue('extends', 'duepuntozero');
$a->set_template_engine('smarty3');
/* and more stuff e.g. the JavaScript function for the header */
}
Next take the default.php file found in the /view direcotry and exchange the aside and right_aside elements.
So the central part of the file now looks like this:
<body>
<?php if(!empty($page['nav'])) echo $page['nav']; ?>
<aside><?php if(!empty($page['right_aside'])) echo $page['right_aside']; ?></aside>
<section><?php if(!empty($page['content'])) echo $page['content']; ?>
<div id="page-footer"></div>
</section>
<right_aside><?php if(!empty($page['aside'])) echo $page['aside']; ?></right_aside>
<footer><?php if(!empty($page['footer'])) echo $page['footer']; ?></footer>
</body>
Finally we need a style.css file, inheriting the definitions from the parent theme and containing out changes for the new theme.
***Note***:You need to create the style.css and at lest import the base CSS file from the parent theme.
@import url('../duepuntozero/style.css');
Done.
But I agree it is not really useful at this state.
Nevertheless, to use it, you just need to activate in the admin panel.
That done, you can select it in the settings like any other activated theme.
## Creating a Theme from Scratch
Keep patient.
@ -231,15 +92,19 @@ Supported formats are PNG and JPEG.
This is the main definition file of the theme.
In the header of that file, some meta information is stored.
For example, have a look at the theme.php of the *quattro* theme:
For example, have a look at the theme.php of the *vier* theme:
<?php
/**
* Name: Quattro
* Version: 0.6
* [Licence]
*
* Name: Vier
* Version: 1.2
* Author: Fabio <http://kirgroup.com/profile/fabrixxm>
* Maintainer: Fabio <http://kirgroup.com/profile/fabrixxm>
* Maintainer: Tobias <https://f.diekershoff.de/profile/tobias>
* Author: Ike <http://pirati.ca/profile/heluecht>
* Author: Beanow <https://fc.oscp.info/profile/beanow>
* Maintainer: Ike <http://pirati.ca/profile/heluecht>
* Description: "Vier" is a very compact and modern theme. It uses the font awesome font library: http://fortawesome.github.com/Font-Awesome/
*/
You see the definition of the theme's name, it's version and the initial author of the theme.
@ -255,11 +120,11 @@ This will make our job a little easier, as we don't have to specify the full nam
The next crucial part of the theme.php file is a definition of an init function.
The name of the function is <theme-name>_init.
So in the case of quattro it is
So in the case of vier it is
function quattro_init(App $a) {
$a->theme_info = array();
$a->set_template_engine('smarty3');
function vier_init(App $a) {
$a->theme_info = array();
$a->set_template_engine('smarty3');
}
Here we have set the basic theme information, in this case they are empty.
@ -269,12 +134,6 @@ At the moment you should use the *smarty3* engine.
There once was a friendica specific templating engine as well but that is not used anymore.
If you like to use another templating engine, please implement it.
When you want to inherit stuff from another theme you have to *announce* this in the theme_info:
$a->setThemeInfoValue('extends', 'duepuntozero');
which declares *duepuntozero* as parent of the theme.
If you want to add something to the HTML header of the theme, one way to do so is by adding it to the theme.php file.
To do so, add something alike
@ -282,7 +141,6 @@ To do so, add something alike
/* stuff you want to add to the header */
EOT;
The $a variable holds the friendica application.
So you can access the properties of this friendica session from the theme.php file as well.
### default.php

View File

@ -1,298 +0,0 @@
<?php
/**
* @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* The calendar module
*
* This calendar is for profile visitors and contains only the events
* of the profile owner
*/
use Friendica\App;
use Friendica\Content\Nav;
use Friendica\Content\Widget;
use Friendica\Core\Renderer;
use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Event;
use Friendica\Model\Item;
use Friendica\Model\User;
use Friendica\Module\BaseProfile;
use Friendica\Module\Response;
use Friendica\Network\HTTPException;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Temporal;
function cal_init(App $a)
{
if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Access denied.'));
}
if (DI::args()->getArgc() < 2) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Access denied.'));
}
Nav::setSelected('events');
// if it's a json request abort here becaus we don't
// need the widget data
if (!empty(DI::args()->getArgv()[2]) && (DI::args()->getArgv()[2] === 'json')) {
return;
}
$owner = User::getOwnerDataByNick(DI::args()->getArgv()[1]);
if (empty($owner)) {
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
}
if (empty(DI::page()['aside'])) {
DI::page()['aside'] = '';
}
DI::page()['aside'] .= Widget\VCard::getHTML($owner);
DI::page()['aside'] .= Widget\CalendarExport::getHTML($owner['uid']);
return;
}
function cal_content(App $a)
{
$owner = User::getOwnerDataByNick(DI::args()->getArgv()[1]);
if (empty($owner)) {
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
}
Nav::setSelected('events');
// get the translation strings for the callendar
$i18n = Event::getStrings();
DI::page()->registerStylesheet('view/asset/fullcalendar/dist/fullcalendar.min.css');
DI::page()->registerStylesheet('view/asset/fullcalendar/dist/fullcalendar.print.min.css', 'print');
DI::page()->registerFooterScript('view/asset/moment/min/moment-with-locales.min.js');
DI::page()->registerFooterScript('view/asset/fullcalendar/dist/fullcalendar.min.js');
$htpl = Renderer::getMarkupTemplate('event_head.tpl');
DI::page()['htmlhead'] .= Renderer::replaceMacros($htpl, [
'$module_url' => '/cal/' . $owner['nickname'],
'$modparams' => 2,
'$i18n' => $i18n,
]);
$mode = 'view';
$y = 0;
$m = 0;
$ignored = (!empty($_REQUEST['ignored']) ? intval($_REQUEST['ignored']) : 0);
$format = 'ical';
if (DI::args()->getArgc() == 4 && DI::args()->getArgv()[2] == 'export') {
$mode = 'export';
$format = DI::args()->getArgv()[3];
}
// Setup permissions structures
$owner_uid = intval($owner['uid']);
$nick = $owner['nickname'];
$contact_id = Session::getRemoteContactID($owner['uid']);
$remote_contact = $contact_id && DBA::exists('contact', ['id' => $contact_id, 'uid' => $owner['uid']]);
$is_owner = local_user() == $owner['uid'];
if ($owner['hidewall'] && !$is_owner && !$remote_contact) {
notice(DI::l10n()->t('Access to this profile has been restricted.'));
return;
}
// get the permissions
$sql_perms = Item::getPermissionsSQLByUserId($owner_uid);
// we only want to have the events of the profile owner
$sql_extra = " AND `event`.`cid` = 0 " . $sql_perms;
// get the tab navigation bar
$tabs = BaseProfile::getTabsHTML($a, 'cal', false, $owner['nickname'], $owner['hide-friends']);
// The view mode part is similiar to /mod/events.php
if ($mode == 'view') {
$thisyear = DateTimeFormat::localNow('Y');
$thismonth = DateTimeFormat::localNow('m');
if (!$y) {
$y = intval($thisyear);
}
if (!$m) {
$m = intval($thismonth);
}
// Put some limits on dates. The PHP date functions don't seem to do so well before 1900.
// An upper limit was chosen to keep search engines from exploring links millions of years in the future.
if ($y < 1901) {
$y = 1900;
}
if ($y > 2099) {
$y = 2100;
}
$nextyear = $y;
$nextmonth = $m + 1;
if ($nextmonth > 12) {
$nextmonth = 1;
$nextyear ++;
}
$prevyear = $y;
if ($m > 1) {
$prevmonth = $m - 1;
} else {
$prevmonth = 12;
$prevyear --;
}
$dim = Temporal::getDaysInMonth($y, $m);
$start = sprintf('%d-%d-%d %d:%d:%d', $y, $m, 1, 0, 0, 0);
$finish = sprintf('%d-%d-%d %d:%d:%d', $y, $m, $dim, 23, 59, 59);
if (!empty(DI::args()->getArgv()[2]) && (DI::args()->getArgv()[2] === 'json')) {
if (!empty($_GET['start'])) {
$start = $_GET['start'];
}
if (!empty($_GET['end'])) {
$finish = $_GET['end'];
}
}
$start = DateTimeFormat::utc($start);
$finish = DateTimeFormat::utc($finish);
// put the event parametes in an array so we can better transmit them
$event_params = [
'event_id' => intval($_GET['id'] ?? 0),
'start' => $start,
'finish' => $finish,
'ignore' => $ignored,
];
// get events by id or by date
if ($event_params['event_id']) {
$r = Event::getListById($owner_uid, $event_params['event_id'], $sql_extra);
} else {
$r = Event::getListByDate($owner_uid, $event_params, $sql_extra);
}
$links = [];
if (DBA::isResult($r)) {
$r = Event::sortByDate($r);
foreach ($r as $rr) {
$j = DateTimeFormat::local($rr['start'], 'j');
if (empty($links[$j])) {
$links[$j] = DI::baseUrl() . '/' . DI::args()->getCommand() . '#link-' . $j;
}
}
}
// transform the event in a usable array
$events = Event::prepareListForTemplate($r);
if (!empty(DI::args()->getArgv()[2]) && (DI::args()->getArgv()[2] === 'json')) {
System::jsonExit($events);
}
// links: array('href', 'text', 'extra css classes', 'title')
if (!empty($_GET['id'])) {
$tpl = Renderer::getMarkupTemplate("event.tpl");
} else {
$tpl = Renderer::getMarkupTemplate("events_js.tpl");
}
// Get rid of dashes in key names, Smarty3 can't handle them
foreach ($events as $key => $event) {
$event_item = [];
foreach ($event['item'] as $k => $v) {
$k = str_replace('-', '_', $k);
$event_item[$k] = $v;
}
$events[$key]['item'] = $event_item;
}
$o = Renderer::replaceMacros($tpl, [
'$tabs' => $tabs,
'$title' => DI::l10n()->t('Events'),
'$view' => DI::l10n()->t('View'),
'$previous' => [DI::baseUrl() . "/events/$prevyear/$prevmonth", DI::l10n()->t('Previous'), '', ''],
'$next' => [DI::baseUrl() . "/events/$nextyear/$nextmonth", DI::l10n()->t('Next'), '', ''],
'$calendar' => Temporal::getCalendarTable($y, $m, $links, ' eventcal'),
'$events' => $events,
"today" => DI::l10n()->t("today"),
"month" => DI::l10n()->t("month"),
"week" => DI::l10n()->t("week"),
"day" => DI::l10n()->t("day"),
"list" => DI::l10n()->t("list"),
]);
if (!empty($_GET['id'])) {
System::httpExit($o);
}
return $o;
}
if ($mode == 'export') {
if (!$owner_uid) {
notice(DI::l10n()->t('User not found'));
return;
}
// Get the export data by uid
$evexport = Event::exportListByUserId($owner_uid, $format);
if (!$evexport["success"]) {
if ($evexport["content"]) {
notice(DI::l10n()->t('This calendar format is not supported'));
} else {
notice(DI::l10n()->t('No exportable data found'));
}
// If it the own calendar return to the events page
// otherwise to the profile calendar page
if (local_user() === $owner_uid) {
$return_path = "events";
} else {
$return_path = "cal/" . $nick;
}
DI::baseUrl()->redirect($return_path);
}
// If nothing went wrong we can echo the export content
if ($evexport["success"]) {
header('content-disposition: attachment; filename="' . DI::l10n()->t('calendar') . '-' . $nick . '.' . $evexport["extension"] . '"');
System::httpExit($evexport["content"], Response::TYPE_BLANK, 'text/calendar');
}
return;
}
}

View File

@ -1,371 +0,0 @@
<?php
/**
* @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
use Friendica\App;
use Friendica\Content\Text\BBCode;
use Friendica\Content\Widget;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Item;
use Friendica\Model\Post;
use Friendica\Model\User;
use Friendica\Module\ActivityPub\Objects;
use Friendica\Module\Response;
use Friendica\Network\HTTPException;
use Friendica\Protocol\ActivityPub;
use Friendica\Protocol\DFRN;
use Friendica\Protocol\Diaspora;
use Friendica\Util\DateTimeFormat;
function display_init(App $a)
{
if (ActivityPub::isRequest()) {
(new Objects(DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), $_SERVER, ['guid' => DI::args()->getArgv()[1] ?? null]))->run();
}
if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
return;
}
$nick = ((DI::args()->getArgc() > 1) ? DI::args()->getArgv()[1] : '');
$item = null;
$item_user = local_user();
$fields = ['uri-id', 'parent-uri-id', 'author-id', 'author-link', 'body', 'uid', 'guid', 'gravity'];
// If there is only one parameter, then check if this parameter could be a guid
if (DI::args()->getArgc() == 2) {
$nick = '';
// Does the local user have this item?
if (local_user()) {
$item = Post::selectFirstForUser(local_user(), $fields, ['guid' => DI::args()->getArgv()[1], 'uid' => local_user()]);
if (DBA::isResult($item)) {
$nick = $a->getLoggedInUserNickname();
}
}
// Is this item private but could be visible to the remove visitor?
if (!DBA::isResult($item) && remote_user()) {
$item = Post::selectFirst($fields, ['guid' => DI::args()->getArgv()[1], 'private' => Item::PRIVATE, 'origin' => true]);
if (DBA::isResult($item)) {
if (!Contact::isFollower(remote_user(), $item['uid'])) {
$item = null;
} else {
$item_user = $item['uid'];
}
}
}
// Is it an item with uid=0?
if (!DBA::isResult($item)) {
$item = Post::selectFirstForUser(local_user(), $fields, ['guid' => DI::args()->getArgv()[1], 'private' => [Item::PUBLIC, Item::UNLISTED], 'uid' => 0]);
}
} elseif (DI::args()->getArgc() >= 3 && $nick == 'feed-item') {
$uri_id = DI::args()->getArgv()[2];
if (substr($uri_id, -5) == '.atom') {
$uri_id = substr($uri_id, 0, -5);
}
$item = Post::selectFirstForUser(local_user(), $fields, ['uri-id' => $uri_id, 'private' => [Item::PUBLIC, Item::UNLISTED], 'uid' => 0]);
}
if (!DBA::isResult($item)) {
return;
}
if (DI::args()->getArgc() >= 3 && $nick == 'feed-item') {
displayShowFeed($item['uri-id'], $item['uid'], DI::args()->getArgc() > 3 && DI::args()->getArgv()[3] == 'conversation.atom');
}
if (!empty($_SERVER['HTTP_ACCEPT']) && strstr($_SERVER['HTTP_ACCEPT'], 'application/atom+xml')) {
Logger::debug('Directly serving XML', ['uri-id' => $item['uri-id']]);
displayShowFeed($item['uri-id'], $item['uid'], false);
}
if ($item['gravity'] != GRAVITY_PARENT) {
$parent = Post::selectFirstForUser($item_user, $fields, ['uid' => [0, $item_user], 'uri-id' => $item['parent-uri-id']], ['order' => ['uid' => true]]);
$item = $parent ?: $item;
}
$author = display_fetchauthor($item);
if (\Friendica\Util\Network::isLocalLink($author['url'])) {
\Friendica\Model\Profile::load(DI::app(), $author['nick'], false);
} else {
DI::page()['aside'] = Widget\VCard::getHTML($author);
}
$a->setProfileOwner($item['uid']);
}
function display_fetchauthor($item)
{
if (Diaspora::isReshare($item['body'], true)) {
$shared = Item::getShareArray($item);
if (!empty($shared['profile'])) {
$contact = Contact::getByURLForUser($shared['profile'], local_user());
}
}
if (empty($contact)) {
$contact = Contact::getById($item['author-id']);
}
return $contact;
}
function display_content(App $a, $update = false, $update_uid = 0)
{
if (DI::config()->get('system','block_public') && !Session::isAuthenticated()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Public access denied.'));
}
$o = '';
$item = null;
$force = (bool)($_REQUEST['force'] ?? false);
if ($update) {
$uri_id = $_REQUEST['uri_id'];
$item = Post::selectFirst(['uid', 'parent-uri-id'], ['uri-id' => $uri_id, 'uid' => [0, $update_uid]], ['order' => ['uid' => true]]);
if (!empty($item)) {
if ($item['uid'] != 0) {
$a->setProfileOwner($item['uid']);
} else {
$a->setProfileOwner($update_uid);
}
$parent_uri_id = $item['parent-uri-id'];
}
if (empty($_REQUEST['force'])) {
$browser_update = intval(DI::pConfig()->get($update_uid, 'system', 'update_interval'));
if (!empty($browser_update)) {
$update_date = date(DateTimeFormat::MYSQL, time() - ($browser_update / 500));
if (!Post::exists(["`parent-uri-id` = ? AND `uid` IN (?, ?) AND `received` > ?", $parent_uri_id, 0, $update_uid, $update_date])) {
Logger::debug('No updated content', ['uri-id' => $uri_id, 'uid' => $update_uid, 'updated' => $update_date]);
return '';
} else {
Logger::debug('Updated content found', ['uri-id' => $uri_id, 'uid' => $update_uid, 'updated' => $update_date]);
}
}
} else {
Logger::debug('Forced content update', ['uri-id' => $uri_id, 'uid' => $update_uid]);
}
} else {
$uri_id = ((DI::args()->getArgc() > 2) ? DI::args()->getArgv()[2] : 0);
$parent_uri_id = $uri_id;
if (DI::args()->getArgc() == 2) {
$fields = ['uri-id', 'parent-uri-id', 'uid'];
if (local_user()) {
$condition = ['guid' => DI::args()->getArgv()[1], 'uid' => [0, local_user()]];
$item = Post::selectFirstForUser(local_user(), $fields, $condition, ['order' => ['uid' => true]]);
if (DBA::isResult($item)) {
$uri_id = $item['uri-id'];
$parent_uri_id = $item['parent-uri-id'];
}
}
if (($parent_uri_id == 0) && remote_user()) {
$item = Post::selectFirst($fields, ['guid' => DI::args()->getArgv()[1], 'private' => Item::PRIVATE, 'origin' => true]);
if (DBA::isResult($item) && Contact::isFollower(remote_user(), $item['uid'])) {
$uri_id = $item['uri-id'];
$parent_uri_id = $item['parent-uri-id'];
}
}
if ($parent_uri_id == 0) {
$condition = ['private' => [Item::PUBLIC, Item::UNLISTED], 'guid' => DI::args()->getArgv()[1], 'uid' => 0];
$item = Post::selectFirstForUser(local_user(), $fields, $condition);
if (DBA::isResult($item)) {
$uri_id = $item['uri-id'];
$parent_uri_id = $item['parent-uri-id'];
}
}
}
}
if (empty($item)) {
throw new HTTPException\NotFoundException(DI::l10n()->t('The requested item doesn\'t exist or has been deleted.'));
}
if (!DI::pConfig()->get(local_user(), 'system', 'detailed_notif')) {
DI::notification()->setAllSeenForUser(local_user(), ['parent-uri-id' => $item['parent-uri-id']]);
DI::notify()->setAllSeenForUser(local_user(), ['parent-uri-id' => $item['parent-uri-id']]);
}
// We are displaying an "alternate" link if that post was public. See issue 2864
$is_public = Post::exists(['uri-id' => $uri_id, 'private' => [Item::PUBLIC, Item::UNLISTED]]);
if ($is_public) {
// For the atom feed the nickname doesn't matter at all, we only need the item id.
$alternate = DI::baseUrl().'/display/feed-item/'.$uri_id.'.atom';
$conversation = DI::baseUrl().'/display/feed-item/' . $parent_uri_id . '/conversation.atom';
} else {
$alternate = '';
$conversation = '';
}
DI::page()['htmlhead'] .= Renderer::replaceMacros(Renderer::getMarkupTemplate('display-head.tpl'),
['$alternate' => $alternate,
'$conversation' => $conversation]);
$is_remote_contact = false;
$item_uid = local_user();
$page_uid = 0;
$parent = null;
if (!local_user() && !empty($parent_uri_id)) {
$parent = Post::selectFirst(['uid'], ['uri-id' => $parent_uri_id, 'wall' => true]);
}
if (DBA::isResult($parent)) {
$page_uid = $page_uid ?? 0 ?: $parent['uid'];
$is_remote_contact = Session::getRemoteContactID($page_uid);
if ($is_remote_contact) {
$item_uid = $parent['uid'];
}
} else {
$page_uid = $item['uid'];
}
if (!empty($page_uid) && ($page_uid != local_user())) {
$page_user = User::getById($page_uid);
}
$is_owner = local_user() && (in_array($page_uid, [local_user(), 0]));
if (!empty($page_user['hidewall']) && !$is_owner && !$is_remote_contact) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Access to this profile has been restricted.'));
}
// We need the editor here to be able to reshare an item.
if ($is_owner && !$update) {
$o .= DI::conversation()->statusEditor([], 0, true);
}
$sql_extra = Item::getPermissionsSQLByUserId($page_uid);
if (local_user() && (local_user() == $page_uid)) {
$condition = ['parent-uri-id' => $parent_uri_id, 'uid' => local_user(), 'unseen' => true];
$unseen = Post::exists($condition);
} else {
$unseen = false;
}
if ($update && !$unseen && !$force) {
return '';
}
$condition = ["`uri-id` = ? AND `uid` IN (0, ?) " . $sql_extra, $uri_id, $item_uid];
$fields = ['parent-uri-id', 'body', 'title', 'author-name', 'author-avatar', 'plink', 'author-id', 'owner-id', 'contact-id'];
$item = Post::selectFirstForUser($page_uid, $fields, $condition);
if (!DBA::isResult($item)) {
throw new HTTPException\NotFoundException(DI::l10n()->t('The requested item doesn\'t exist or has been deleted.'));
}
$item['uri-id'] = $item['parent-uri-id'];
if ($unseen) {
$condition = ['parent-uri-id' => $parent_uri_id, 'uid' => local_user(), 'unseen' => true];
Item::update(['unseen' => false], $condition);
}
if (!$update && local_user()) {
$o .= "<script> var netargs = '?uri_id=" . $item['uri-id'] . "'; </script>";
}
$o .= DI::conversation()->create([$item], 'display', $update_uid, false, 'commented', $item_uid);
// Preparing the meta header
$description = trim(BBCode::toPlaintext($item['body']));
$title = trim(BBCode::toPlaintext($item['title'] ?? ''));
$author_name = $item['author-name'];
$image = DI::baseUrl()->remove($item['author-avatar']);
if ($title == '') {
$title = $author_name;
}
// Limit the description to 160 characters
if (strlen($description) > 160) {
$description = substr($description, 0, 157) . '...';
}
$description = htmlspecialchars($description, ENT_COMPAT, 'UTF-8', true); // allow double encoding here
$title = htmlspecialchars($title, ENT_COMPAT, 'UTF-8', true); // allow double encoding here
$author_name = htmlspecialchars($author_name, ENT_COMPAT, 'UTF-8', true); // allow double encoding here
$page = DI::page();
if (DBA::exists('contact', ['unsearchable' => true, 'id' => [$item['contact-id'], $item['author-id'], $item['owner-id']]])) {
$page['htmlhead'] .= '<meta content="noindex, noarchive" name="robots" />' . "\n";
}
DI::page()['htmlhead'] .= '<meta name="author" content="'.$author_name.'" />'."\n";
$page['htmlhead'] .= '<meta name="title" content="'.$title.'" />'."\n";
$page['htmlhead'] .= '<meta name="fulltitle" content="'.$title.'" />'."\n";
$page['htmlhead'] .= '<meta name="description" content="'.$description.'" />'."\n";
// Schema.org microdata
$page['htmlhead'] .= '<meta itemprop="name" content="'.$title.'" />'."\n";
$page['htmlhead'] .= '<meta itemprop="description" content="'.$description.'" />'."\n";
$page['htmlhead'] .= '<meta itemprop="image" content="'.$image.'" />'."\n";
$page['htmlhead'] .= '<meta itemprop="author" content="'.$author_name.'" />'."\n";
// Twitter cards
$page['htmlhead'] .= '<meta name="twitter:card" content="summary" />'."\n";
$page['htmlhead'] .= '<meta name="twitter:title" content="'.$title.'" />'."\n";
$page['htmlhead'] .= '<meta name="twitter:description" content="'.$description.'" />'."\n";
$page['htmlhead'] .= '<meta name="twitter:image" content="'.DI::baseUrl().'/'.$image.'" />'."\n";
$page['htmlhead'] .= '<meta name="twitter:url" content="'.$item["plink"].'" />'."\n";
// Dublin Core
$page['htmlhead'] .= '<meta name="DC.title" content="'.$title.'" />'."\n";
$page['htmlhead'] .= '<meta name="DC.description" content="'.$description.'" />'."\n";
// Open Graph
$page['htmlhead'] .= '<meta property="og:type" content="website" />'."\n";
$page['htmlhead'] .= '<meta property="og:title" content="'.$title.'" />'."\n";
$page['htmlhead'] .= '<meta property="og:image" content="'.DI::baseUrl().'/'.$image.'" />'."\n";
$page['htmlhead'] .= '<meta property="og:url" content="'.$item["plink"].'" />'."\n";
$page['htmlhead'] .= '<meta property="og:description" content="'.$description.'" />'."\n";
$page['htmlhead'] .= '<meta name="og:article:author" content="'.$author_name.'" />'."\n";
// article:tag
return $o;
}
function displayShowFeed(int $uri_id, int $uid, bool $conversation)
{
$xml = DFRN::itemFeed($uri_id, $uid, $conversation);
if ($xml == '') {
throw new HTTPException\InternalServerErrorException(DI::l10n()->t('The feed for this item is unavailable.'));
}
System::httpExit($xml, Response::TYPE_ATOM);
}

View File

@ -1,166 +0,0 @@
<?php
/**
* @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
use Friendica\App;
use Friendica\Content\Feature;
use Friendica\Core\Hook;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Post;
use Friendica\Model\User;
use Friendica\Util\Crypto;
function editpost_content(App $a)
{
$o = '';
if (!local_user()) {
notice(DI::l10n()->t('Permission denied.'));
return;
}
$post_id = ((DI::args()->getArgc() > 1) ? intval(DI::args()->getArgv()[1]) : 0);
if (!$post_id) {
notice(DI::l10n()->t('Item not found'));
return;
}
$fields = ['allow_cid', 'allow_gid', 'deny_cid', 'deny_gid',
'body', 'title', 'uri-id', 'wall', 'post-type', 'guid'];
$item = Post::selectFirstForUser(local_user(), $fields, ['id' => $post_id, 'uid' => local_user()]);
if (!DBA::isResult($item)) {
notice(DI::l10n()->t('Item not found'));
return;
}
$user = User::getById(local_user());
$geotag = '';
$o .= Renderer::replaceMacros(Renderer::getMarkupTemplate("section_title.tpl"), [
'$title' => DI::l10n()->t('Edit post')
]);
$tpl = Renderer::getMarkupTemplate('jot-header.tpl');
DI::page()['htmlhead'] .= Renderer::replaceMacros($tpl, [
'$ispublic' => '&nbsp;', // DI::l10n()->t('Visible to <strong>everybody</strong>'),
'$geotag' => $geotag,
'$nickname' => $a->getLoggedInUserNickname(),
'$is_mobile' => DI::mode()->isMobile(),
]);
if (strlen($item['allow_cid']) || strlen($item['allow_gid']) || strlen($item['deny_cid']) || strlen($item['deny_gid'])) {
$lockstate = 'lock';
} else {
$lockstate = 'unlock';
}
$jotplugins = '';
$jotnets = '';
Hook::callAll('jot_tool', $jotplugins);
$tpl = Renderer::getMarkupTemplate('jot.tpl');
$o .= Renderer::replaceMacros($tpl, [
'$is_edit' => true,
'$return_path' => '/display/' . $item['guid'],
'$action' => 'item',
'$share' => DI::l10n()->t('Save'),
'$loading' => DI::l10n()->t('Loading...'),
'$upload' => DI::l10n()->t('Upload photo'),
'$shortupload' => DI::l10n()->t('upload photo'),
'$attach' => DI::l10n()->t('Attach file'),
'$shortattach' => DI::l10n()->t('attach file'),
'$weblink' => DI::l10n()->t('Insert web link'),
'$shortweblink' => DI::l10n()->t('web link'),
'$video' => DI::l10n()->t('Insert video link'),
'$shortvideo' => DI::l10n()->t('video link'),
'$audio' => DI::l10n()->t('Insert audio link'),
'$shortaudio' => DI::l10n()->t('audio link'),
'$setloc' => DI::l10n()->t('Set your location'),
'$shortsetloc' => DI::l10n()->t('set location'),
'$noloc' => DI::l10n()->t('Clear browser location'),
'$shortnoloc' => DI::l10n()->t('clear location'),
'$wait' => DI::l10n()->t('Please wait'),
'$permset' => DI::l10n()->t('Permission settings'),
'$wall' => $item['wall'],
'$posttype' => $item['post-type'],
'$content' => undo_post_tagging($item['body']),
'$post_id' => $post_id,
'$defloc' => $user['default-location'],
'$visitor' => 'none',
'$pvisit' => 'none',
'$emailcc' => DI::l10n()->t('CC: email addresses'),
'$public' => DI::l10n()->t('Public post'),
'$jotnets' => $jotnets,
'$title' => $item['title'],
'$placeholdertitle' => DI::l10n()->t('Set title'),
'$category' => Post\Category::getCSVByURIId($item['uri-id'], local_user(), Post\Category::CATEGORY),
'$placeholdercategory' => (Feature::isEnabled(local_user(),'categories') ? DI::l10n()->t("Categories \x28comma-separated list\x29") : ''),
'$emtitle' => DI::l10n()->t('Example: bob@example.com, mary@example.com'),
'$lockstate' => $lockstate,
'$acl' => '', // populate_acl((($group) ? $group_acl : $a->user)),
'$bang' => ($lockstate === 'lock' ? '!' : ''),
'$profile_uid' => $_SESSION['uid'],
'$preview' => DI::l10n()->t('Preview'),
'$jotplugins' => $jotplugins,
'$cancel' => DI::l10n()->t('Cancel'),
'$rand_num' => Crypto::randomDigits(12),
// Formatting button labels
'$edbold' => DI::l10n()->t('Bold'),
'$editalic' => DI::l10n()->t('Italic'),
'$eduline' => DI::l10n()->t('Underline'),
'$edquote' => DI::l10n()->t('Quote'),
'$edcode' => DI::l10n()->t('Code'),
'$edurl' => DI::l10n()->t('Link'),
'$edattach' => DI::l10n()->t('Link or Media'),
//jot nav tab (used in some themes)
'$message' => DI::l10n()->t('Message'),
'$browser' => DI::l10n()->t('Browser'),
'$shortpermset' => DI::l10n()->t('Permissions'),
'$compose_link_title' => DI::l10n()->t('Open Compose page'),
]);
return $o;
}
function undo_post_tagging($s) {
$matches = null;
$cnt = preg_match_all('/([!#@])\[url=(.*?)\](.*?)\[\/url\]/ism', $s, $matches, PREG_SET_ORDER);
if ($cnt) {
foreach ($matches as $mtch) {
if (in_array($mtch[1], ['!', '@'])) {
$contact = Contact::getByURL($mtch[2], false, ['addr']);
$mtch[3] = empty($contact['addr']) ? $mtch[2] : $contact['addr'];
}
$s = str_replace($mtch[0], $mtch[1] . $mtch[3],$s);
}
}
return $s;
}

View File

@ -1,539 +0,0 @@
<?php
/**
* @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* The events module
*/
use Friendica\App;
use Friendica\Content\Nav;
use Friendica\Content\Widget\CalendarExport;
use Friendica\Core\ACL;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
use Friendica\Core\System;
use Friendica\Core\Theme;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Conversation;
use Friendica\Model\Event;
use Friendica\Model\Item;
use Friendica\Model\Post;
use Friendica\Model\User;
use Friendica\Module\BaseProfile;
use Friendica\Module\Security\Login;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Strings;
use Friendica\Util\Temporal;
use Friendica\Worker\Delivery;
function events_init(App $a)
{
if (!local_user()) {
return;
}
if (empty(DI::page()['aside'])) {
DI::page()['aside'] = '';
}
$cal_widget = CalendarExport::getHTML(local_user());
DI::page()['aside'] .= $cal_widget;
return;
}
function events_post(App $a)
{
Logger::debug('post', ['request' => $_REQUEST]);
if (!local_user()) {
return;
}
$event_id = !empty($_POST['event_id']) ? intval($_POST['event_id']) : 0;
$cid = !empty($_POST['cid']) ? intval($_POST['cid']) : 0;
$uid = local_user();
$start_text = Strings::escapeHtml($_REQUEST['start_text'] ?? '');
$finish_text = Strings::escapeHtml($_REQUEST['finish_text'] ?? '');
$nofinish = intval($_POST['nofinish'] ?? 0);
$share = intval($_POST['share'] ?? 0);
// The default setting for the `private` field in event_store() is false, so mirror that
$private_event = false;
$start = DBA::NULL_DATETIME;
$finish = DBA::NULL_DATETIME;
if ($start_text) {
$start = $start_text;
}
if ($finish_text) {
$finish = $finish_text;
}
$start = DateTimeFormat::convert($start, 'UTC', $a->getTimeZone());
if (!$nofinish) {
$finish = DateTimeFormat::convert($finish, 'UTC', $a->getTimeZone());
}
// Don't allow the event to finish before it begins.
// It won't hurt anything, but somebody will file a bug report
// and we'll waste a bunch of time responding to it. Time that
// could've been spent doing something else.
$summary = trim($_POST['summary'] ?? '');
$desc = trim($_POST['desc'] ?? '');
$location = trim($_POST['location'] ?? '');
$type = 'event';
$params = [
'summary' => $summary,
'description' => $desc,
'location' => $location,
'start' => $start_text,
'finish' => $finish_text,
'nofinish' => $nofinish,
];
$action = ($event_id == '') ? 'new' : 'event/' . $event_id;
$onerror_path = 'events/' . $action . '?' . http_build_query($params, '', '&', PHP_QUERY_RFC3986);
if (strcmp($finish, $start) < 0 && !$nofinish) {
notice(DI::l10n()->t('Event can not end before it has started.'));
if (intval($_REQUEST['preview'])) {
System::httpExit(DI::l10n()->t('Event can not end before it has started.'));
}
DI::baseUrl()->redirect($onerror_path);
}
if (!$summary || ($start === DBA::NULL_DATETIME)) {
notice(DI::l10n()->t('Event title and start time are required.'));
if (intval($_REQUEST['preview'])) {
System::httpExit(DI::l10n()->t('Event title and start time are required.'));
}
DI::baseUrl()->redirect($onerror_path);
}
$self = \Friendica\Model\Contact::getPublicIdByUserId($uid);
$aclFormatter = DI::aclFormatter();
if ($share) {
$user = User::getById($uid, ['allow_cid', 'allow_gid', 'deny_cid', 'deny_gid']);
if (!DBA::isResult($user)) {
return;
}
$str_contact_allow = isset($_REQUEST['contact_allow']) ? $aclFormatter->toString($_REQUEST['contact_allow']) : $user['allow_cid'] ?? '';
$str_group_allow = isset($_REQUEST['group_allow']) ? $aclFormatter->toString($_REQUEST['group_allow']) : $user['allow_gid'] ?? '';
$str_contact_deny = isset($_REQUEST['contact_deny']) ? $aclFormatter->toString($_REQUEST['contact_deny']) : $user['deny_cid'] ?? '';
$str_group_deny = isset($_REQUEST['group_deny']) ? $aclFormatter->toString($_REQUEST['group_deny']) : $user['deny_gid'] ?? '';
$visibility = $_REQUEST['visibility'] ?? '';
if ($visibility === 'public') {
// The ACL selector introduced in version 2019.12 sends ACL input data even when the Public visibility is selected
$str_contact_allow = $str_group_allow = $str_contact_deny = $str_group_deny = '';
} else if ($visibility === 'custom') {
// Since we know from the visibility parameter the item should be private, we have to prevent the empty ACL
// case that would make it public. So we always append the author's contact id to the allowed contacts.
// See https://github.com/friendica/friendica/issues/9672
$str_contact_allow .= $aclFormatter->toString($self);
}
} else {
$str_contact_allow = $aclFormatter->toString($self);
$str_group_allow = $str_contact_deny = $str_group_deny = '';
}
// Make sure to set the `private` field as true. This is necessary to
// have the posts show up correctly in Diaspora if an event is created
// as visible only to self at first, but then edited to display to others.
if (strlen($str_group_allow) || strlen($str_contact_allow) || strlen($str_group_deny) || strlen($str_contact_deny)) {
$private_event = true;
}
$datarray = [];
$datarray['start'] = $start;
$datarray['finish'] = $finish;
$datarray['summary'] = $summary;
$datarray['desc'] = $desc;
$datarray['location'] = $location;
$datarray['type'] = $type;
$datarray['nofinish'] = $nofinish;
$datarray['uid'] = $uid;
$datarray['cid'] = $cid;
$datarray['allow_cid'] = $str_contact_allow;
$datarray['allow_gid'] = $str_group_allow;
$datarray['deny_cid'] = $str_contact_deny;
$datarray['deny_gid'] = $str_group_deny;
$datarray['private'] = $private_event;
$datarray['id'] = $event_id;
if (intval($_REQUEST['preview'])) {
System::httpExit(Event::getHTML($datarray));
}
$event_id = Event::store($datarray);
$item = ['network' => Protocol::DFRN, 'protocol' => Conversation::PARCEL_DIRECT, 'direction' => Conversation::PUSH];
$item = Event::getItemArrayForId($event_id, $item);
if (Item::insert($item)) {
$uri_id = $item['uri-id'];
} else {
$uri_id = 0;
}
if (!$cid && $uri_id) {
Worker::add(PRIORITY_HIGH, "Notifier", Delivery::POST, (int)$uri_id, (int)$uid);
}
DI::baseUrl()->redirect('events');
}
function events_content(App $a)
{
if (!local_user()) {
notice(DI::l10n()->t('Permission denied.'));
return Login::form();
}
if (DI::args()->getArgc() == 1) {
$_SESSION['return_path'] = DI::args()->getCommand();
}
if ((DI::args()->getArgc() > 2) && (DI::args()->getArgv()[1] === 'ignore') && intval(DI::args()->getArgv()[2])) {
DBA::update('event', ['ignore' => true], ['id' => DI::args()->getArgv()[2], 'uid' => local_user()]);
}
if ((DI::args()->getArgc() > 2) && (DI::args()->getArgv()[1] === 'unignore') && intval(DI::args()->getArgv()[2])) {
DBA::update('event', ['ignore' => false], ['id' => DI::args()->getArgv()[2], 'uid' => local_user()]);
}
if ($a->getThemeInfoValue('events_in_profile')) {
Nav::setSelected('home');
} else {
Nav::setSelected('events');
}
// get the translation strings for the callendar
$i18n = Event::getStrings();
DI::page()->registerStylesheet('view/asset/fullcalendar/dist/fullcalendar.min.css');
DI::page()->registerStylesheet('view/asset/fullcalendar/dist/fullcalendar.print.min.css', 'print');
DI::page()->registerFooterScript('view/asset/moment/min/moment-with-locales.min.js');
DI::page()->registerFooterScript('view/asset/fullcalendar/dist/fullcalendar.min.js');
$htpl = Renderer::getMarkupTemplate('event_head.tpl');
DI::page()['htmlhead'] .= Renderer::replaceMacros($htpl, [
'$module_url' => '/events',
'$modparams' => 1,
'$i18n' => $i18n,
]);
$o = '';
$tabs = '';
// tabs
if ($a->getThemeInfoValue('events_in_profile')) {
$tabs = BaseProfile::getTabsHTML($a, 'events', true, $a->getLoggedInUserNickname(), false);
}
$mode = 'view';
$y = 0;
$m = 0;
$ignored = !empty($_REQUEST['ignored']) ? intval($_REQUEST['ignored']) : 0;
if (DI::args()->getArgc() > 1) {
if (DI::args()->getArgc() > 2 && DI::args()->getArgv()[1] == 'event') {
$mode = 'edit';
$event_id = intval(DI::args()->getArgv()[2]);
}
if (DI::args()->getArgc() > 2 && DI::args()->getArgv()[1] == 'drop') {
$mode = 'drop';
$event_id = intval(DI::args()->getArgv()[2]);
}
if (DI::args()->getArgc() > 2 && DI::args()->getArgv()[1] == 'copy') {
$mode = 'copy';
$event_id = intval(DI::args()->getArgv()[2]);
}
if (DI::args()->getArgv()[1] === 'new') {
$mode = 'new';
$event_id = 0;
}
if (DI::args()->getArgc() > 2 && intval(DI::args()->getArgv()[1]) && intval(DI::args()->getArgv()[2])) {
$mode = 'view';
$y = intval(DI::args()->getArgv()[1]);
$m = intval(DI::args()->getArgv()[2]);
}
}
// The view mode part is similiar to /mod/cal.php
if ($mode == 'view') {
$thisyear = DateTimeFormat::localNow('Y');
$thismonth = DateTimeFormat::localNow('m');
if (!$y) {
$y = intval($thisyear);
}
if (!$m) {
$m = intval($thismonth);
}
// Put some limits on dates. The PHP date functions don't seem to do so well before 1900.
// An upper limit was chosen to keep search engines from exploring links millions of years in the future.
if ($y < 1901) {
$y = 1900;
}
if ($y > 2099) {
$y = 2100;
}
$dim = Temporal::getDaysInMonth($y, $m);
$start = sprintf('%d-%d-%d %d:%d:%d', $y, $m, 1, 0, 0, 0);
$finish = sprintf('%d-%d-%d %d:%d:%d', $y, $m, $dim, 23, 59, 59);
// put the event parametes in an array so we can better transmit them
$event_params = [
'event_id' => intval($_GET['id'] ?? 0),
'start' => $start,
'finish' => $finish,
'ignore' => $ignored,
];
// get events by id or by date
if ($event_params['event_id']) {
$r = Event::getListById(local_user(), $event_params['event_id']);
} else {
$r = Event::getListByDate(local_user(), $event_params);
}
$links = [];
if (DBA::isResult($r)) {
$r = Event::sortByDate($r);
foreach ($r as $rr) {
$j = DateTimeFormat::local($rr['start'], 'j');
if (empty($links[$j])) {
$links[$j] = DI::baseUrl() . '/' . DI::args()->getCommand() . '#link-' . $j;
}
}
}
$events = [];
// transform the event in a usable array
if (DBA::isResult($r)) {
$r = Event::sortByDate($r);
$events = Event::prepareListForTemplate($r);
}
if (!empty($_GET['id'])) {
$tpl = Renderer::getMarkupTemplate("event.tpl");
} else {
$tpl = Renderer::getMarkupTemplate("events_js.tpl");
}
// Get rid of dashes in key names, Smarty3 can't handle them
foreach ($events as $key => $event) {
$event_item = [];
foreach ($event['item'] as $k => $v) {
$k = str_replace('-', '_', $k);
$event_item[$k] = $v;
}
$events[$key]['item'] = $event_item;
}
// ACL blocks are loaded in modals in frio
DI::page()->registerFooterScript(Theme::getPathForFile('asset/typeahead.js/dist/typeahead.bundle.js'));
DI::page()->registerFooterScript(Theme::getPathForFile('js/friendica-tagsinput/friendica-tagsinput.js'));
DI::page()->registerStylesheet(Theme::getPathForFile('js/friendica-tagsinput/friendica-tagsinput.css'));
DI::page()->registerStylesheet(Theme::getPathForFile('js/friendica-tagsinput/friendica-tagsinput-typeahead.css'));
$o = Renderer::replaceMacros($tpl, [
'$tabs' => $tabs,
'$title' => DI::l10n()->t('Events'),
'$view' => DI::l10n()->t('View'),
'$new_event' => [DI::baseUrl() . '/events/new', DI::l10n()->t('Create New Event'), '', ''],
'$previous' => [DI::baseUrl() . '/events/$prevyear/$prevmonth', DI::l10n()->t('Previous'), '', ''],
'$next' => [DI::baseUrl() . '/events/$nextyear/$nextmonth', DI::l10n()->t('Next'), '', ''],
'$calendar' => Temporal::getCalendarTable($y, $m, $links, ' eventcal'),
'$events' => $events,
'$today' => DI::l10n()->t('today'),
'$month' => DI::l10n()->t('month'),
'$week' => DI::l10n()->t('week'),
'$day' => DI::l10n()->t('day'),
'$list' => DI::l10n()->t('list'),
]);
if (!empty($_GET['id'])) {
System::httpExit($o);
}
return $o;
}
if (($mode === 'edit' || $mode === 'copy') && $event_id) {
$orig_event = DBA::selectFirst('event', [], ['id' => $event_id, 'uid' => local_user()]);
}
// Passed parameters overrides anything found in the DB
if (in_array($mode, ['edit', 'new', 'copy'])) {
$share_checked = '';
$share_disabled = '';
if (empty($orig_event)) {
$orig_event = User::getById(local_user(), ['allow_cid', 'allow_gid', 'deny_cid', 'deny_gid']);;
} elseif ($orig_event['allow_cid'] !== '<' . local_user() . '>'
|| $orig_event['allow_gid']
|| $orig_event['deny_cid']
|| $orig_event['deny_gid']) {
$share_checked = ' checked="checked" ';
}
// In case of an error the browser is redirected back here, with these parameters filled in with the previous values
if (!empty($_REQUEST['nofinish'])) {$orig_event['nofinish'] = $_REQUEST['nofinish'];}
if (!empty($_REQUEST['summary'])) {$orig_event['summary'] = $_REQUEST['summary'];}
if (!empty($_REQUEST['desc'])) {$orig_event['desc'] = $_REQUEST['desc'];}
if (!empty($_REQUEST['location'])) {$orig_event['location'] = $_REQUEST['location'];}
if (!empty($_REQUEST['start'])) {$orig_event['start'] = $_REQUEST['start'];}
if (!empty($_REQUEST['finish'])) {$orig_event['finish'] = $_REQUEST['finish'];}
$n_checked = (!empty($orig_event['nofinish']) ? ' checked="checked" ' : '');
$t_orig = $orig_event['summary'] ?? '';
$d_orig = $orig_event['desc'] ?? '';
$l_orig = $orig_event['location'] ?? '';
$eid = $orig_event['id'] ?? 0;
$cid = $orig_event['cid'] ?? 0;
$uri = $orig_event['uri'] ?? '';
if ($cid || $mode === 'edit') {
$share_disabled = 'disabled="disabled"';
}
$sdt = $orig_event['start'] ?? 'now';
$fdt = $orig_event['finish'] ?? 'now';
$syear = DateTimeFormat::local($sdt, 'Y');
$smonth = DateTimeFormat::local($sdt, 'm');
$sday = DateTimeFormat::local($sdt, 'd');
$shour = !empty($orig_event) ? DateTimeFormat::local($sdt, 'H') : '00';
$sminute = !empty($orig_event) ? DateTimeFormat::local($sdt, 'i') : '00';
$fyear = DateTimeFormat::local($fdt, 'Y');
$fmonth = DateTimeFormat::local($fdt, 'm');
$fday = DateTimeFormat::local($fdt, 'd');
$fhour = !empty($orig_event) ? DateTimeFormat::local($fdt, 'H') : '00';
$fminute = !empty($orig_event) ? DateTimeFormat::local($fdt, 'i') : '00';
if (!$cid && in_array($mode, ['new', 'copy'])) {
$acl = ACL::getFullSelectorHTML(DI::page(), $a->getLoggedInUserId(), false, ACL::getDefaultUserPermissions($orig_event));
} else {
$acl = '';
}
// If we copy an old event, we need to remove the ID and URI
// from the original event.
if ($mode === 'copy') {
$eid = 0;
$uri = '';
}
$tpl = Renderer::getMarkupTemplate('event_form.tpl');
$o .= Renderer::replaceMacros($tpl, [
'$post' => DI::baseUrl() . '/events',
'$eid' => $eid,
'$cid' => $cid,
'$uri' => $uri,
'$title' => DI::l10n()->t('Event details'),
'$desc' => DI::l10n()->t('Starting date and Title are required.'),
'$s_text' => DI::l10n()->t('Event Starts:') . ' <span class="required" title="' . DI::l10n()->t('Required') . '">*</span>',
'$s_dsel' => Temporal::getDateTimeField(
new DateTime(),
DateTime::createFromFormat('Y', intval($syear) + 5),
DateTime::createFromFormat('Y-m-d H:i', "$syear-$smonth-$sday $shour:$sminute"),
DI::l10n()->t('Event Starts:'),
'start_text',
true,
true,
'',
'',
true
),
'$n_text' => DI::l10n()->t('Finish date/time is not known or not relevant'),
'$n_checked' => $n_checked,
'$f_text' => DI::l10n()->t('Event Finishes:'),
'$f_dsel' => Temporal::getDateTimeField(
new DateTime(),
DateTime::createFromFormat('Y', intval($fyear) + 5),
DateTime::createFromFormat('Y-m-d H:i', "$fyear-$fmonth-$fday $fhour:$fminute"),
DI::l10n()->t('Event Finishes:'),
'finish_text',
true,
true,
'start_text'
),
'$d_text' => DI::l10n()->t('Description:'),
'$d_orig' => $d_orig,
'$l_text' => DI::l10n()->t('Location:'),
'$l_orig' => $l_orig,
'$t_text' => DI::l10n()->t('Title:') . ' <span class="required" title="' . DI::l10n()->t('Required') . '">*</span>',
'$t_orig' => $t_orig,
'$summary' => ['summary', DI::l10n()->t('Title:'), $t_orig, '', '*'],
'$sh_text' => DI::l10n()->t('Share this event'),
'$share' => ['share', DI::l10n()->t('Share this event'), $share_checked, '', $share_disabled],
'$sh_checked' => $share_checked,
'$nofinish' => ['nofinish', DI::l10n()->t('Finish date/time is not known or not relevant'), $n_checked],
'$preview' => DI::l10n()->t('Preview'),
'$acl' => $acl,
'$submit' => DI::l10n()->t('Submit'),
'$basic' => DI::l10n()->t('Basic'),
'$advanced' => DI::l10n()->t('Advanced'),
'$permissions' => DI::l10n()->t('Permissions'),
]);
return $o;
}
// Remove an event from the calendar and its related items
if ($mode === 'drop' && $event_id) {
$ev = Event::getListById(local_user(), $event_id);
// Delete only real events (no birthdays)
if (DBA::isResult($ev) && $ev[0]['type'] == 'event') {
Item::deleteForUser(['id' => $ev[0]['itemid']], local_user());
}
if (Post::exists(['id' => $ev[0]['itemid']])) {
notice(DI::l10n()->t('Failed to remove event'));
}
DI::baseUrl()->redirect('events');
}
}

View File

@ -1,160 +0,0 @@
<?php
/**
* @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* @package Friendica\modules
* @subpackage FileBrowser
* @author Fabio Comuni <fabrixxm@kirgroup.com>
*/
use Friendica\App;
use Friendica\Core\Renderer;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Photo;
use Friendica\Util\Images;
use Friendica\Util\Strings;
/**
* @param App $a
* @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
function fbrowser_content(App $a)
{
if (!local_user()) {
System::exit();
}
if (DI::args()->getArgc() == 1) {
System::exit();
}
// Needed to match the correct template in a module that uses a different theme than the user/site/default
$theme = Strings::sanitizeFilePathItem($_GET['theme'] ?? '');
if ($theme && is_file("view/theme/$theme/config.php")) {
$a->setCurrentTheme($theme);
}
$template_file = "filebrowser.tpl";
$o = '';
switch (DI::args()->getArgv()[1]) {
case "image":
$path = ['' => DI::l10n()->t('Photos')];
$albums = false;
$sql_extra = "";
$sql_extra2 = " ORDER BY created DESC LIMIT 0, 10";
if (DI::args()->getArgc() == 2) {
$photos = DBA::toArray(DBA::p("SELECT distinct(`album`) AS `album` FROM `photo` WHERE `uid` = ? AND NOT `photo-type` IN (?, ?)",
local_user(),
Photo::CONTACT_AVATAR,
Photo::CONTACT_BANNER
));
$albums = array_column($photos, 'album');
}
if (DI::args()->getArgc() == 3) {
$album = DI::args()->getArgv()[2];
$sql_extra = sprintf("AND `album` = '%s' ", DBA::escape($album));
$sql_extra2 = "";
$path[$album] = $album;
}
$r = DBA::toArray(DBA::p("SELECT `resource-id`, ANY_VALUE(`id`) AS `id`, ANY_VALUE(`filename`) AS `filename`, ANY_VALUE(`type`) AS `type`,
min(`scale`) AS `hiq`, max(`scale`) AS `loq`, ANY_VALUE(`desc`) AS `desc`, ANY_VALUE(`created`) AS `created`
FROM `photo` WHERE `uid` = ? $sql_extra AND NOT `photo-type` IN (?, ?)
GROUP BY `resource-id` $sql_extra2",
local_user(),
Photo::CONTACT_AVATAR,
Photo::CONTACT_BANNER
));
function _map_files1($rr)
{
$a = DI::app();
$types = Images::supportedTypes();
$ext = $types[$rr['type']];
$filename_e = $rr['filename'];
// Take the largest picture that is smaller or equal 640 pixels
$photo = Photo::selectFirst(['scale'], ["`resource-id` = ? AND `height` <= ? AND `width` <= ?", $rr['resource-id'], 640, 640], ['order' => ['scale']]);
$scale = $photo['scale'] ?? $rr['loq'];
return [
DI::baseUrl() . '/photos/' . $a->getLoggedInUserNickname() . '/image/' . $rr['resource-id'],
$filename_e,
DI::baseUrl() . '/photo/' . $rr['resource-id'] . '-' . $scale . '.'. $ext,
$rr['desc']
];
}
$files = array_map("_map_files1", $r);
$tpl = Renderer::getMarkupTemplate($template_file);
$o = Renderer::replaceMacros($tpl, [
'$type' => 'image',
'$path' => $path,
'$folders' => $albums,
'$files' => $files,
'$cancel' => DI::l10n()->t('Cancel'),
'$nickname' => $a->getLoggedInUserNickname(),
'$upload' => DI::l10n()->t('Upload')
]);
break;
case "file":
if (DI::args()->getArgc()==2) {
$files = DBA::selectToArray('attach', ['id', 'filename', 'filetype'], ['uid' => local_user()]);
function _map_files2($rr)
{
list($m1, $m2) = explode("/", $rr['filetype']);
$filetype = ( (file_exists("images/icons/$m1.png"))?$m1:"zip");
$filename_e = $rr['filename'];
return [DI::baseUrl() . '/attach/' . $rr['id'], $filename_e, DI::baseUrl() . '/images/icons/16/' . $filetype . '.png'];
}
$files = array_map("_map_files2", $files);
$tpl = Renderer::getMarkupTemplate($template_file);
$o = Renderer::replaceMacros($tpl, [
'$type' => 'file',
'$path' => ['' => DI::l10n()->t('Files')],
'$folders' => false,
'$files' => $files,
'$cancel' => DI::l10n()->t('Cancel'),
'$nickname' => $a->getLoggedInUserNickname(),
'$upload' => DI::l10n()->t('Upload')
]);
}
break;
}
if (!empty($_GET['mode'])) {
return $o;
} else {
System::httpExit($o);
}
}

View File

@ -1,210 +0,0 @@
<?php
/**
* @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
use Friendica\App;
use Friendica\Content\Widget;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Profile;
use Friendica\Model\Item;
use Friendica\Network\Probe;
use Friendica\Database\DBA;
use Friendica\Model\Post;
use Friendica\Model\User;
use Friendica\Util\Strings;
function follow_post(App $a)
{
if (!local_user()) {
throw new \Friendica\Network\HTTPException\ForbiddenException(DI::l10n()->t('Access denied.'));
}
if (isset($_REQUEST['cancel'])) {
DI::baseUrl()->redirect('contact');
}
$url = Probe::cleanURI($_REQUEST['url']);
follow_process($a, $url);
}
function follow_content(App $a)
{
$return_path = 'contact';
if (!local_user()) {
notice(DI::l10n()->t('Permission denied.'));
DI::baseUrl()->redirect($return_path);
// NOTREACHED
}
$uid = local_user();
$url = Probe::cleanURI(trim($_REQUEST['url'] ?? ''));
// Issue 6874: Allow remote following from Peertube
if (strpos($url, 'acct:') === 0) {
$url = str_replace('acct:', '', $url);
}
if (!$url) {
DI::baseUrl()->redirect($return_path);
}
$submit = DI::l10n()->t('Submit Request');
// Don't try to add a pending contact
$user_contact = DBA::selectFirst('contact', ['pending'], ["`uid` = ? AND ((`rel` != ?) OR (`network` = ?)) AND
(`nurl` = ? OR `alias` = ? OR `alias` = ?) AND `network` != ?",
$uid, Contact::FOLLOWER, Protocol::DFRN, Strings::normaliseLink($url),
Strings::normaliseLink($url), $url, Protocol::STATUSNET]);
if (DBA::isResult($user_contact)) {
if ($user_contact['pending']) {
notice(DI::l10n()->t('You already added this contact.'));
$submit = '';
}
}
$contact = Contact::getByURL($url, true);
// Possibly it is a mail contact
if (empty($contact)) {
$contact = Probe::uri($url, Protocol::MAIL, $uid);
}
if (empty($contact) || ($contact['network'] == Protocol::PHANTOM)) {
// Possibly it is a remote item and not an account
follow_remote_item($url);
notice(DI::l10n()->t("The network type couldn't be detected. Contact can't be added."));
$submit = '';
$contact = ['url' => $url, 'network' => Protocol::PHANTOM, 'name' => $url, 'keywords' => ''];
}
$protocol = Contact::getProtocol($contact['url'], $contact['network']);
if (($protocol == Protocol::DIASPORA) && !DI::config()->get('system', 'diaspora_enabled')) {
notice(DI::l10n()->t("Diaspora support isn't enabled. Contact can't be added."));
$submit = '';
}
if (($protocol == Protocol::OSTATUS) && DI::config()->get('system', 'ostatus_disabled')) {
notice(DI::l10n()->t("OStatus support is disabled. Contact can't be added."));
$submit = '';
}
if ($protocol == Protocol::MAIL) {
$contact['url'] = $contact['addr'];
}
if (!empty($_REQUEST['auto'])) {
follow_process($a, $contact['url']);
}
$request = DI::baseUrl() . '/follow';
$tpl = Renderer::getMarkupTemplate('auto_request.tpl');
$owner = User::getOwnerDataById($uid);
if (empty($owner)) {
notice(DI::l10n()->t('Permission denied.'));
DI::baseUrl()->redirect($return_path);
// NOTREACHED
}
$myaddr = $owner['url'];
$o = Renderer::replaceMacros($tpl, [
'$header' => DI::l10n()->t('Connect/Follow'),
'$pls_answer' => DI::l10n()->t('Please answer the following:'),
'$your_address' => DI::l10n()->t('Your Identity Address:'),
'$url_label' => DI::l10n()->t('Profile URL'),
'$keywords_label'=> DI::l10n()->t('Tags:'),
'$submit' => $submit,
'$cancel' => DI::l10n()->t('Cancel'),
'$request' => $request,
'$name' => $contact['name'],
'$url' => $contact['url'],
'$zrl' => Profile::zrl($contact['url']),
'$myaddr' => $myaddr,
'$keywords' => $contact['keywords'],
'$does_know_you' => ['knowyou', DI::l10n()->t('%s knows you', $contact['name'])],
'$addnote_field' => ['dfrn-request-message', DI::l10n()->t('Add a personal note:')],
]);
DI::page()['aside'] = '';
if (!in_array($protocol, [Protocol::PHANTOM, Protocol::MAIL])) {
DI::page()['aside'] = Widget\VCard::getHTML($contact);
$o .= Renderer::replaceMacros(Renderer::getMarkupTemplate('section_title.tpl'),
['$title' => DI::l10n()->t('Status Messages and Posts')]
);
// Show last public posts
$o .= Contact::getPostsFromUrl($contact['url']);
}
return $o;
}
function follow_process(App $a, string $url)
{
$return_path = 'follow?url=' . urlencode($url);
$result = Contact::createFromProbeForUser($a->getLoggedInUserId(), $url);
if ($result['success'] == false) {
// Possibly it is a remote item and not an account
follow_remote_item($url);
if ($result['message']) {
notice($result['message']);
}
DI::baseUrl()->redirect($return_path);
} elseif ($result['cid']) {
DI::baseUrl()->redirect('contact/' . $result['cid']);
}
notice(DI::l10n()->t('The contact could not be added.'));
DI::baseUrl()->redirect($return_path);
}
function follow_remote_item($url)
{
$item_id = Item::fetchByLink($url, local_user());
if (!$item_id) {
// If the user-specific search failed, we search and probe a public post
$item_id = Item::fetchByLink($url);
}
if (!empty($item_id)) {
$item = Post::selectFirst(['guid'], ['id' => $item_id]);
if (DBA::isResult($item)) {
DI::baseUrl()->redirect('display/' . $item['guid']);
}
}
}

View File

@ -34,8 +34,8 @@ use Friendica\Content\Text\BBCode;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Attach;
@ -57,11 +57,11 @@ use Friendica\Util\DateTimeFormat;
use Friendica\Util\ParseUrl;
function item_post(App $a) {
if (!Session::isAuthenticated()) {
if (!DI::userSession()->isAuthenticated()) {
throw new HTTPException\ForbiddenException();
}
$uid = local_user();
$uid = DI::userSession()->getLocalUserId();
if (!empty($_REQUEST['dropitems'])) {
$arr_drop = explode(',', $_REQUEST['dropitems']);
@ -77,8 +77,6 @@ function item_post(App $a) {
Logger::debug('postvars', ['_REQUEST' => $_REQUEST]);
$api_source = $_REQUEST['api_source'] ?? false;
$return_path = $_REQUEST['return'] ?? '';
$preview = intval($_REQUEST['preview'] ?? 0);
@ -90,7 +88,7 @@ function item_post(App $a) {
if (!$preview && !empty($_REQUEST['post_id_random'])) {
if (!empty($_SESSION['post-random']) && $_SESSION['post-random'] == $_REQUEST['post_id_random']) {
Logger::warning('duplicate post');
item_post_return(DI::baseUrl(), $api_source, $return_path);
item_post_return(DI::baseUrl(), $return_path);
} else {
$_SESSION['post-random'] = $_REQUEST['post_id_random'];
}
@ -106,7 +104,7 @@ function item_post(App $a) {
$toplevel_user_id = null;
$objecttype = null;
$profile_uid = ($_REQUEST['profile_uid'] ?? 0) ?: local_user();
$profile_uid = DI::userSession()->getLocalUserId();
$posttype = ($_REQUEST['post_type'] ?? '') ?: Item::PT_ARTICLE;
if ($parent_item_id || $thr_parent_uri) {
@ -122,13 +120,13 @@ function item_post(App $a) {
$thr_parent_uri = $parent_item['uri'];
$toplevel_item = $parent_item;
if ($parent_item['gravity'] != GRAVITY_PARENT) {
if ($parent_item['gravity'] != Item::GRAVITY_PARENT) {
$toplevel_item = Post::selectFirst(Item::ITEM_FIELDLIST, ['id' => $toplevel_item['parent']]);
}
}
if (!DBA::isResult($toplevel_item)) {
notice(DI::l10n()->t('Unable to locate original post.'));
DI::sysmsg()->addNotice(DI::l10n()->t('Unable to locate original post.'));
if ($return_path) {
DI::baseUrl()->redirect($return_path);
}
@ -138,7 +136,7 @@ function item_post(App $a) {
// When commenting on a public post then store the post for the current user
// This enables interaction like starring and saving into folders
if ($toplevel_item['uid'] == 0) {
$stored = Item::storeForUserByUriId($toplevel_item['uri-id'], local_user(), ['post-reason' => Item::PR_ACTIVITY]);
$stored = Item::storeForUserByUriId($toplevel_item['uri-id'], DI::userSession()->getLocalUserId(), ['post-reason' => Item::PR_ACTIVITY]);
Logger::info('Public item stored for user', ['uri-id' => $toplevel_item['uri-id'], 'uid' => $uid, 'stored' => $stored]);
if ($stored) {
$toplevel_item = Post::selectFirst(Item::ITEM_FIELDLIST, ['id' => $stored]);
@ -168,17 +166,17 @@ function item_post(App $a) {
}
// Ensure that the user id in a thread always stay the same
if (!is_null($toplevel_user_id) && in_array($toplevel_user_id, [local_user(), 0])) {
if (!is_null($toplevel_user_id) && in_array($toplevel_user_id, [DI::userSession()->getLocalUserId(), 0])) {
$profile_uid = $toplevel_user_id;
}
// Allow commenting if it is an answer to a public post
$allow_comment = local_user() && $toplevel_item_id && in_array($toplevel_item['private'], [Item::PUBLIC, Item::UNLISTED]) && in_array($toplevel_item['network'], Protocol::FEDERATED);
$allow_comment = DI::userSession()->getLocalUserId() && $toplevel_item_id && in_array($toplevel_item['private'], [Item::PUBLIC, Item::UNLISTED]) && in_array($toplevel_item['network'], Protocol::FEDERATED);
// Now check that valid personal details have been provided
if (!Security::canWriteToUserWall($profile_uid) && !$allow_comment) {
Logger::warning('Permission denied.', ['local' => local_user(), 'profile_uid' => $profile_uid, 'toplevel_item_id' => $toplevel_item_id, 'network' => $toplevel_item['network']]);
notice(DI::l10n()->t('Permission denied.'));
Logger::warning('Permission denied.', ['local' => DI::userSession()->getLocalUserId(), 'toplevel_item_id' => $toplevel_item_id, 'network' => $toplevel_item['network']]);
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
if ($return_path) {
DI::baseUrl()->redirect($return_path);
}
@ -241,6 +239,8 @@ function item_post(App $a) {
$att_bbcode = "\n" . PageInfo::getFooterFromData($attachment);
$body .= $att_bbcode;
} elseif (preg_match("/\[attachment\](.*?)\[\/attachment\]/ism", $body, $matches)) {
$body = preg_replace("/\[attachment].*?\[\/attachment\]/ism", PageInfo::getFooterFromUrl($matches[1]), $body);
}
// Convert links with empty descriptions to links without an explicit description
@ -307,7 +307,7 @@ function item_post(App $a) {
// for non native networks use the network of the original post as network of the item
if (($toplevel_item['network'] != Protocol::DIASPORA)
&& ($toplevel_item['network'] != Protocol::OSTATUS)
&& ($network == "")) {
&& ($network == '')) {
$network = $toplevel_item['network'];
}
@ -322,19 +322,12 @@ function item_post(App $a) {
$pubmail_enabled = ($_REQUEST['pubmail_enable'] ?? false) && !$private;
// if using the API, we won't see pubmail_enable - figure out if it should be set
if ($api_source && $profile_uid && $profile_uid == local_user() && !$private) {
if (function_exists('imap_open') && !DI::config()->get('system', 'imap_disabled')) {
$pubmail_enabled = DBA::exists('mailacct', ["`uid` = ? AND `server` != ? AND `pubmail`", local_user(), '']);
}
}
if (!strlen($body)) {
if ($preview) {
System::jsonExit(['preview' => '']);
}
notice(DI::l10n()->t('Empty post discarded.'));
DI::sysmsg()->addNotice(DI::l10n()->t('Empty post discarded.'));
if ($return_path) {
DI::baseUrl()->redirect($return_path);
}
@ -362,11 +355,11 @@ function item_post(App $a) {
$self = false;
$contact_id = 0;
if (local_user() && ((local_user() == $profile_uid) || $allow_comment)) {
if (DI::userSession()->getLocalUserId() && ((DI::userSession()->getLocalUserId() == $profile_uid) || $allow_comment)) {
$self = true;
$author = DBA::selectFirst('contact', [], ['uid' => local_user(), 'self' => true]);
} elseif (!empty(Session::getRemoteContactID($profile_uid))) {
$author = DBA::selectFirst('contact', [], ['id' => Session::getRemoteContactID($profile_uid)]);
$author = DBA::selectFirst('contact', [], ['uid' => DI::userSession()->getLocalUserId(), 'self' => true]);
} elseif (!empty(DI::userSession()->getRemoteContactID($profile_uid))) {
$author = DBA::selectFirst('contact', [], ['id' => DI::userSession()->getRemoteContactID($profile_uid)]);
}
if (DBA::isResult($author)) {
@ -374,7 +367,7 @@ function item_post(App $a) {
}
// get contact info for owner
if ($profile_uid == local_user() || $allow_comment) {
if ($profile_uid == DI::userSession()->getLocalUserId() || $allow_comment) {
$contact_record = $author ?: [];
} else {
$contact_record = DBA::selectFirst('contact', [], ['uid' => $profile_uid, 'self' => true]) ?: [];
@ -384,8 +377,8 @@ function item_post(App $a) {
if ($posttype != Item::PT_PERSONAL_NOTE) {
// Look for any tags and linkify them
$item = [
'uid' => local_user() ? local_user() : $profile_uid,
'gravity' => $toplevel_item_id ? GRAVITY_COMMENT : GRAVITY_PARENT,
'uid' => DI::userSession()->getLocalUserId() ? DI::userSession()->getLocalUserId() : $profile_uid,
'gravity' => $toplevel_item_id ? Item::GRAVITY_COMMENT : Item::GRAVITY_PARENT,
'network' => $network,
'body' => $body,
'postopts' => $postopts,
@ -462,7 +455,7 @@ function item_post(App $a) {
$data = BBCode::getAttachmentData($body);
$match = [];
if ((preg_match_all("/\[bookmark\=([^\]]*)\](.*?)\[\/bookmark\]/ism", $body, $match, PREG_SET_ORDER) || isset($data["type"]))
if ((preg_match_all("/\[bookmark\=([^\]]*)\](.*?)\[\/bookmark\]/ism", $body, $match, PREG_SET_ORDER) || isset($data['type']))
&& ($posttype != Item::PT_PERSONAL_NOTE)) {
$posttype = Item::PT_PAGE;
$objecttype = Activity\ObjectType::BOOKMARK;
@ -477,11 +470,11 @@ function item_post(App $a) {
$objecttype = Activity\ObjectType::NOTE; // Default value
$objectdata = BBCode::getAttachedData($body);
if ($objectdata["type"] == "link") {
if ($objectdata['type'] == 'link') {
$objecttype = Activity\ObjectType::BOOKMARK;
} elseif ($objectdata["type"] == "video") {
} elseif ($objectdata['type'] == 'video') {
$objecttype = Activity\ObjectType::VIDEO;
} elseif ($objectdata["type"] == "photo") {
} elseif ($objectdata['type'] == 'photo') {
$objecttype = Activity\ObjectType::IMAGE;
}
@ -509,11 +502,11 @@ function item_post(App $a) {
$verb = Activity::POST;
}
if ($network == "") {
if ($network == '') {
$network = Protocol::DFRN;
}
$gravity = ($toplevel_item_id ? GRAVITY_COMMENT : GRAVITY_PARENT);
$gravity = ($toplevel_item_id ? Item::GRAVITY_COMMENT : Item::GRAVITY_PARENT);
// even if the post arrived via API we are considering that it
// originated on this site by default for determining relayability.
@ -532,68 +525,65 @@ function item_post(App $a) {
$thr_parent_uri = $uri;
}
$datarray = [];
$datarray['uid'] = $profile_uid;
$datarray['wall'] = $wall;
$datarray['gravity'] = $gravity;
$datarray['network'] = $network;
$datarray['contact-id'] = $contact_id;
$datarray['owner-name'] = $contact_record['name'] ?? '';
$datarray['owner-link'] = $contact_record['url'] ?? '';
$datarray['owner-avatar'] = $contact_record['thumb'] ?? '';
$datarray['owner-id'] = Contact::getIdForURL($datarray['owner-link']);
$datarray['author-name'] = $author['name'];
$datarray['author-link'] = $author['url'];
$datarray['author-avatar'] = $author['thumb'];
$datarray['author-id'] = Contact::getIdForURL($datarray['author-link']);
$datarray['created'] = empty($_REQUEST['created_at']) ? DateTimeFormat::utcNow() : $_REQUEST['created_at'];
$datarray['edited'] = $datarray['created'];
$datarray['commented'] = $datarray['created'];
$datarray['changed'] = $datarray['created'];
$datarray['received'] = DateTimeFormat::utcNow();
$datarray['extid'] = $extid;
$datarray['guid'] = $guid;
$datarray['uri'] = $uri;
$datarray['title'] = $title;
$datarray['body'] = $body;
$datarray['app'] = $app;
$datarray['location'] = $location;
$datarray['coord'] = $coord;
$datarray['file'] = $categories;
$datarray['inform'] = $inform;
$datarray['verb'] = $verb;
$datarray['post-type'] = $posttype;
$datarray['object-type'] = $objecttype;
$datarray['allow_cid'] = $str_contact_allow;
$datarray['allow_gid'] = $str_group_allow;
$datarray['deny_cid'] = $str_contact_deny;
$datarray['deny_gid'] = $str_group_deny;
$datarray['private'] = $private;
$datarray['pubmail'] = $pubmail_enabled;
$datarray['attach'] = $attachments;
$datarray = [
'uid' => $profile_uid,
'wall' => $wall,
'gravity' => $gravity,
'network' => $network,
'contact-id' => $contact_id,
'owner-name' => $contact_record['name'] ?? '',
'owner-link' => $contact_record['url'] ?? '',
'owner-avatar' => $contact_record['thumb'] ?? '',
'author-name' => $author['name'],
'author-link' => $author['url'],
'author-avatar' => $author['thumb'],
'created' => empty($_REQUEST['created_at']) ? DateTimeFormat::utcNow() : $_REQUEST['created_at'],
'received' => DateTimeFormat::utcNow(),
'extid' => $extid,
'guid' => $guid,
'uri' => $uri,
'title' => $title,
'body' => $body,
'app' => $app,
'location' => $location,
'coord' => $coord,
'file' => $categories,
'inform' => $inform,
'verb' => $verb,
'post-type' => $posttype,
'object-type' => $objecttype,
'allow_cid' => $str_contact_allow,
'allow_gid' => $str_group_allow,
'deny_cid' => $str_contact_deny,
'deny_gid' => $str_group_deny,
'private' => $private,
'pubmail' => $pubmail_enabled,
'attach' => $attachments,
'thr-parent' => $thr_parent_uri,
'postopts' => $postopts,
'origin' => $origin,
'object' => $object,
'attachments' => $_REQUEST['attachments'] ?? [],
/*
* These fields are for the convenience of addons...
* 'self' if true indicates the owner is posting on their own wall
* If parent is 0 it is a top-level post.
*/
'parent' => $toplevel_item_id,
'self' => $self,
// This triggers posts via API and the mirror functions
'api_source' => false,
// This field is for storing the raw conversation data
'protocol' => Conversation::PARCEL_DIRECT,
'direction' => Conversation::PUSH,
];
$datarray['thr-parent'] = $thr_parent_uri;
$datarray['postopts'] = $postopts;
$datarray['origin'] = $origin;
$datarray['object'] = $object;
$datarray['attachments'] = $_REQUEST['attachments'] ?? [];
/*
* These fields are for the convenience of addons...
* 'self' if true indicates the owner is posting on their own wall
* If parent is 0 it is a top-level post.
*/
$datarray['parent'] = $toplevel_item_id;
$datarray['self'] = $self;
// This triggers posts via API and the mirror functions
$datarray['api_source'] = $api_source;
// This field is for storing the raw conversation data
$datarray['protocol'] = Conversation::PARCEL_DIRECT;
$datarray['direction'] = Conversation::PUSH;
// These cannot be part of above initialization ...
$datarray['edited'] = $datarray['created'];
$datarray['commented'] = $datarray['created'];
$datarray['changed'] = $datarray['created'];
$datarray['owner-id'] = Contact::getIdForURL($datarray['owner-link']);
$datarray['author-id'] = Contact::getIdForURL($datarray['author-link']);
$datarray['edit'] = $orig_post;
@ -606,15 +596,16 @@ function item_post(App $a) {
if ($preview) {
// We set the datarray ID to -1 because in preview mode the dataray
// doesn't have an ID.
$datarray["id"] = -1;
$datarray["uri-id"] = -1;
$datarray["author-network"] = Protocol::DFRN;
$datarray["author-updated"] = '';
$datarray["author-gsid"] = 0;
$datarray["author-uri-id"] = ItemURI::getIdByURI($datarray["author-link"]);
$datarray["owner-updated"] = '';
$datarray["has-media"] = false;
$datarray['body'] = Item::improveSharedDataInBody($datarray);
$datarray['id'] = -1;
$datarray['uri-id'] = -1;
$datarray['author-network'] = Protocol::DFRN;
$datarray['author-updated'] = '';
$datarray['author-gsid'] = 0;
$datarray['author-uri-id'] = ItemURI::getIdByURI($datarray['author-link']);
$datarray['owner-updated'] = '';
$datarray['has-media'] = false;
$datarray['quote-uri-id'] = Item::getQuoteUriId($datarray['body'], $datarray['uid']);
$datarray['body'] = BBCode::removeSharedData($datarray['body']);
$o = DI::conversation()->create([array_merge($contact_record, $datarray)], 'search', false, true);
@ -635,8 +626,8 @@ function item_post(App $a) {
unset($datarray['self']);
unset($datarray['api_source']);
Post\Delayed::add($datarray['uri'], $datarray, PRIORITY_HIGH, Post\Delayed::PREPARED_NO_HOOK, $scheduled_at);
item_post_return(DI::baseUrl(), $api_source, $return_path);
Post\Delayed::add($datarray['uri'], $datarray, Worker::PRIORITY_HIGH, Post\Delayed::PREPARED_NO_HOOK, $scheduled_at);
item_post_return(DI::baseUrl(), $return_path);
}
}
@ -655,15 +646,20 @@ function item_post(App $a) {
}
$datarray['uri-id'] = ItemURI::getIdByURI($datarray['uri']);
$datarray['body'] = Item::improveSharedDataInBody($datarray);
if ($orig_post) {
$quote_uri_id = Item::getQuoteUriId($datarray['body'], $datarray['uid']);
if (!empty($quote_uri_id)) {
$datarray['quote-uri-id'] = $quote_uri_id;
$datarray['body'] = BBCode::removeSharedData($datarray['body']);
}
if ($orig_post) {
$fields = [
'title' => $datarray['title'],
'body' => $datarray['body'],
'attach' => $datarray['attach'],
'file' => $datarray['file'],
'edited' => DateTimeFormat::utcNow(),
'title' => $datarray['title'],
'body' => $datarray['body'],
'attach' => $datarray['attach'],
'file' => $datarray['file'],
'edited' => DateTimeFormat::utcNow(),
'changed' => DateTimeFormat::utcNow()
];
@ -684,7 +680,7 @@ function item_post(App $a) {
$post_id = Item::insert($datarray);
if (!$post_id) {
notice(DI::l10n()->t('Item wasn\'t stored.'));
DI::sysmsg()->addNotice(DI::l10n()->t('Item wasn\'t stored.'));
if ($return_path) {
DI::baseUrl()->redirect($return_path);
}
@ -705,7 +701,7 @@ function item_post(App $a) {
Tag::storeFromBody($datarray['uri-id'], $datarray['body']);
if (!\Friendica\Content\Feature::isEnabled($uid, 'explicit_mentions') && ($datarray['gravity'] == GRAVITY_COMMENT)) {
if (!\Friendica\Content\Feature::isEnabled($uid, 'explicit_mentions') && ($datarray['gravity'] == Item::GRAVITY_COMMENT)) {
Tag::createImplicitMentions($datarray['uri-id'], $datarray['thr-parent-id']);
}
@ -736,7 +732,7 @@ function item_post(App $a) {
Hook::callAll('post_local_end', $datarray);
if (strlen($emailcc) && $profile_uid == local_user()) {
if (strlen($emailcc) && $profile_uid == DI::userSession()->getLocalUserId()) {
$recipients = explode(',', $emailcc);
if (count($recipients)) {
foreach ($recipients as $recipient) {
@ -752,20 +748,12 @@ function item_post(App $a) {
Logger::debug('post_complete');
if ($api_source) {
return $post_id;
}
item_post_return(DI::baseUrl(), $api_source, $return_path);
item_post_return(DI::baseUrl(), $return_path);
// NOTREACHED
}
function item_post_return($baseurl, $api_source, $return_path)
function item_post_return($baseurl, $return_path)
{
if ($api_source) {
return;
}
if ($return_path) {
DI::baseUrl()->redirect($return_path);
}
@ -782,7 +770,7 @@ function item_post_return($baseurl, $api_source, $return_path)
function item_content(App $a)
{
if (!Session::isAuthenticated()) {
if (!DI::userSession()->isAuthenticated()) {
throw new HTTPException\UnauthorizedException();
}
@ -796,9 +784,9 @@ function item_content(App $a)
switch ($args->get(1)) {
case 'drop':
if (DI::mode()->isAjax()) {
Item::deleteForUser(['id' => $args->get(2)], local_user());
Item::deleteForUser(['id' => $args->get(2)], DI::userSession()->getLocalUserId());
// ajax return: [<item id>, 0 (no perm) | <owner id>]
System::jsonExit([intval($args->get(2)), local_user()]);
System::jsonExit([intval($args->get(2)), DI::userSession()->getLocalUserId()]);
} else {
if (!empty($args->get(3))) {
$o = drop_item($args->get(2), $args->get(3));
@ -807,17 +795,18 @@ function item_content(App $a)
}
}
break;
case 'block':
$item = Post::selectFirstForUser(local_user(), ['guid', 'author-id', 'parent', 'gravity'], ['id' => $args->get(2)]);
$item = Post::selectFirstForUser(DI::userSession()->getLocalUserId(), ['guid', 'author-id', 'parent', 'gravity'], ['id' => $args->get(2)]);
if (empty($item['author-id'])) {
throw new HTTPException\NotFoundException('Item not found');
}
Contact\User::setBlocked($item['author-id'], local_user(), true);
Contact\User::setBlocked($item['author-id'], DI::userSession()->getLocalUserId(), true);
if (DI::mode()->isAjax()) {
// ajax return: [<item id>, 0 (no perm) | <owner id>]
System::jsonExit([intval($args->get(2)), local_user()]);
System::jsonExit([intval($args->get(2)), DI::userSession()->getLocalUserId()]);
} else {
item_redirect_after_action($item, $args->get(3));
}
@ -833,15 +822,15 @@ function item_content(App $a)
* @return string
* @throws HTTPException\InternalServerErrorException
*/
function drop_item(int $id, string $return = '')
function drop_item(int $id, string $return = ''): string
{
// locate item to be deleted
$fields = ['id', 'uid', 'guid', 'contact-id', 'deleted', 'gravity', 'parent'];
$item = Post::selectFirstForUser(local_user(), $fields, ['id' => $id]);
// Locate item to be deleted
$item = Post::selectFirstForUser(DI::userSession()->getLocalUserId(), ['id', 'uid', 'guid', 'contact-id', 'deleted', 'gravity', 'parent'], ['id' => $id]);
if (!DBA::isResult($item)) {
notice(DI::l10n()->t('Item not found.'));
DI::sysmsg()->addNotice(DI::l10n()->t('Item not found.'));
DI::baseUrl()->redirect('network');
//NOTREACHED
}
if ($item['deleted']) {
@ -851,18 +840,19 @@ function drop_item(int $id, string $return = '')
$contact_id = 0;
// check if logged in user is either the author or owner of this item
if (Session::getRemoteContactID($item['uid']) == $item['contact-id']) {
if (DI::userSession()->getRemoteContactID($item['uid']) == $item['contact-id']) {
$contact_id = $item['contact-id'];
}
if ((local_user() == $item['uid']) || $contact_id) {
if ((DI::userSession()->getLocalUserId() == $item['uid']) || $contact_id) {
// delete the item
Item::deleteForUser(['id' => $item['id']], local_user());
Item::deleteForUser(['id' => $item['id']], DI::userSession()->getLocalUserId());
item_redirect_after_action($item, $return);
//NOTREACHED
} else {
Logger::warning('Permission denied.', ['local' => local_user(), 'uid' => $item['uid'], 'cid' => $contact_id]);
notice(DI::l10n()->t('Permission denied.'));
Logger::warning('Permission denied.', ['local' => DI::userSession()->getLocalUserId(), 'uid' => $item['uid'], 'cid' => $contact_id]);
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
DI::baseUrl()->redirect('display/' . $item['guid']);
//NOTREACHED
}
@ -870,17 +860,17 @@ function drop_item(int $id, string $return = '')
return '';
}
function item_redirect_after_action($item, $returnUrlHex)
function item_redirect_after_action(array $item, string $returnUrlHex)
{
$return_url = hex2bin($returnUrlHex);
// removes update_* from return_url to ignore Ajax refresh
$return_url = str_replace("update_", "", $return_url);
$return_url = str_replace('update_', '', $return_url);
// Check if delete a comment
if ($item['gravity'] == GRAVITY_COMMENT) {
if ($item['gravity'] == Item::GRAVITY_COMMENT) {
if (!empty($item['parent'])) {
$parentitem = Post::selectFirstForUser(local_user(), ['guid'], ['id' => $item['parent']]);
$parentitem = Post::selectFirstForUser(DI::userSession()->getLocalUserId(), ['guid'], ['id' => $item['parent']]);
}
// Return to parent guid

View File

@ -34,10 +34,10 @@ function lostpass_post(App $a)
DI::baseUrl()->redirect();
}
$condition = ['(`email` = ? OR `nickname` = ?) AND `verified` = 1 AND `blocked` = 0', $loginame, $loginame];
$condition = ['(`email` = ? OR `nickname` = ?) AND `verified` = 1 AND `blocked` = 0 AND `account_removed` = 0 AND `account_expired` = 0', $loginame, $loginame];
$user = DBA::selectFirst('user', ['uid', 'username', 'nickname', 'email', 'language'], $condition);
if (!DBA::isResult($user)) {
notice(DI::l10n()->t('No valid account found.'));
DI::sysmsg()->addNotice(DI::l10n()->t('No valid account found.'));
DI::baseUrl()->redirect();
}
@ -49,7 +49,7 @@ function lostpass_post(App $a)
];
$result = DBA::update('user', $fields, ['uid' => $user['uid']]);
if ($result) {
info(DI::l10n()->t('Password reset request issued. Check your email.'));
DI::sysmsg()->addInfo(DI::l10n()->t('Password reset request issued. Check your email.'));
}
$sitename = DI::config()->get('config', 'sitename');
@ -97,7 +97,7 @@ function lostpass_content(App $a)
$user = DBA::selectFirst('user', ['uid', 'username', 'nickname', 'email', 'pwdreset_time', 'language'], ['pwdreset' => hash('sha256', $pwdreset_token)]);
if (!DBA::isResult($user)) {
notice(DI::l10n()->t("Request could not be verified. \x28You may have previously submitted it.\x29 Password reset failed."));
DI::sysmsg()->addNotice(DI::l10n()->t("Request could not be verified. \x28You may have previously submitted it.\x29 Password reset failed."));
return lostpass_form();
}
@ -110,7 +110,7 @@ function lostpass_content(App $a)
];
DBA::update('user', $fields, ['uid' => $user['uid']]);
notice(DI::l10n()->t('Request has expired, please make a new one.'));
DI::sysmsg()->addNotice(DI::l10n()->t('Request has expired, please make a new one.'));
return lostpass_form();
}
@ -152,7 +152,7 @@ function lostpass_generate_password($user)
'$newpass' => $new_password,
]);
info(DI::l10n()->t("Your password has been reset."));
DI::sysmsg()->addInfo(DI::l10n()->t("Your password has been reset."));
$sitename = DI::config()->get('config', 'sitename');
$preamble = Strings::deindent(DI::l10n()->t('

View File

@ -1,132 +0,0 @@
<?php
/**
* @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
use Friendica\App;
use Friendica\Content\Widget;
use Friendica\Core\Renderer;
use Friendica\Core\Search;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Profile;
use Friendica\Module\Contact as ModuleContact;
/**
* Controller for /match.
*
* It takes keywords from your profile and queries the directory server for
* matching keywords from other profiles.
*
* @param App $a App
*
* @return string
* @throws ImagickException
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws Exception
*/
function match_content(App $a)
{
if (!local_user()) {
return '';
}
DI::page()['aside'] .= Widget::findPeople();
DI::page()['aside'] .= Widget::follow();
$_SESSION['return_path'] = DI::args()->getCommand();
$profile = Profile::getByUID(local_user());
if (!DBA::isResult($profile)) {
return '';
}
if (!$profile['pub_keywords'] && (!$profile['prv_keywords'])) {
notice(DI::l10n()->t('No keywords to match. Please add keywords to your profile.'));
return '';
}
$params = [];
$tags = trim($profile['pub_keywords'] . ' ' . $profile['prv_keywords']);
if (DI::mode()->isMobile()) {
$limit = DI::pConfig()->get(local_user(), 'system', 'itemspage_mobile_network',
DI::config()->get('system', 'itemspage_network_mobile'));
} else {
$limit = DI::pConfig()->get(local_user(), 'system', 'itemspage_network',
DI::config()->get('system', 'itemspage_network'));
}
$params['s'] = $tags;
$params['n'] = 100;
$entries = [];
foreach ([Search::getGlobalDirectory(), DI::baseUrl()] as $server) {
if (empty($server)) {
continue;
}
$msearch = json_decode(DI::httpClient()->post($server . '/msearch', $params)->getBody());
if (!empty($msearch)) {
$entries = match_get_contacts($msearch, $entries, $limit);
}
}
if (empty($entries)) {
info(DI::l10n()->t('No matches'));
}
$tpl = Renderer::getMarkupTemplate('viewcontact_template.tpl');
$o = Renderer::replaceMacros($tpl, [
'$title' => DI::l10n()->t('Profile Match'),
'$contacts' => array_slice($entries, 0, $limit),
]);
return $o;
}
function match_get_contacts($msearch, $entries, $limit)
{
if (empty($msearch->results)) {
return $entries;
}
foreach ($msearch->results as $profile) {
if (!$profile) {
continue;
}
// Already known contact
$contact = Contact::getByURL($profile->url, null, ['rel'], local_user());
if (!empty($contact) && in_array($contact['rel'], [Contact::FRIEND, Contact::SHARING])) {
continue;
}
$contact = Contact::getByURLForUser($profile->url, local_user());
if (!empty($contact)) {
$entries[$contact['id']] = ModuleContact::getContactTemplateVars($contact);
}
if (count($entries) == $limit) {
break;
}
}
return $entries;
}

View File

@ -39,34 +39,34 @@ function message_init(App $a)
$tabs = '';
if (DI::args()->getArgc() > 1 && is_numeric(DI::args()->getArgv()[1])) {
$tabs = render_messages(get_messages(local_user(), 0, 5), 'mail_list.tpl');
$tabs = render_messages(get_messages(DI::userSession()->getLocalUserId(), 0, 5), 'mail_list.tpl');
}
$new = [
'label' => DI::l10n()->t('New Message'),
'url' => 'message/new',
'sel' => DI::args()->getArgc() > 1 && DI::args()->getArgv()[1] == 'new',
'label' => DI::l10n()->t('New Message'),
'url' => 'message/new',
'sel' => DI::args()->getArgc() > 1 && DI::args()->getArgv()[1] == 'new',
'accesskey' => 'm',
];
$tpl = Renderer::getMarkupTemplate('message_side.tpl');
DI::page()['aside'] = Renderer::replaceMacros($tpl, [
'$tabs' => $tabs,
'$new' => $new,
'$new' => $new,
]);
$base = DI::baseUrl();
$head_tpl = Renderer::getMarkupTemplate('message-head.tpl');
DI::page()['htmlhead'] .= Renderer::replaceMacros($head_tpl, [
'$baseurl' => DI::baseUrl()->get(true),
'$base' => $base
'$base' => $base
]);
}
function message_post(App $a)
{
if (!local_user()) {
notice(DI::l10n()->t('Permission denied.'));
if (!DI::userSession()->getLocalUserId()) {
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
return;
}
@ -80,17 +80,20 @@ function message_post(App $a)
switch ($ret) {
case -1:
notice(DI::l10n()->t('No recipient selected.'));
DI::sysmsg()->addNotice(DI::l10n()->t('No recipient selected.'));
$norecip = true;
break;
case -2:
notice(DI::l10n()->t('Unable to locate contact information.'));
DI::sysmsg()->addNotice(DI::l10n()->t('Unable to locate contact information.'));
break;
case -3:
notice(DI::l10n()->t('Message could not be sent.'));
DI::sysmsg()->addNotice(DI::l10n()->t('Message could not be sent.'));
break;
case -4:
notice(DI::l10n()->t('Message collection failure.'));
DI::sysmsg()->addNotice(DI::l10n()->t('Message collection failure.'));
break;
}
@ -107,8 +110,8 @@ function message_content(App $a)
$o = '';
Nav::setSelected('messages');
if (!local_user()) {
notice(DI::l10n()->t('Permission denied.'));
if (!DI::userSession()->getLocalUserId()) {
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
return Login::form();
}
@ -118,20 +121,20 @@ function message_content(App $a)
if (DI::args()->getArgc() > 1 && DI::args()->getArgv()[1] == 'new') {
$button = [
'label' => DI::l10n()->t('Discard'),
'url' => '/message',
'sel' => 'close',
'url' => '/message',
'sel' => 'close',
];
} else {
$button = [
'label' => DI::l10n()->t('New Message'),
'url' => '/message/new',
'sel' => 'new',
'label' => DI::l10n()->t('New Message'),
'url' => '/message/new',
'sel' => 'new',
'accesskey' => 'm',
];
}
$header = Renderer::replaceMacros($tpl, [
'$messages' => DI::l10n()->t('Messages'),
'$button' => $button,
'$button' => $button,
]);
if ((DI::args()->getArgc() == 3) && (DI::args()->getArgv()[1] === 'drop' || DI::args()->getArgv()[1] === 'dropconv')) {
@ -141,29 +144,29 @@ function message_content(App $a)
$cmd = DI::args()->getArgv()[1];
if ($cmd === 'drop') {
$message = DBA::selectFirst('mail', ['convid'], ['id' => DI::args()->getArgv()[2], 'uid' => local_user()]);
$message = DBA::selectFirst('mail', ['convid'], ['id' => DI::args()->getArgv()[2], 'uid' => DI::userSession()->getLocalUserId()]);
if(!DBA::isResult($message)){
notice(DI::l10n()->t('Conversation not found.'));
DI::sysmsg()->addNotice(DI::l10n()->t('Conversation not found.'));
DI::baseUrl()->redirect('message');
}
if (!DBA::delete('mail', ['id' => DI::args()->getArgv()[2], 'uid' => local_user()])) {
notice(DI::l10n()->t('Message was not deleted.'));
if (!DBA::delete('mail', ['id' => DI::args()->getArgv()[2], 'uid' => DI::userSession()->getLocalUserId()])) {
DI::sysmsg()->addNotice(DI::l10n()->t('Message was not deleted.'));
}
$conversation = DBA::selectFirst('mail', ['id'], ['convid' => $message['convid'], 'uid' => local_user()]);
$conversation = DBA::selectFirst('mail', ['id'], ['convid' => $message['convid'], 'uid' => DI::userSession()->getLocalUserId()]);
if(!DBA::isResult($conversation)){
DI::baseUrl()->redirect('message');
}
DI::baseUrl()->redirect('message/' . $conversation['id'] );
} else {
$parentmail = DBA::selectFirst('mail', ['parent-uri'], ['id' => DI::args()->getArgv()[2], 'uid' => local_user()]);
$parentmail = DBA::selectFirst('mail', ['parent-uri'], ['id' => DI::args()->getArgv()[2], 'uid' => DI::userSession()->getLocalUserId()]);
if (DBA::isResult($parentmail)) {
$parent = $parentmail['parent-uri'];
if (!DBA::delete('mail', ['parent-uri' => $parent, 'uid' => local_user()])) {
notice(DI::l10n()->t('Conversation was not removed.'));
if (!DBA::delete('mail', ['parent-uri' => $parent, 'uid' => DI::userSession()->getLocalUserId()])) {
DI::sysmsg()->addNotice(DI::l10n()->t('Conversation was not removed.'));
}
}
DI::baseUrl()->redirect('message');
@ -186,19 +189,19 @@ function message_content(App $a)
$tpl = Renderer::getMarkupTemplate('prv_message.tpl');
$o .= Renderer::replaceMacros($tpl, [
'$header' => DI::l10n()->t('Send Private Message'),
'$to' => DI::l10n()->t('To:'),
'$subject' => DI::l10n()->t('Subject:'),
'$subjtxt' => $_REQUEST['subject'] ?? '',
'$text' => $_REQUEST['body'] ?? '',
'$readonly' => '',
'$yourmessage'=> DI::l10n()->t('Your message:'),
'$select' => $select,
'$parent' => '',
'$upload' => DI::l10n()->t('Upload photo'),
'$insert' => DI::l10n()->t('Insert web link'),
'$wait' => DI::l10n()->t('Please wait'),
'$submit' => DI::l10n()->t('Submit')
'$header' => DI::l10n()->t('Send Private Message'),
'$to' => DI::l10n()->t('To:'),
'$subject' => DI::l10n()->t('Subject:'),
'$subjtxt' => $_REQUEST['subject'] ?? '',
'$text' => $_REQUEST['body'] ?? '',
'$readonly' => '',
'$yourmessage' => DI::l10n()->t('Your message:'),
'$select' => $select,
'$parent' => '',
'$upload' => DI::l10n()->t('Upload photo'),
'$insert' => DI::l10n()->t('Insert web link'),
'$wait' => DI::l10n()->t('Please wait'),
'$submit' => DI::l10n()->t('Submit')
]);
return $o;
}
@ -212,14 +215,14 @@ function message_content(App $a)
$o .= $header;
$total = DBA::count('mail', ['uid' => local_user()], ['distinct' => true, 'expression' => 'parent-uri']);
$total = DBA::count('mail', ['uid' => DI::userSession()->getLocalUserId()], ['distinct' => true, 'expression' => 'parent-uri']);
$pager = new Pager(DI::l10n(), DI::args()->getQueryString());
$r = get_messages(local_user(), $pager->getStart(), $pager->getItemsPerPage());
$r = get_messages(DI::userSession()->getLocalUserId(), $pager->getStart(), $pager->getItemsPerPage());
if (!DBA::isResult($r)) {
notice(DI::l10n()->t('No messages.'));
DI::sysmsg()->addNotice(DI::l10n()->t('No messages.'));
return $o;
}
@ -240,14 +243,14 @@ function message_content(App $a)
LEFT JOIN `contact` ON `mail`.`contact-id` = `contact`.`id`
WHERE `mail`.`uid` = ? AND `mail`.`id` = ?
LIMIT 1",
local_user(),
DI::userSession()->getLocalUserId(),
DI::args()->getArgv()[1]
);
if (DBA::isResult($message)) {
$contact_id = $message['contact-id'];
$params = [
local_user(),
DI::userSession()->getLocalUserId(),
$message['parent-uri']
];
@ -269,13 +272,13 @@ function message_content(App $a)
$messages = DBA::toArray($messages_stmt);
DBA::update('mail', ['seen' => 1], ['parent-uri' => $message['parent-uri'], 'uid' => local_user()]);
DBA::update('mail', ['seen' => 1], ['parent-uri' => $message['parent-uri'], 'uid' => DI::userSession()->getLocalUserId()]);
} else {
$messages = false;
}
if (!DBA::isResult($messages)) {
notice(DI::l10n()->t('Message not available.'));
DI::sysmsg()->addNotice(DI::l10n()->t('Message not available.'));
return $o;
}
@ -312,18 +315,18 @@ function message_content(App $a)
$from_photo = Contact::getThumb($contact);
$mails[] = [
'id' => $message['id'],
'from_name' => $from_name_e,
'from_url' => $from_url,
'from_addr' => $contact['addr'] ?? $from_url,
'sparkle' => $sparkle,
'id' => $message['id'],
'from_name' => $from_name_e,
'from_url' => $from_url,
'from_addr' => $contact['addr'] ?? $from_url,
'sparkle' => $sparkle,
'from_photo' => $from_photo,
'subject' => $subject_e,
'body' => $body_e,
'delete' => DI::l10n()->t('Delete message'),
'to_name' => $to_name_e,
'date' => DateTimeFormat::local($message['created'], DI::l10n()->t('D, d M Y - g:i A')),
'ago' => Temporal::getRelativeDate($message['created']),
'subject' => $subject_e,
'body' => $body_e,
'delete' => DI::l10n()->t('Delete message'),
'to_name' => $to_name_e,
'date' => DateTimeFormat::local($message['created'], DI::l10n()->t('D, d M Y - g:i A')),
'ago' => Temporal::getRelativeDate($message['created']),
];
$seen = $message['seen'];
@ -334,28 +337,27 @@ function message_content(App $a)
$tpl = Renderer::getMarkupTemplate('mail_display.tpl');
$o = Renderer::replaceMacros($tpl, [
'$thread_id' => DI::args()->getArgv()[1],
'$thread_id' => DI::args()->getArgv()[1],
'$thread_subject' => $message['title'],
'$thread_seen' => $seen,
'$delete' => DI::l10n()->t('Delete conversation'),
'$canreply' => (($unknown) ? false : '1'),
'$unknown_text' => DI::l10n()->t("No secure communications available. You <strong>may</strong> be able to respond from the sender's profile page."),
'$mails' => $mails,
'$thread_seen' => $seen,
'$delete' => DI::l10n()->t('Delete conversation'),
'$canreply' => (($unknown) ? false : '1'),
'$unknown_text' => DI::l10n()->t("No secure communications available. You <strong>may</strong> be able to respond from the sender's profile page."),
'$mails' => $mails,
// reply
'$header' => DI::l10n()->t('Send Reply'),
'$to' => DI::l10n()->t('To:'),
'$subject' => DI::l10n()->t('Subject:'),
'$subjtxt' => $message['title'],
'$readonly' => ' readonly="readonly" style="background: #BBBBBB;" ',
'$yourmessage' => DI::l10n()->t('Your message:'),
'$text' => '',
'$select' => $select,
'$parent' => $parent,
'$upload' => DI::l10n()->t('Upload photo'),
'$insert' => DI::l10n()->t('Insert web link'),
'$submit' => DI::l10n()->t('Submit'),
'$wait' => DI::l10n()->t('Please wait')
'$header' => DI::l10n()->t('Send Reply'),
'$to' => DI::l10n()->t('To:'),
'$subject' => DI::l10n()->t('Subject:'),
'$subjtxt' => $message['title'],
'$readonly' => ' readonly="readonly" style="background: #BBBBBB;" ',
'$yourmessage' => DI::l10n()->t('Your message:'),
'$text' => '',
'$select' => $select,
'$parent' => $parent,
'$upload' => DI::l10n()->t('Upload photo'),
'$insert' => DI::l10n()->t('Insert web link'),
'$submit' => DI::l10n()->t('Submit'),
'$wait' => DI::l10n()->t('Please wait')
]);
return $o;
@ -368,7 +370,7 @@ function message_content(App $a)
* @param int $limit
* @return array
*/
function get_messages(int $uid, int $start, int $limit)
function get_messages(int $uid, int $start, int $limit): array
{
return DBA::toArray(DBA::p('SELECT
m.`id`,
@ -392,21 +394,21 @@ function get_messages(int $uid, int $start, int $limit)
c.`url`,
c.`thumb`,
c.`network`,
m2.`count`,
m2.`mailcreated`,
m2.`mailseen`
FROM `mail` m
JOIN (
SELECT
`parent-uri`,
MIN(`id`) AS `id`,
COUNT(*) AS `count`,
MAX(`created`) AS `mailcreated`,
MIN(`seen`) AS `mailseen`
FROM `mail`
WHERE `uid` = ?
GROUP BY `parent-uri`
) m2 ON m.`parent-uri` = m2.`parent-uri` AND m.`id` = m2.`id`
m2.`count`,
m2.`mailcreated`,
m2.`mailseen`
FROM `mail` m
JOIN (
SELECT
`parent-uri`,
MIN(`id`) AS `id`,
COUNT(*) AS `count`,
MAX(`created`) AS `mailcreated`,
MIN(`seen`) AS `mailseen`
FROM `mail`
WHERE `uid` = ?
GROUP BY `parent-uri`
) m2 ON m.`parent-uri` = m2.`parent-uri` AND m.`id` = m2.`id`
LEFT JOIN `contact` c ON m.`contact-id` = c.`id`
WHERE m.`uid` = ?
ORDER BY m2.`mailcreated` DESC
@ -414,7 +416,7 @@ function get_messages(int $uid, int $start, int $limit)
, $uid, $uid, $start, $limit));
}
function render_messages(array $msg, $t)
function render_messages(array $msg, string $t): string
{
$a = DI::app();
@ -444,20 +446,20 @@ function render_messages(array $msg, $t)
$from_photo = Contact::getThumb($contact);
$rslt .= Renderer::replaceMacros($tpl, [
'$id' => $rr['id'],
'$from_name' => $participants,
'$from_url' => Contact::magicLink($rr['url']),
'$from_addr' => $contact['addr'] ?? '',
'$sparkle' => ' sparkle',
'$id' => $rr['id'],
'$from_name' => $participants,
'$from_url' => Contact::magicLink($rr['url']),
'$from_addr' => $contact['addr'] ?? '',
'$sparkle' => ' sparkle',
'$from_photo' => $from_photo,
'$subject' => $rr['title'],
'$delete' => DI::l10n()->t('Delete conversation'),
'$body' => $body_e,
'$to_name' => $to_name_e,
'$date' => DateTimeFormat::local($rr['mailcreated'], DI::l10n()->t('D, d M Y - g:i A')),
'$ago' => Temporal::getRelativeDate($rr['mailcreated']),
'$seen' => $rr['mailseen'],
'$count' => DI::l10n()->tt('%d message', '%d messages', $rr['count']),
'$subject' => $rr['title'],
'$delete' => DI::l10n()->t('Delete conversation'),
'$body' => $body_e,
'$to_name' => $to_name_e,
'$date' => DateTimeFormat::local($rr['mailcreated'], DI::l10n()->t('D, d M Y - g:i A')),
'$ago' => Temporal::getRelativeDate($rr['mailcreated']),
'$seen' => $rr['mailseen'],
'$count' => DI::l10n()->tt('%d message', '%d messages', $rr['count']),
]);
}

View File

@ -1,64 +0,0 @@
<?php
/**
* @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
use Friendica\App;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\User;
use Friendica\Util\Proxy;
function msearch_post(App $a)
{
$search = $_POST['s'] ?? '';
$perpage = intval(($_POST['n'] ?? 0) ?: 80);
$page = intval(($_POST['p'] ?? 0) ?: 1);
$startrec = ($page - 1) * $perpage;
$total = 0;
$results = [];
if (!strlen($search)) {
$output = ['total' => 0, 'items_page' => $perpage, 'page' => $page, 'results' => $results];
System::jsonExit($output);
}
$total = 0;
$condition = ["`net-publish` AND MATCH(`pub_keywords`) AGAINST (?)", $search];
$total = DBA::count('owner-view', $condition);
$search_stmt = DBA::select('owner-view', ['pub_keywords', 'name', 'nickname', 'uid'], $condition, ['limit' => [$startrec, $perpage]]);
while ($search_result = DBA::fetch($search_stmt)) {
$results[] = [
'name' => $search_result['name'],
'url' => DI::baseUrl() . '/profile/' . $search_result['nickname'],
'photo' => User::getAvatarUrl($search_result, Proxy::SIZE_THUMB),
'tags' => str_replace([',', ' '], [' ', ' '], $search_result['pub_keywords'])
];
}
DBA::close($search_stmt);
$output = ['total' => $total, 'items_page' => $perpage, 'page' => $page, 'results' => $results];
System::jsonExit($output);
}

View File

@ -30,7 +30,7 @@ use Friendica\Module\BaseProfile;
function notes_init(App $a)
{
if (! local_user()) {
if (! DI::userSession()->getLocalUserId()) {
return;
}
@ -38,21 +38,21 @@ function notes_init(App $a)
}
function notes_content(App $a, $update = false)
function notes_content(App $a, bool $update = false)
{
if (!local_user()) {
notice(DI::l10n()->t('Permission denied.'));
if (!DI::userSession()->getLocalUserId()) {
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
return;
}
$o = BaseProfile::getTabsHTML($a, 'notes', true, $a->getLoggedInUserNickname(), false);
$o = BaseProfile::getTabsHTML('notes', true, $a->getLoggedInUserNickname(), false);
if (!$update) {
$o .= '<h3>' . DI::l10n()->t('Personal Notes') . '</h3>';
$x = [
'lockstate' => 'lock',
'acl' => \Friendica\Core\ACL::getSelfOnlyHTML(local_user(), DI::l10n()->t('Personal notes are visible only by yourself.')),
'acl' => \Friendica\Core\ACL::getSelfOnlyHTML(DI::userSession()->getLocalUserId(), DI::l10n()->t('Personal notes are visible only by yourself.')),
'button' => DI::l10n()->t('Save'),
'acl_data' => '',
];
@ -60,14 +60,14 @@ function notes_content(App $a, $update = false)
$o .= DI::conversation()->statusEditor($x, $a->getContactId());
}
$condition = ['uid' => local_user(), 'post-type' => Item::PT_PERSONAL_NOTE, 'gravity' => GRAVITY_PARENT,
$condition = ['uid' => DI::userSession()->getLocalUserId(), 'post-type' => Item::PT_PERSONAL_NOTE, 'gravity' => Item::GRAVITY_PARENT,
'contact-id'=> $a->getContactId()];
if (DI::mode()->isMobile()) {
$itemsPerPage = DI::pConfig()->get(local_user(), 'system', 'itemspage_mobile_network',
$itemsPerPage = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_mobile_network',
DI::config()->get('system', 'itemspage_network_mobile'));
} else {
$itemsPerPage = DI::pConfig()->get(local_user(), 'system', 'itemspage_network',
$itemsPerPage = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_network',
DI::config()->get('system', 'itemspage_network'));
}
@ -75,7 +75,7 @@ function notes_content(App $a, $update = false)
$params = ['order' => ['created' => true],
'limit' => [$pager->getStart(), $pager->getItemsPerPage()]];
$r = Post::selectThreadForUser(local_user(), ['uri-id'], $condition, $params);
$r = Post::selectThreadForUser(DI::userSession()->getLocalUserId(), ['uri-id'], $condition, $params);
$count = 0;

View File

@ -20,6 +20,8 @@
*/
use Friendica\App;
use Friendica\Content\Text\BBCode;
use Friendica\Content\Text\HTML;
use Friendica\Core\System;
use Friendica\DI;
use Friendica\Module\Response;
@ -93,9 +95,9 @@ function oexchange_init(App $a)
System::httpExit($xml->saveXML(), Response::TYPE_XML, 'application/xrd+xml');
}
function oexchange_content(App $a) {
if (!local_user()) {
function oexchange_content(App $a)
{
if (!DI::userSession()->getLocalUserId()) {
$o = Login::form();
return $o;
}
@ -109,7 +111,7 @@ function oexchange_content(App $a) {
$description = !empty($_REQUEST['description']) ? trim($_REQUEST['description']) : '';
$tags = !empty($_REQUEST['tags']) ? trim($_REQUEST['tags']) : '';
$s = \Friendica\Content\Text\BBCode::embedURL($url, true, $title, $description, $tags);
$s = BBCode::embedURL($url, true, $title, $description, $tags);
if (!strlen($s)) {
return;
@ -117,11 +119,10 @@ function oexchange_content(App $a) {
$post = [];
$post['profile_uid'] = local_user();
$post['return'] = '/oexchange/done';
$post['body'] = Friendica\Content\Text\HTML::toBBCode($s);
$post['body'] = HTML::toBBCode($s);
$_REQUEST = $post;
require_once('mod/item.php');
require_once 'mod/item.php';
item_post($a);
}

View File

@ -1,132 +0,0 @@
<?php
/**
* @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
use Friendica\App;
use Friendica\Core\Protocol;
use Friendica\DI;
use Friendica\Model\APContact;
use Friendica\Model\Contact;
use Friendica\Network\HTTPClient\Client\HttpClientAccept;
use Friendica\Protocol\ActivityPub;
function ostatus_subscribe_content(App $a)
{
if (!local_user()) {
notice(DI::l10n()->t('Permission denied.'));
DI::baseUrl()->redirect('ostatus_subscribe');
// NOTREACHED
}
$o = '<h2>' . DI::l10n()->t('Subscribing to contacts') . '</h2>';
$uid = local_user();
$counter = intval($_REQUEST['counter'] ?? 0);
if (DI::pConfig()->get($uid, 'ostatus', 'legacy_friends') == '') {
if ($_REQUEST['url'] == '') {
DI::pConfig()->delete($uid, 'ostatus', 'legacy_contact');
return $o . DI::l10n()->t('No contact provided.');
}
$contact = Contact::getByURL($_REQUEST['url']);
if (!$contact) {
DI::pConfig()->delete($uid, 'ostatus', 'legacy_contact');
return $o . DI::l10n()->t('Couldn\'t fetch information for contact.');
}
if ($contact['network'] == Protocol::OSTATUS) {
$api = $contact['baseurl'] . '/api/';
// Fetching friends
$curlResult = DI::httpClient()->get($api . 'statuses/friends.json?screen_name=' . $contact['nick'], HttpClientAccept::JSON);
if (!$curlResult->isSuccess()) {
DI::pConfig()->delete($uid, 'ostatus', 'legacy_contact');
return $o . DI::l10n()->t('Couldn\'t fetch friends for contact.');
}
$friends = $curlResult->getBody();
if (empty($friends)) {
DI::pConfig()->delete($uid, 'ostatus', 'legacy_contact');
return $o . DI::l10n()->t('Couldn\'t fetch following contacts.');
}
DI::pConfig()->set($uid, 'ostatus', 'legacy_friends', $friends);
} elseif ($apcontact = APContact::getByURL($contact['url'])) {
if (empty($apcontact['following'])) {
DI::pConfig()->delete($uid, 'ostatus', 'legacy_contact');
return $o . DI::l10n()->t('Couldn\'t fetch remote profile.');
}
$followings = ActivityPub::fetchItems($apcontact['following']);
if (empty($followings)) {
DI::pConfig()->delete($uid, 'ostatus', 'legacy_contact');
return $o . DI::l10n()->t('Couldn\'t fetch following contacts.');
}
DI::pConfig()->set($uid, 'ostatus', 'legacy_friends', json_encode($followings));
} else {
DI::pConfig()->delete($uid, 'ostatus', 'legacy_contact');
return $o . DI::l10n()->t('Unsupported network');
}
}
$friends = json_decode(DI::pConfig()->get($uid, 'ostatus', 'legacy_friends'));
if (empty($friends)) {
$friends = [];
}
$total = sizeof($friends);
if ($counter >= $total) {
DI::page()['htmlhead'] = '<meta http-equiv="refresh" content="0; URL=' . DI::baseUrl() . '/settings/connectors">';
DI::pConfig()->delete($uid, 'ostatus', 'legacy_friends');
DI::pConfig()->delete($uid, 'ostatus', 'legacy_contact');
$o .= DI::l10n()->t('Done');
return $o;
}
$friend = $friends[$counter++];
$url = $friend->statusnet_profile_url ?? $friend;
$o .= '<p>' . $counter . '/' . $total . ': ' . $url;
$probed = Contact::getByURL($url);
if (in_array($probed['network'], Protocol::FEDERATED)) {
$result = Contact::createFromProbeForUser($a->getLoggedInUserId(), $probed['url']);
if ($result['success']) {
$o .= ' - ' . DI::l10n()->t('success');
} else {
$o .= ' - ' . DI::l10n()->t('failed');
}
} else {
$o .= ' - ' . DI::l10n()->t('ignored');
}
$o .= '</p>';
$o .= '<p>' . DI::l10n()->t('Keep this window open until done.') . '</p>';
DI::page()['htmlhead'] = '<meta http-equiv="refresh" content="0; URL=' . DI::baseUrl() . '/ostatus_subscribe?counter=' . $counter . '">';
return $o;
}

View File

@ -20,7 +20,6 @@
*/
use Friendica\App;
use Friendica\Content\Feature;
use Friendica\Content\Nav;
use Friendica\Content\Pager;
use Friendica\Content\Text\BBCode;
@ -30,7 +29,6 @@ use Friendica\Core\Addon;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
@ -42,22 +40,21 @@ use Friendica\Model\Profile;
use Friendica\Model\Tag;
use Friendica\Model\User;
use Friendica\Module\BaseProfile;
use Friendica\Network\HTTPException;
use Friendica\Network\Probe;
use Friendica\Object\Image;
use Friendica\Protocol\Activity;
use Friendica\Security\Security;
use Friendica\Util\Crypto;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Images;
use Friendica\Util\Map;
use Friendica\Security\Security;
use Friendica\Util\Strings;
use Friendica\Util\Temporal;
use Friendica\Util\XML;
use Friendica\Network\HTTPException;
function photos_init(App $a) {
if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
function photos_init(App $a)
{
if (DI::config()->get('system', 'block_public') && !DI::userSession()->isAuthenticated()) {
return;
}
@ -69,11 +66,11 @@ function photos_init(App $a) {
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
}
$is_owner = (local_user() && (local_user() == $owner['uid']));
$is_owner = (DI::userSession()->getLocalUserId() && (DI::userSession()->getLocalUserId() == $owner['uid']));
$albums = Photo::getAlbums($owner['uid']);
$albums_visible = ((intval($owner['hidewall']) && !Session::isAuthenticated()) ? false : true);
$albums_visible = ((intval($owner['hidewall']) && !DI::userSession()->isAuthenticated()) ? false : true);
// add various encodings to the array so we can just loop through and pick them out in a template
$ret = ['success' => false];
@ -96,7 +93,7 @@ function photos_init(App $a) {
}
}
if (local_user() && $owner['uid'] == local_user()) {
if (DI::userSession()->getLocalUserId() && $owner['uid'] == DI::userSession()->getLocalUserId()) {
$can_post = true;
} else {
$can_post = false;
@ -148,23 +145,23 @@ function photos_post(App $a)
$page_owner_uid = intval($user['uid']);
$community_page = $user['page-flags'] == User::PAGE_FLAGS_COMMUNITY;
if (local_user() && (local_user() == $page_owner_uid)) {
if (DI::userSession()->getLocalUserId() && (DI::userSession()->getLocalUserId() == $page_owner_uid)) {
$can_post = true;
} elseif ($community_page && !empty(Session::getRemoteContactID($page_owner_uid))) {
$contact_id = Session::getRemoteContactID($page_owner_uid);
} elseif ($community_page && !empty(DI::userSession()->getRemoteContactID($page_owner_uid))) {
$contact_id = DI::userSession()->getRemoteContactID($page_owner_uid);
$can_post = true;
$visitor = $contact_id;
}
if (!$can_post) {
notice(DI::l10n()->t('Permission denied.'));
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
System::exit();
}
$owner_record = User::getOwnerDataById($page_owner_uid);
if (!$owner_record) {
notice(DI::l10n()->t('Contact information unavailable'));
DI::sysmsg()->addNotice(DI::l10n()->t('Contact information unavailable'));
DI::logger()->info('photos_post: unable to locate contact record for page owner. uid=' . $page_owner_uid);
System::exit();
}
@ -193,7 +190,7 @@ function photos_post(App $a)
$album = hex2bin(DI::args()->getArgv()[3]);
if (!DBA::exists('photo', ['album' => $album, 'uid' => $page_owner_uid, 'photo-type' => Photo::DEFAULT])) {
notice(DI::l10n()->t('Album not found.'));
DI::sysmsg()->addNotice(DI::l10n()->t('Album not found.'));
DI::baseUrl()->redirect('photos/' . $user['nickname'] . '/album');
return; // NOTREACHED
}
@ -229,7 +226,7 @@ function photos_post(App $a)
));
} else {
$r = DBA::toArray(DBA::p("SELECT distinct(`resource-id`) as `rid` FROM `photo` WHERE `uid` = ? AND `album` = ?",
local_user(),
DI::userSession()->getLocalUserId(),
$album
));
}
@ -247,9 +244,9 @@ function photos_post(App $a)
// Update the photo albums cache
Photo::clearAlbumCache($page_owner_uid);
notice(DI::l10n()->t('Album successfully deleted'));
DI::sysmsg()->addNotice(DI::l10n()->t('Album successfully deleted'));
} else {
notice(DI::l10n()->t('Album was empty.'));
DI::sysmsg()->addNotice(DI::l10n()->t('Album was empty.'));
}
}
@ -268,7 +265,7 @@ function photos_post(App $a)
$condition = ['contact-id' => $visitor, 'uid' => $page_owner_uid, 'resource-id' => DI::args()->getArgv()[3]];
} else {
$condition = ['uid' => local_user(), 'resource-id' => DI::args()->getArgv()[3]];
$condition = ['uid' => DI::userSession()->getLocalUserId(), 'resource-id' => DI::args()->getArgv()[3]];
}
$photo = DBA::selectFirst('photo', ['resource-id'], $condition);
@ -281,12 +278,11 @@ function photos_post(App $a)
// Update the photo albums cache
Photo::clearAlbumCache($page_owner_uid);
} else {
notice(DI::l10n()->t('Failed to delete the photo.'));
DI::sysmsg()->addNotice(DI::l10n()->t('Failed to delete the photo.'));
DI::baseUrl()->redirect('photos/' . DI::args()->getArgv()[1] . '/image/' . DI::args()->getArgv()[3]);
}
DI::baseUrl()->redirect('photos/' . DI::args()->getArgv()[1]);
return; // NOTREACHED
DI::baseUrl()->redirect('profile/' . DI::args()->getArgv()[1] . '/photos');
}
}
@ -526,44 +522,40 @@ function photos_post(App $a)
foreach ($taginfo as $tagged) {
$uri = Item::newURI();
$arr = [];
$arr['guid'] = System::createUUID();
$arr['uid'] = $page_owner_uid;
$arr['uri'] = $uri;
$arr['wall'] = 1;
$arr['contact-id'] = $owner_record['id'];
$arr['owner-name'] = $owner_record['name'];
$arr['owner-link'] = $owner_record['url'];
$arr['owner-avatar'] = $owner_record['thumb'];
$arr['author-name'] = $owner_record['name'];
$arr['author-link'] = $owner_record['url'];
$arr['author-avatar'] = $owner_record['thumb'];
$arr['title'] = '';
$arr['allow_cid'] = $photo['allow_cid'];
$arr['allow_gid'] = $photo['allow_gid'];
$arr['deny_cid'] = $photo['deny_cid'];
$arr['deny_gid'] = $photo['deny_gid'];
$arr['visible'] = 0;
$arr['verb'] = Activity::TAG;
$arr['gravity'] = GRAVITY_PARENT;
$arr['object-type'] = Activity\ObjectType::PERSON;
$arr['target-type'] = Activity\ObjectType::IMAGE;
$arr['inform'] = $tagged[2];
$arr['origin'] = 1;
$arr['body'] = DI::l10n()->t('%1$s was tagged in %2$s by %3$s', '[url=' . $tagged[1] . ']' . $tagged[0] . '[/url]', '[url=' . DI::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo['resource-id'] . ']' . DI::l10n()->t('a photo') . '[/url]', '[url=' . $owner_record['url'] . ']' . $owner_record['name'] . '[/url]') ;
$arr['body'] .= "\n\n" . '[url=' . DI::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo['resource-id'] . ']' . '[img]' . DI::baseUrl() . "/photo/" . $photo['resource-id'] . '-' . $best . '.' . $ext . '[/img][/url]' . "\n" ;
$arr = [
'guid' => System::createUUID(),
'uid' => $page_owner_uid,
'uri' => $uri,
'wall' => 1,
'contact-id' => $owner_record['id'],
'owner-name' => $owner_record['name'],
'owner-link' => $owner_record['url'],
'owner-avatar' => $owner_record['thumb'],
'author-name' => $owner_record['name'],
'author-link' => $owner_record['url'],
'author-avatar' => $owner_record['thumb'],
'title' => '',
'allow_cid' => $photo['allow_cid'],
'allow_gid' => $photo['allow_gid'],
'deny_cid' => $photo['deny_cid'],
'deny_gid' => $photo['deny_gid'],
'visible' => 0,
'verb' => Activity::TAG,
'gravity' => Item::GRAVITY_PARENT,
'object-type' => Activity\ObjectType::PERSON,
'target-type' => Activity\ObjectType::IMAGE,
'inform' => $tagged[2],
'origin' => 1,
'body' => DI::l10n()->t('%1$s was tagged in %2$s by %3$s', '[url=' . $tagged[1] . ']' . $tagged[0] . '[/url]', '[url=' . DI::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo['resource-id'] . ']' . DI::l10n()->t('a photo') . '[/url]', '[url=' . $owner_record['url'] . ']' . $owner_record['name'] . '[/url]') . "\n\n" . '[url=' . DI::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo['resource-id'] . ']' . '[img]' . DI::baseUrl() . '/photo/' . $photo['resource-id'] . '-' . $best . '.' . $ext . '[/img][/url]' . "\n",
'object' => '<object><type>' . Activity\ObjectType::PERSON . '</type><title>' . $tagged[0] . '</title><id>' . $tagged[1] . '/' . $tagged[0] . '</id><link>' . XML::escape('<link rel="alternate" type="text/html" href="' . $tagged[1] . '" />' . "\n"),
'target' => '<target><type>' . Activity\ObjectType::IMAGE . '</type><title>' . $photo['desc'] . '</title><id>' . DI::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo['resource-id'] . '</id><link>' . XML::escape('<link rel="alternate" type="text/html" href="' . DI::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo['resource-id'] . '" />' . "\n" . '<link rel="preview" type="' . $photo['type'] . '" href="' . DI::baseUrl() . '/photo/' . $photo['resource-id'] . '-' . $best . '.' . $ext . '" />') . '</link></target>',
];
$arr['object'] = '<object><type>' . Activity\ObjectType::PERSON . '</type><title>' . $tagged[0] . '</title><id>' . $tagged[1] . '/' . $tagged[0] . '</id>';
$arr['object'] .= '<link>' . XML::escape('<link rel="alternate" type="text/html" href="' . $tagged[1] . '" />' . "\n");
if ($tagged[3]) {
$arr['object'] .= XML::escape('<link rel="photo" type="' . $photo['type'] . '" href="' . $tagged[3]['photo'] . '" />' . "\n");
}
$arr['object'] .= '</link></object>' . "\n";
$arr['target'] = '<target><type>' . Activity\ObjectType::IMAGE . '</type><title>' . $photo['desc'] . '</title><id>'
. DI::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo['resource-id'] . '</id>';
$arr['target'] .= '<link>' . XML::escape('<link rel="alternate" type="text/html" href="' . DI::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo['resource-id'] . '" />' . "\n" . '<link rel="preview" type="' . $photo['type'] . '" href="' . DI::baseUrl() . "/photo/" . $photo['resource-id'] . '-' . $best . '.' . $ext . '" />') . '</link></target>';
Item::insert($arr);
}
}
@ -571,219 +563,11 @@ function photos_post(App $a)
DI::baseUrl()->redirect($_SESSION['photo_return']);
return; // NOTREACHED
}
// default post action - upload a photo
Hook::callAll('photo_post_init', $_POST);
// Determine the album to use
$album = trim($_REQUEST['album'] ?? '');
$newalbum = trim($_REQUEST['newalbum'] ?? '');
Logger::debug('album= ' . $album . ' newalbum= ' . $newalbum);
if (!strlen($album)) {
if (strlen($newalbum)) {
$album = $newalbum;
} else {
$album = DateTimeFormat::localNow('Y');
}
}
/*
* We create a wall item for every photo, but we don't want to
* overwhelm the data stream with a hundred newly uploaded photos.
* So we will make the first photo uploaded to this album in the last several hours
* visible by default, the rest will become visible over time when and if
* they acquire comments, likes, dislikes, and/or tags
*/
$r = Photo::selectToArray([], ['`album` = ? AND `uid` = ? AND `created` > ?', $album, $page_owner_uid, DateTimeFormat::utc('now - 3 hours')]);
if (!DBA::isResult($r) || ($album == DI::l10n()->t(Photo::PROFILE_PHOTOS))) {
$visible = 1;
} else {
$visible = 0;
}
if (!empty($_REQUEST['not_visible']) && $_REQUEST['not_visible'] !== 'false') {
$visible = 0;
}
$ret = ['src' => '', 'filename' => '', 'filesize' => 0, 'type' => ''];
Hook::callAll('photo_post_file', $ret);
if (!empty($ret['src']) && !empty($ret['filesize'])) {
$src = $ret['src'];
$filename = $ret['filename'];
$filesize = $ret['filesize'];
$type = $ret['type'];
$error = UPLOAD_ERR_OK;
} elseif (!empty($_FILES['userfile'])) {
$src = $_FILES['userfile']['tmp_name'];
$filename = basename($_FILES['userfile']['name']);
$filesize = intval($_FILES['userfile']['size']);
$type = $_FILES['userfile']['type'];
$error = $_FILES['userfile']['error'];
} else {
$error = UPLOAD_ERR_NO_FILE;
}
if ($error !== UPLOAD_ERR_OK) {
switch ($error) {
case UPLOAD_ERR_INI_SIZE:
notice(DI::l10n()->t('Image exceeds size limit of %s', ini_get('upload_max_filesize')));
break;
case UPLOAD_ERR_FORM_SIZE:
notice(DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($_REQUEST['MAX_FILE_SIZE'] ?? 0)));
break;
case UPLOAD_ERR_PARTIAL:
notice(DI::l10n()->t('Image upload didn\'t complete, please try again'));
break;
case UPLOAD_ERR_NO_FILE:
notice(DI::l10n()->t('Image file is missing'));
break;
case UPLOAD_ERR_NO_TMP_DIR:
case UPLOAD_ERR_CANT_WRITE:
case UPLOAD_ERR_EXTENSION:
notice(DI::l10n()->t('Server can\'t accept new file upload at this time, please contact your administrator'));
break;
}
@unlink($src);
$foo = 0;
Hook::callAll('photo_post_end', $foo);
return;
}
$type = Images::getMimeTypeBySource($src, $filename, $type);
Logger::info('photos: upload: received file: ' . $filename . ' as ' . $src . ' ('. $type . ') ' . $filesize . ' bytes');
$maximagesize = DI::config()->get('system', 'maximagesize');
if ($maximagesize && ($filesize > $maximagesize)) {
notice(DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize)));
@unlink($src);
$foo = 0;
Hook::callAll('photo_post_end', $foo);
return;
}
if (!$filesize) {
notice(DI::l10n()->t('Image file is empty.'));
@unlink($src);
$foo = 0;
Hook::callAll('photo_post_end', $foo);
return;
}
Logger::debug('loading contents', ['src' => $src]);
$imagedata = @file_get_contents($src);
$image = new Image($imagedata, $type);
if (!$image->isValid()) {
Logger::notice('unable to process image');
notice(DI::l10n()->t('Unable to process image.'));
@unlink($src);
$foo = 0;
Hook::callAll('photo_post_end',$foo);
return;
}
$exif = $image->orient($src);
@unlink($src);
$max_length = DI::config()->get('system', 'max_image_length');
if ($max_length > 0) {
$image->scaleDown($max_length);
}
$width = $image->getWidth();
$height = $image->getHeight();
$smallest = 0;
$resource_id = Photo::newResource();
$r = Photo::store($image, $page_owner_uid, $visitor, $resource_id, $filename, $album, 0 , Photo::DEFAULT, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny);
if (!$r) {
Logger::warning('image store failed');
notice(DI::l10n()->t('Image upload failed.'));
return;
}
if ($width > 640 || $height > 640) {
$image->scaleDown(640);
Photo::store($image, $page_owner_uid, $visitor, $resource_id, $filename, $album, 1, Photo::DEFAULT, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny);
$smallest = 1;
}
if ($width > 320 || $height > 320) {
$image->scaleDown(320);
Photo::store($image, $page_owner_uid, $visitor, $resource_id, $filename, $album, 2, Photo::DEFAULT, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny);
$smallest = 2;
}
$uri = Item::newURI();
// Create item container
$lat = $lon = null;
if (!empty($exif['GPS']) && Feature::isEnabled($page_owner_uid, 'photo_location')) {
$lat = Photo::getGps($exif['GPS']['GPSLatitude'], $exif['GPS']['GPSLatitudeRef']);
$lon = Photo::getGps($exif['GPS']['GPSLongitude'], $exif['GPS']['GPSLongitudeRef']);
}
$arr = [];
if ($lat && $lon) {
$arr['coord'] = $lat . ' ' . $lon;
}
$arr['guid'] = System::createUUID();
$arr['uid'] = $page_owner_uid;
$arr['uri'] = $uri;
$arr['post-type'] = Item::PT_IMAGE;
$arr['wall'] = 1;
$arr['resource-id'] = $resource_id;
$arr['contact-id'] = $owner_record['id'];
$arr['owner-name'] = $owner_record['name'];
$arr['owner-link'] = $owner_record['url'];
$arr['owner-avatar'] = $owner_record['thumb'];
$arr['author-name'] = $owner_record['name'];
$arr['author-link'] = $owner_record['url'];
$arr['author-avatar'] = $owner_record['thumb'];
$arr['title'] = '';
$arr['allow_cid'] = $str_contact_allow;
$arr['allow_gid'] = $str_group_allow;
$arr['deny_cid'] = $str_contact_deny;
$arr['deny_gid'] = $str_group_deny;
$arr['visible'] = $visible;
$arr['origin'] = 1;
$arr['body'] = '[url=' . DI::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $resource_id . ']'
. '[img]' . DI::baseUrl() . "/photo/{$resource_id}-{$smallest}.".$image->getExt() . '[/img]'
. '[/url]';
$item_id = Item::insert($arr);
// Update the photo albums cache
Photo::clearAlbumCache($page_owner_uid);
Hook::callAll('photo_post_end', $item_id);
// addon uploaders should call "exit()" within the photo_post_end hook
// if they do not wish to be redirected
DI::baseUrl()->redirect($_SESSION['photo_return']);
// NOTREACHED
}
function photos_content(App $a)
{
// URLs:
// photos/name
// photos/name/upload
// photos/name/upload/xxxxx (xxxxx is album name)
// photos/name/album/xxxxx
@ -793,18 +577,18 @@ function photos_content(App $a)
// photos/name/image/xxxxx/edit
// photos/name/image/xxxxx/drop
$user = User::getByNickname(DI::args()->getArgv()[1]);
$user = User::getByNickname(DI::args()->getArgv()[1] ?? '');
if (!DBA::isResult($user)) {
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
}
if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
notice(DI::l10n()->t('Public access denied.'));
if (DI::config()->get('system', 'block_public') && !DI::userSession()->isAuthenticated()) {
DI::sysmsg()->addNotice(DI::l10n()->t('Public access denied.'));
return;
}
if (empty($user)) {
notice(DI::l10n()->t('No photos selected'));
DI::sysmsg()->addNotice(DI::l10n()->t('No photos selected'));
return;
}
@ -844,10 +628,10 @@ function photos_content(App $a)
$community_page = (($user['page-flags'] == User::PAGE_FLAGS_COMMUNITY) ? true : false);
if (local_user() && (local_user() == $owner_uid)) {
if (DI::userSession()->getLocalUserId() && (DI::userSession()->getLocalUserId() == $owner_uid)) {
$can_post = true;
} elseif ($community_page && !empty(Session::getRemoteContactID($owner_uid))) {
$contact_id = Session::getRemoteContactID($owner_uid);
} elseif ($community_page && !empty(DI::userSession()->getRemoteContactID($owner_uid))) {
$contact_id = DI::userSession()->getRemoteContactID($owner_uid);
$contact = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => $owner_uid, 'blocked' => false, 'pending' => false]);
if (DBA::isResult($contact)) {
@ -858,23 +642,22 @@ function photos_content(App $a)
}
// perhaps they're visiting - but not a community page, so they wouldn't have write access
if (!empty(Session::getRemoteContactID($owner_uid)) && !$visitor) {
$contact_id = Session::getRemoteContactID($owner_uid);
if (!empty(DI::userSession()->getRemoteContactID($owner_uid)) && !$visitor) {
$contact_id = DI::userSession()->getRemoteContactID($owner_uid);
$contact = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => $owner_uid, 'blocked' => false, 'pending' => false]);
$remote_contact = DBA::isResult($contact);
}
if (!$remote_contact && local_user()) {
if (!$remote_contact && DI::userSession()->getLocalUserId()) {
$contact_id = $_SESSION['cid'];
$contact = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => $owner_uid, 'blocked' => false, 'pending' => false]);
}
if ($user['hidewall'] && (local_user() != $owner_uid) && !$remote_contact) {
notice(DI::l10n()->t('Access to this item is restricted.'));
return;
if ($user['hidewall'] && !DI::userSession()->isAuthenticated()) {
DI::baseUrl()->redirect('profile/' . $user['nickname'] . '/restricted');
}
$sql_extra = Security::getPermissionsSQLByUserId($owner_uid);
@ -882,16 +665,19 @@ function photos_content(App $a)
$o = "";
// tabs
$is_owner = (local_user() && (local_user() == $owner_uid));
$o .= BaseProfile::getTabsHTML($a, 'photos', $is_owner, $user['nickname'], $profile['hide-friends']);
$is_owner = (DI::userSession()->getLocalUserId() && (DI::userSession()->getLocalUserId() == $owner_uid));
$o .= BaseProfile::getTabsHTML('photos', $is_owner, $user['nickname'], $profile['hide-friends']);
// Display upload form
if ($datatype === 'upload') {
if (!$can_post) {
notice(DI::l10n()->t('Permission denied.'));
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
return;
}
// This prevents the photo upload form to return to itself without a hint the picture has been correctly uploaded.
DI::session()->remove('photo_return');
$selname = (!is_null($datum) && Strings::isHex($datum)) ? hex2bin($datum) : '';
$albumselect = '';
@ -910,7 +696,7 @@ function photos_content(App $a)
$uploader = '';
$ret = ['post_url' => 'photos/' . $user['nickname'],
$ret = ['post_url' => 'profile/' . $user['nickname'] . '/photos',
'addon_text' => $uploader,
'default_upload' => true];
@ -921,7 +707,20 @@ function photos_content(App $a)
'$submit' => DI::l10n()->t('Submit'),
]);
$usage_message = '';
// Get the relevant size limits for uploads. Abbreviated var names: MaxImageSize -> mis; upload_max_filesize -> umf
$mis_bytes = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize'));
$umf_bytes = Strings::getBytesFromShorthand(ini_get('upload_max_filesize'));
// Per Friendica definition a value of '0' means unlimited:
If ($mis_bytes == 0) {
$mis_bytes = INF;
}
// When PHP is configured with upload_max_filesize less than maximagesize provide this lower limit.
$maximagesize_bytes = (is_numeric($mis_bytes) && ($mis_bytes < $umf_bytes) ? $mis_bytes : $umf_bytes);
// @todo We may be want to use appropriate binary prefixed dynamicly
$usage_message = DI::l10n()->t('The maximum accepted image size is %s', Strings::formatBytes($maximagesize_bytes));
$tpl = Renderer::getMarkupTemplate('photos_upload.tpl');
@ -1088,9 +887,9 @@ function photos_content(App $a)
if (!DBA::isResult($ph)) {
if (DBA::exists('photo', ['resource-id' => $datum, 'uid' => $owner_uid])) {
notice(DI::l10n()->t('Permission denied. Access to this item may be restricted.'));
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied. Access to this item may be restricted.'));
} else {
notice(DI::l10n()->t('Photo not available'));
DI::sysmsg()->addNotice(DI::l10n()->t('Photo not available'));
}
return;
}
@ -1201,7 +1000,7 @@ function photos_content(App $a)
}
if (
$ph[0]['uid'] == local_user()
$ph[0]['uid'] == DI::userSession()->getLocalUserId()
&& (strlen($ph[0]['allow_cid']) || strlen($ph[0]['allow_gid']) || strlen($ph[0]['deny_cid']) || strlen($ph[0]['deny_gid']))
) {
$tools['lock'] = DI::l10n()->t('Private Photo');
@ -1233,7 +1032,7 @@ function photos_content(App $a)
$link_item = Post::selectFirst([], ["`resource-id` = ?" . $sql_extra, $datum]);
if (!empty($link_item['parent']) && !empty($link_item['uid'])) {
$condition = ["`parent` = ? AND `gravity` = ?", $link_item['parent'], GRAVITY_COMMENT];
$condition = ["`parent` = ? AND `gravity` = ?", $link_item['parent'], Item::GRAVITY_COMMENT];
$total = Post::count($condition);
$pager = new Pager(DI::l10n(), DI::args()->getQueryString());
@ -1241,7 +1040,7 @@ function photos_content(App $a)
$params = ['order' => ['id'], 'limit' => [$pager->getStart(), $pager->getItemsPerPage()]];
$items = Post::toArray(Post::selectForUser($link_item['uid'], Item::ITEM_FIELDLIST, $condition, $params));
if (local_user() == $link_item['uid']) {
if (DI::userSession()->getLocalUserId() == $link_item['uid']) {
Item::update(['unseen' => false], ['parent' => $link_item['parent']]);
}
}
@ -1255,15 +1054,17 @@ function photos_content(App $a)
if (!empty($link_item['id'])) {
// parse tags and add links
$tag_arr = [];
foreach (Tag::getByURIId($link_item['uri-id']) as $tag) {
$tag_arr[] = [
'name' => $tag['name'],
'removeurl' => '/tagrm/' . $link_item['id'] . '/' . bin2hex($tag['name'])
];
foreach (explode(',', Tag::getCSVByURIId($link_item['uri-id'])) as $tag_name) {
if ($tag_name) {
$tag_arr[] = [
'name' => BBCode::toPlaintext($tag_name),
'removeurl' => 'post/' . $link_item['id'] . '/tag/remove/' . bin2hex($tag_name) . '?return=' . urlencode(DI::args()->getCommand()),
];
}
}
$tags = ['title' => DI::l10n()->t('Tags: '), 'tags' => $tag_arr];
if ($cmd === 'edit') {
$tags['removeanyurl'] = 'tagrm/' . $link_item['id'];
$tags['removeanyurl'] = 'post/' . $link_item['id'] . '/tag/remove?return=' . urlencode(DI::args()->getCommand());
$tags['removetitle'] = DI::l10n()->t('[Select tags to remove]');
}
}
@ -1319,7 +1120,7 @@ function photos_content(App $a)
*/
$qcomment = null;
if (Addon::isEnabled('qcomment')) {
$words = DI::pConfig()->get(local_user(), 'qcomment', 'words');
$words = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'qcomment', 'words');
$qcomment = $words ? explode("\n", $words) : [];
}
@ -1350,7 +1151,7 @@ function photos_content(App $a)
'attendmaybe' => []
];
if (DI::pConfig()->get(local_user(), 'system', 'hide_dislike')) {
if (DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'hide_dislike')) {
unset($conv_responses['dislike']);
}
@ -1375,7 +1176,7 @@ function photos_content(App $a)
*/
$qcomment = null;
if (Addon::isEnabled('qcomment')) {
$words = DI::pConfig()->get(local_user(), 'qcomment', 'words');
$words = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'qcomment', 'words');
$qcomment = $words ? explode("\n", $words) : [];
}
@ -1404,42 +1205,42 @@ function photos_content(App $a)
if (($activity->match($item['verb'], Activity::LIKE) ||
$activity->match($item['verb'], Activity::DISLIKE)) &&
($item['gravity'] != GRAVITY_PARENT)) {
($item['gravity'] != Item::GRAVITY_PARENT)) {
continue;
}
$author = ['uid' => 0, 'id' => $item['author-id'],
'network' => $item['author-network'], 'url' => $item['author-link']];
$profile_url = Contact::magicLinkByContact($author);
if (strpos($profile_url, 'redir/') === 0) {
if (strpos($profile_url, 'contact/redir/') === 0) {
$sparkle = ' sparkle';
} else {
$sparkle = '';
}
$dropping = (($item['contact-id'] == $contact_id) || ($item['uid'] == local_user()));
$dropping = (($item['contact-id'] == $contact_id) || ($item['uid'] == DI::userSession()->getLocalUserId()));
$drop = [
'dropping' => $dropping,
'pagedrop' => false,
'select' => DI::l10n()->t('Select'),
'delete' => DI::l10n()->t('Delete'),
'select' => DI::l10n()->t('Select'),
'delete' => DI::l10n()->t('Delete'),
];
$title_e = $item['title'];
$body_e = BBCode::convertForUriId($item['uri-id'], $item['body']);
$comments .= Renderer::replaceMacros($template,[
'$id' => $item['id'],
'$id' => $item['id'],
'$profile_url' => $profile_url,
'$name' => $item['author-name'],
'$thumb' => $item['author-avatar'],
'$sparkle' => $sparkle,
'$title' => $title_e,
'$body' => $body_e,
'$ago' => Temporal::getRelativeDate($item['created']),
'$indent' => (($item['parent'] != $item['id']) ? ' comment' : ''),
'$drop' => $drop,
'$comment' => $comment
'$name' => $item['author-name'],
'$thumb' => $item['author-avatar'],
'$sparkle' => $sparkle,
'$title' => $title_e,
'$body' => $body_e,
'$ago' => Temporal::getRelativeDate($item['created']),
'$indent' => (($item['parent'] != $item['id']) ? ' comment' : ''),
'$drop' => $drop,
'$comment' => $comment
]);
if (($can_post || Security::canWriteToUserWall($owner_uid))) {
@ -1449,7 +1250,7 @@ function photos_content(App $a)
*/
$qcomment = null;
if (Addon::isEnabled('qcomment')) {
$words = DI::pConfig()->get(local_user(), 'qcomment', 'words');
$words = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'qcomment', 'words');
$qcomment = $words ? explode("\n", $words) : [];
}
@ -1488,7 +1289,7 @@ function photos_content(App $a)
'$dislike' => DI::l10n()->t('Dislike'),
'$wait' => DI::l10n()->t('Please wait'),
'$dislike_title' => DI::l10n()->t('I don\'t like this (toggle)'),
'$hide_dislike' => DI::pConfig()->get(local_user(), 'system', 'hide_dislike'),
'$hide_dislike' => DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'hide_dislike'),
'$responses' => $responses,
'$return_path' => DI::args()->getQueryString(),
]);
@ -1525,68 +1326,4 @@ function photos_content(App $a)
return $o;
}
// Default - show recent photos with upload link (if applicable)
//$o = '';
$total = 0;
$r = DBA::toArray(DBA::p("SELECT `resource-id`, max(`scale`) AS `scale` FROM `photo` WHERE `uid` = ? AND `photo-type` = ?
$sql_extra GROUP BY `resource-id`",
$user['uid'],
Photo::DEFAULT,
));
if (DBA::isResult($r)) {
$total = count($r);
}
$pager = new Pager(DI::l10n(), DI::args()->getQueryString(), 20);
$r = DBA::toArray(DBA::p("SELECT `resource-id`, ANY_VALUE(`id`) AS `id`, ANY_VALUE(`filename`) AS `filename`,
ANY_VALUE(`type`) AS `type`, ANY_VALUE(`album`) AS `album`, max(`scale`) AS `scale`,
ANY_VALUE(`created`) AS `created` FROM `photo`
WHERE `uid` = ? AND `photo-type` = ?
$sql_extra GROUP BY `resource-id` ORDER BY `created` DESC LIMIT ? , ?",
$user['uid'],
Photo::DEFAULT,
$pager->getStart(),
$pager->getItemsPerPage()
));
$photos = [];
if (DBA::isResult($r)) {
// "Twist" is only used for the duepunto theme with style "slackr"
$twist = false;
foreach ($r as $rr) {
$twist = !$twist;
$ext = $phototypes[$rr['type']];
$alt_e = $rr['filename'];
$name_e = $rr['album'];
$photos[] = [
'id' => $rr['id'],
'twist' => ' ' . ($twist ? 'rotleft' : 'rotright') . rand(2,4),
'link' => 'photos/' . $user['nickname'] . '/image/' . $rr['resource-id'],
'title' => DI::l10n()->t('View Photo'),
'src' => 'photo/' . $rr['resource-id'] . '-' . ((($rr['scale']) == 6) ? 4 : $rr['scale']) . '.' . $ext,
'alt' => $alt_e,
'album' => [
'link' => 'photos/' . $user['nickname'] . '/album/' . bin2hex($rr['album']),
'name' => $name_e,
'alt' => DI::l10n()->t('View Album'),
],
];
}
}
$tpl = Renderer::getMarkupTemplate('photos_recent.tpl');
$o .= Renderer::replaceMacros($tpl, [
'$title' => DI::l10n()->t('Recent Photos'),
'$can_post' => $can_post,
'$upload' => [DI::l10n()->t('Upload New Photos'), 'photos/' . $user['nickname'] . '/upload'],
'$photos' => $photos,
'$paginate' => $pager->renderFull($total),
]);
return $o;
}

View File

@ -1,234 +0,0 @@
<?php
/**
* @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* @see https://web.archive.org/web/20160405005550/http://portablecontacts.net/draft-spec.html
*/
use Friendica\App;
use Friendica\Content\Text\BBCode;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Util\DateTimeFormat;
function poco_init(App $a) {
if (intval(DI::config()->get('system', 'block_public')) || (DI::config()->get('system', 'block_local_dir'))) {
throw new \Friendica\Network\HTTPException\ForbiddenException();
}
if (DI::args()->getArgc() > 1) {
// Only the system mode is supported
throw new \Friendica\Network\HTTPException\NotFoundException();
}
$format = ($_GET['format'] ?? '') ?: 'json';
$totalResults = DBA::count('profile', ['net-publish' => true]);
if ($totalResults == 0) {
throw new \Friendica\Network\HTTPException\ForbiddenException();
}
if (!empty($_GET['startIndex'])) {
$startIndex = intval($_GET['startIndex']);
} else {
$startIndex = 0;
}
$itemsPerPage = (!empty($_GET['count']) ? intval($_GET['count']) : $totalResults);
Logger::info("Start system mode query");
$contacts = DBA::selectToArray('owner-view', [], ['net-publish' => true], ['limit' => [$startIndex, $itemsPerPage]]);
Logger::info("Query done");
$ret = [];
if (!empty($_GET['sorted'])) {
$ret['sorted'] = false;
}
if (!empty($_GET['filtered'])) {
$ret['filtered'] = false;
}
if (!empty($_GET['updatedSince'])) {
$ret['updatedSince'] = false;
}
$ret['startIndex'] = (int) $startIndex;
$ret['itemsPerPage'] = (int) $itemsPerPage;
$ret['totalResults'] = (int) $totalResults;
$ret['entry'] = [];
$fields_ret = [
'id' => false,
'displayName' => false,
'urls' => false,
'updated' => false,
'preferredUsername' => false,
'photos' => false,
'aboutMe' => false,
'currentLocation' => false,
'network' => false,
'tags' => false,
'address' => false,
'contactType' => false,
'generation' => false
];
if (empty($_GET['fields'])) {
foreach ($fields_ret as $k => $v) {
$fields_ret[$k] = true;
}
} else {
$fields_req = explode(',', $_GET['fields']);
foreach ($fields_req as $f) {
$fields_ret[trim($f)] = true;
}
}
if (!is_array($contacts)) {
throw new \Friendica\Network\HTTPException\InternalServerErrorException();
}
if (DBA::isResult($contacts)) {
foreach ($contacts as $contact) {
if (!isset($contact['updated'])) {
$contact['updated'] = '';
}
if (! isset($contact['generation'])) {
$contact['generation'] = 1;
}
if (($contact['keywords'] == "") && isset($contact['pub_keywords'])) {
$contact['keywords'] = $contact['pub_keywords'];
}
if (isset($contact['account-type'])) {
$contact['contact-type'] = $contact['account-type'];
}
$cacheKey = 'about:' . $contact['nick'] . ':' . DateTimeFormat::utc($contact['updated'], DateTimeFormat::ATOM);
$about = DI::cache()->get($cacheKey);
if (is_null($about)) {
$about = BBCode::convertForUriId($contact['uri-id'], $contact['about']);
DI::cache()->set($cacheKey, $about);
}
// Non connected persons can only see the keywords of a Diaspora account
if ($contact['network'] == Protocol::DIASPORA) {
$contact['location'] = "";
$about = "";
}
$entry = [];
if ($fields_ret['id']) {
$entry['id'] = (int)$contact['id'];
}
if ($fields_ret['displayName']) {
$entry['displayName'] = $contact['name'];
}
if ($fields_ret['aboutMe']) {
$entry['aboutMe'] = $about;
}
if ($fields_ret['currentLocation']) {
$entry['currentLocation'] = $contact['location'];
}
if ($fields_ret['generation']) {
$entry['generation'] = (int)$contact['generation'];
}
if ($fields_ret['urls']) {
$entry['urls'] = [['value' => $contact['url'], 'type' => 'profile']];
if ($contact['addr'] && ($contact['network'] !== Protocol::MAIL)) {
$entry['urls'][] = ['value' => 'acct:' . $contact['addr'], 'type' => 'webfinger'];
}
}
if ($fields_ret['preferredUsername']) {
$entry['preferredUsername'] = $contact['nick'];
}
if ($fields_ret['updated']) {
$entry['updated'] = $contact['success_update'];
if ($contact['name-date'] > $entry['updated']) {
$entry['updated'] = $contact['name-date'];
}
if ($contact['uri-date'] > $entry['updated']) {
$entry['updated'] = $contact['uri-date'];
}
if ($contact['avatar-date'] > $entry['updated']) {
$entry['updated'] = $contact['avatar-date'];
}
$entry['updated'] = date("c", strtotime($entry['updated']));
}
if ($fields_ret['photos']) {
$entry['photos'] = [['value' => $contact['photo'], 'type' => 'profile']];
}
if ($fields_ret['network']) {
$entry['network'] = $contact['network'];
if ($entry['network'] == Protocol::STATUSNET) {
$entry['network'] = Protocol::OSTATUS;
}
if (($entry['network'] == "") && ($contact['self'])) {
$entry['network'] = Protocol::DFRN;
}
}
if ($fields_ret['tags']) {
$tags = str_replace(",", " ", $contact['keywords']);
$tags = explode(" ", $tags);
$cleaned = [];
foreach ($tags as $tag) {
$tag = trim(strtolower($tag));
if ($tag != "") {
$cleaned[] = $tag;
}
}
$entry['tags'] = [$cleaned];
}
if ($fields_ret['address']) {
$entry['address'] = [];
if (isset($contact['locality'])) {
$entry['address']['locality'] = $contact['locality'];
}
if (isset($contact['region'])) {
$entry['address']['region'] = $contact['region'];
}
if (isset($contact['country'])) {
$entry['address']['country'] = $contact['country'];
}
}
if ($fields_ret['contactType']) {
$entry['contactType'] = intval($contact['contact-type']);
}
$ret['entry'][] = $entry;
}
} else {
$ret['entry'][] = [];
}
Logger::info("End of poco");
if ($format === 'json') {
System::jsonExit($ret);
} else {
throw new \Friendica\Network\HTTPException\UnsupportedMediaTypeException();
}
}

View File

@ -1,158 +0,0 @@
<?php
/**
* @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
use Friendica\App;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Protocol\OStatus;
use Friendica\Util\Strings;
use Friendica\Util\Network;
use Friendica\Model\GServer;
use Friendica\Model\Post;
function hub_return($valid, $body)
{
if ($valid) {
echo $body;
} else {
throw new \Friendica\Network\HTTPException\NotFoundException();
}
System::exit();
}
// when receiving an XML feed, always return OK
function hub_post_return()
{
throw new \Friendica\Network\HTTPException\OKException();
}
function pubsub_init(App $a)
{
$nick = ((DI::args()->getArgc() > 1) ? trim(DI::args()->getArgv()[1]) : '');
$contact_id = ((DI::args()->getArgc() > 2) ? intval(DI::args()->getArgv()[2]) : 0 );
if (DI::args()->getMethod() === App\Router::GET) {
$hub_mode = trim($_GET['hub_mode'] ?? '');
$hub_topic = trim($_GET['hub_topic'] ?? '');
$hub_challenge = trim($_GET['hub_challenge'] ?? '');
$hub_verify = trim($_GET['hub_verify_token'] ?? '');
Logger::notice('Subscription from ' . $_SERVER['REMOTE_ADDR'] . ' Mode: ' . $hub_mode . ' Nick: ' . $nick);
Logger::debug('Data: ', ['get' => $_GET]);
$subscribe = (($hub_mode === 'subscribe') ? 1 : 0);
$owner = DBA::selectFirst('user', ['uid'], ['nickname' => $nick, 'account_expired' => false, 'account_removed' => false]);
if (!DBA::isResult($owner)) {
Logger::notice('Local account not found: ' . $nick);
hub_return(false, '');
}
$condition = ['uid' => $owner['uid'], 'id' => $contact_id, 'blocked' => false, 'pending' => false];
if (!empty($hub_verify)) {
$condition['hub-verify'] = $hub_verify;
}
$contact = DBA::selectFirst('contact', ['id', 'poll'], $condition);
if (!DBA::isResult($contact)) {
Logger::notice('Contact ' . $contact_id . ' not found.');
hub_return(false, '');
}
if (!empty($hub_topic) && !Strings::compareLink($hub_topic, $contact['poll'])) {
Logger::notice('Hub topic ' . $hub_topic . ' != ' . $contact['poll']);
hub_return(false, '');
}
// We must initiate an unsubscribe request with a verify_token.
// Don't allow outsiders to unsubscribe us.
if (($hub_mode === 'unsubscribe') && empty($hub_verify)) {
Logger::notice('Bogus unsubscribe');
hub_return(false, '');
}
if (!empty($hub_mode)) {
Contact::update(['subhub' => $subscribe], ['id' => $contact['id']]);
Logger::notice($hub_mode . ' success for contact ' . $contact_id . '.');
}
hub_return(true, $hub_challenge);
}
}
function pubsub_post(App $a)
{
$xml = Network::postdata();
Logger::info('Feed arrived from ' . $_SERVER['REMOTE_ADDR'] . ' for ' . DI::args()->getCommand() . ' with user-agent: ' . $_SERVER['HTTP_USER_AGENT']);
Logger::debug('Data: ' . $xml);
$nick = ((DI::args()->getArgc() > 1) ? trim(DI::args()->getArgv()[1]) : '');
$contact_id = ((DI::args()->getArgc() > 2) ? intval(DI::args()->getArgv()[2]) : 0 );
$importer = DBA::selectFirst('user', [], ['nickname' => $nick, 'account_expired' => false, 'account_removed' => false]);
if (!DBA::isResult($importer)) {
hub_post_return();
}
$condition = ['id' => $contact_id, 'uid' => $importer['uid'], 'subhub' => true, 'blocked' => false];
$contact = DBA::selectFirst('contact', [], $condition);
if (!DBA::isResult($contact)) {
$author = OStatus::salmonAuthor($xml, $importer);
if (!empty($author['contact-id'])) {
$condition = ['id' => $author['contact-id'], 'uid' => $importer['uid'], 'subhub' => true, 'blocked' => false];
$contact = DBA::selectFirst('contact', [], $condition);
Logger::notice('No record for ' . $nick .' with contact id ' . $contact_id . ' - using '.$author['contact-id'].' instead.');
}
if (!DBA::isResult($contact)) {
Logger::notice('Contact ' . $author["author-link"] . ' (' . $contact_id . ') for user ' . $nick . " wasn't found - ignored. XML: " . $xml);
hub_post_return();
}
}
if (!empty($contact['gsid'])) {
GServer::setProtocol($contact['gsid'], Post\DeliveryData::OSTATUS);
}
if (!in_array($contact['rel'], [Contact::SHARING, Contact::FRIEND]) && ($contact['network'] != Protocol::FEED)) {
Logger::notice('Contact ' . $contact['id'] . ' is not expected to share with us - ignored.');
hub_post_return();
}
// We only import feeds from OStatus here
if (!in_array($contact['network'], [Protocol::ACTIVITYPUB, Protocol::OSTATUS])) {
Logger::warning('Unexpected network', ['contact' => $contact]);
hub_post_return();
}
Logger::info('Import item for ' . $nick . ' from ' . $contact['nick'] . ' (' . $contact['id'] . ')');
$feedhub = '';
OStatus::import($xml, $importer, $contact, $feedhub);
hub_post_return();
}

View File

@ -1,147 +0,0 @@
<?php
/**
* @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
use Friendica\App;
use Friendica\Core\Logger;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\PushSubscriber;
use Friendica\Util\Strings;
function pubsubhubbub_init(App $a) {
// PuSH subscription must be considered "public" so just block it
// if public access isn't enabled.
if (DI::config()->get('system', 'block_public')) {
throw new \Friendica\Network\HTTPException\ForbiddenException();
}
// Subscription request from subscriber
// https://pubsubhubbub.googlecode.com/git/pubsubhubbub-core-0.4.html#anchor4
// Example from GNU Social:
// [hub_mode] => subscribe
// [hub_callback] => http://status.local/main/push/callback/1
// [hub_verify] => sync
// [hub_verify_token] => af11...
// [hub_secret] => af11...
// [hub_topic] => http://friendica.local/dfrn_poll/sazius
if (DI::args()->getMethod() === App\Router::POST) {
$hub_mode = $_POST['hub_mode'] ?? '';
$hub_callback = $_POST['hub_callback'] ?? '';
$hub_verify_token = $_POST['hub_verify_token'] ?? '';
$hub_secret = $_POST['hub_secret'] ?? '';
$hub_topic = $_POST['hub_topic'] ?? '';
// check for valid hub_mode
if ($hub_mode === 'subscribe') {
$subscribe = 1;
} elseif ($hub_mode === 'unsubscribe') {
$subscribe = 0;
} else {
Logger::notice("Invalid hub_mode=$hub_mode, ignoring.");
throw new \Friendica\Network\HTTPException\NotFoundException();
}
Logger::info("$hub_mode request from " . $_SERVER['REMOTE_ADDR']);
if (DI::args()->getArgc() > 1) {
// Normally the url should now contain the nick name as last part of the url
$nick = DI::args()->getArgv()[1];
} else {
// Get the nick name from the topic as a fallback
$nick = $hub_topic;
}
// Extract nick name and strip any .atom extension
$nick = basename($nick, '.atom');
if (!$nick) {
Logger::notice('Bad hub_topic=$hub_topic, ignoring.');
throw new \Friendica\Network\HTTPException\NotFoundException();
}
// fetch user from database given the nickname
$condition = ['nickname' => $nick, 'account_expired' => false, 'account_removed' => false];
$owner = DBA::selectFirst('user', ['uid', 'nickname'], $condition);
if (!DBA::isResult($owner)) {
Logger::notice('Local account not found: ' . $nick . ' - topic: ' . $hub_topic . ' - callback: ' . $hub_callback);
throw new \Friendica\Network\HTTPException\NotFoundException();
}
// get corresponding row from contact table
$condition = ['uid' => $owner['uid'], 'blocked' => false,
'pending' => false, 'self' => true];
$contact = DBA::selectFirst('contact', ['poll'], $condition);
if (!DBA::isResult($contact)) {
Logger::notice('Self contact for user ' . $owner['uid'] . ' not found.');
throw new \Friendica\Network\HTTPException\NotFoundException();
}
// sanity check that topic URLs are the same
$hub_topic2 = str_replace('/feed/', '/dfrn_poll/', $hub_topic);
$self = DI::baseUrl() . '/api/statuses/user_timeline/' . $owner['nickname'] . '.atom';
if (!Strings::compareLink($hub_topic, $contact['poll']) && !Strings::compareLink($hub_topic2, $contact['poll']) && !Strings::compareLink($hub_topic, $self)) {
Logger::notice('Hub topic ' . $hub_topic . ' != ' . $contact['poll']);
throw new \Friendica\Network\HTTPException\NotFoundException();
}
// do subscriber verification according to the PuSH protocol
$hub_challenge = Strings::getRandomHex(40);
$params = http_build_query([
'hub.mode' => $subscribe == 1 ? 'subscribe' : 'unsubscribe',
'hub.topic' => $hub_topic,
'hub.challenge' => $hub_challenge,
'hub.verify_token' => $hub_verify_token,
// lease time is hard coded to one week (in seconds)
// we don't actually enforce the lease time because GNU
// Social/StatusNet doesn't honour it (yet)
'hub.lease_seconds' => 604800,
]);
$hub_callback = rtrim($hub_callback, ' ?&#');
$separator = parse_url($hub_callback, PHP_URL_QUERY) === null ? '?' : '&';
$fetchResult = DI::httpClient()->fetchFull($hub_callback . $separator . $params);
$body = $fetchResult->getBody();
$ret = $fetchResult->getReturnCode();
// give up if the HTTP return code wasn't a success (2xx)
if ($ret < 200 || $ret > 299) {
Logger::notice("Subscriber verification for $hub_topic at $hub_callback returned $ret, ignoring.");
throw new \Friendica\Network\HTTPException\NotFoundException();
}
// check that the correct hub_challenge code was echoed back
if (trim($body) !== $hub_challenge) {
Logger::notice("Subscriber did not echo back hub.challenge, ignoring.");
Logger::notice("\"$hub_challenge\" != \"".trim($body)."\"");
throw new \Friendica\Network\HTTPException\NotFoundException();
}
PushSubscriber::renew($owner['uid'], $nick, $subscribe, $hub_callback, $hub_topic, $hub_secret);
throw new \Friendica\Network\HTTPException\AcceptedException();
}
System::exit();
}

View File

@ -1,178 +0,0 @@
<?php
/**
* @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
use Friendica\App;
use Friendica\Core\Logger;
use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Profile;
use Friendica\Network\HTTPClient\Client\HttpClientAccept;
use Friendica\Network\HTTPClient\Client\HttpClientOptions;
use Friendica\Util\Strings;
function redir_init(App $a) {
if (!Session::isAuthenticated()) {
throw new \Friendica\Network\HTTPException\ForbiddenException(DI::l10n()->t('Access denied.'));
}
$url = $_GET['url'] ?? '';
if (DI::args()->getArgc() > 1 && intval(DI::args()->getArgv()[1])) {
$cid = intval(DI::args()->getArgv()[1]);
} else {
$cid = 0;
}
// Try magic auth before the legacy stuff
redir_magic($a, $cid, $url);
if (empty($cid)) {
throw new \Friendica\Network\HTTPException\BadRequestException(DI::l10n()->t('Bad Request.'));
}
$fields = ['id', 'uid', 'nurl', 'url', 'addr', 'name'];
$contact = DBA::selectFirst('contact', $fields, ['id' => $cid, 'uid' => [0, local_user()]]);
if (!DBA::isResult($contact)) {
throw new \Friendica\Network\HTTPException\NotFoundException(DI::l10n()->t('Contact not found.'));
}
$contact_url = $contact['url'];
if (!empty($a->getContactId()) && $a->getContactId() == $cid) {
// Local user is already authenticated.
redir_check_url($contact_url, $url);
$a->redirect($url ?: $contact_url);
}
if ($contact['uid'] == 0 && local_user()) {
// Let's have a look if there is an established connection
// between the public contact we have found and the local user.
$contact = DBA::selectFirst('contact', $fields, ['nurl' => $contact['nurl'], 'uid' => local_user()]);
if (DBA::isResult($contact)) {
$cid = $contact['id'];
}
if (!empty($a->getContactId()) && $a->getContactId() == $cid) {
// Local user is already authenticated.
redir_check_url($contact_url, $url);
$target_url = $url ?: $contact_url;
Logger::info($contact['name'] . " is already authenticated. Redirecting to " . $target_url);
$a->redirect($target_url);
}
}
if (remote_user()) {
$host = substr(DI::baseUrl()->getUrlPath() . (DI::baseUrl()->getUrlPath() ? '/' . DI::baseUrl()->getUrlPath() : ''), strpos(DI::baseUrl()->getUrlPath(), '://') + 3);
$remotehost = substr($contact['addr'], strpos($contact['addr'], '@') + 1);
// On a local instance we have to check if the local user has already authenticated
// with the local contact. Otherwise the local user would ask the local contact
// for authentification everytime he/she is visiting a profile page of the local
// contact.
if (($host == $remotehost) && (Session::getRemoteContactID(Session::get('visitor_visiting')) == Session::get('visitor_id'))) {
// Remote user is already authenticated.
redir_check_url($contact_url, $url);
$target_url = $url ?: $contact_url;
Logger::info($contact['name'] . " is already authenticated. Redirecting to " . $target_url);
$a->redirect($target_url);
}
}
if (empty($url)) {
throw new \Friendica\Network\HTTPException\BadRequestException(DI::l10n()->t('Bad Request.'));
}
// If we don't have a connected contact, redirect with
// the 'zrl' parameter.
$my_profile = Profile::getMyURL();
if (!empty($my_profile) && !Strings::compareLink($my_profile, $url)) {
$separator = strpos($url, '?') ? '&' : '?';
$url .= $separator . 'zrl=' . urlencode($my_profile);
}
Logger::info('redirecting to ' . $url);
$a->redirect($url);
}
function redir_magic($a, $cid, $url)
{
$visitor = Profile::getMyURL();
if (!empty($visitor)) {
Logger::info('Got my url', ['visitor' => $visitor]);
}
$contact = DBA::selectFirst('contact', ['url'], ['id' => $cid]);
if (!DBA::isResult($contact)) {
Logger::info('Contact not found', ['id' => $cid]);
throw new \Friendica\Network\HTTPException\NotFoundException(DI::l10n()->t('Contact not found.'));
} else {
$contact_url = $contact['url'];
redir_check_url($contact_url, $url);
$target_url = $url ?: $contact_url;
}
$basepath = Contact::getBasepath($contact_url);
// We don't use magic auth when there is no visitor, we are on the same system or we visit our own stuff
if (empty($visitor) || Strings::compareLink($basepath, DI::baseUrl()) || Strings::compareLink($contact_url, $visitor)) {
Logger::info('Redirecting without magic', ['target' => $target_url, 'visitor' => $visitor, 'contact' => $contact_url]);
DI::app()->redirect($target_url);
}
// Test for magic auth on the target system
$serverret = DI::httpClient()->head($basepath . '/magic', [HttpClientOptions::ACCEPT_CONTENT => HttpClientAccept::HTML]);
if ($serverret->isSuccess()) {
$separator = strpos($target_url, '?') ? '&' : '?';
$target_url .= $separator . 'zrl=' . urlencode($visitor) . '&addr=' . urlencode($contact_url);
Logger::info('Redirecting with magic', ['target' => $target_url, 'visitor' => $visitor, 'contact' => $contact_url]);
System::externalRedirect($target_url);
} else {
Logger::info('No magic for contact', ['contact' => $contact_url]);
}
}
function redir_check_url(string $contact_url, string $url)
{
if (empty($contact_url) || empty($url)) {
return;
}
$url_host = parse_url($url, PHP_URL_HOST);
if (empty($url_host)) {
$url_host = parse_url(DI::baseUrl(), PHP_URL_HOST);
}
$contact_url_host = parse_url($contact_url, PHP_URL_HOST);
if ($url_host == $contact_url_host) {
return;
}
Logger::error('URL check host mismatch', ['contact' => $contact_url, 'url' => $url]);
throw new \Friendica\Network\HTTPException\ForbiddenException(DI::l10n()->t('Access denied.'));
}

View File

@ -1,108 +0,0 @@
<?php
/**
* @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
use Friendica\App;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\User;
use Friendica\Util\Strings;
function removeme_post(App $a)
{
if (!local_user()) {
return;
}
if (!empty($_SESSION['submanage'])) {
return;
}
if (empty($_POST['qxz_password'])) {
return;
}
if (empty($_POST['verify'])) {
return;
}
if ($_POST['verify'] !== $_SESSION['remove_account_verify']) {
return;
}
// send notification to admins so that they can clean um the backups
// send email to admins
$admin_mails = explode(",", str_replace(" ", "", DI::config()->get('config', 'admin_email')));
foreach ($admin_mails as $mail) {
$admin = DBA::selectFirst('user', ['uid', 'language', 'email', 'username'], ['email' => $mail]);
if (!DBA::isResult($admin)) {
continue;
}
$l10n = DI::l10n()->withLang($admin['language']);
$email = DI::emailer()
->newSystemMail()
->withMessage(
$l10n->t('[Friendica System Notify]') . ' ' . $l10n->t('User deleted their account'),
$l10n->t('On your Friendica node an user deleted their account. Please ensure that their data is removed from the backups.'),
$l10n->t('The user id is %d', local_user()))
->forUser($admin)
->withRecipient($admin['email'])
->build();
DI::emailer()->send($email);
}
if (User::getIdFromPasswordAuthentication($a->getLoggedInUserId(), trim($_POST['qxz_password']))) {
User::remove($a->getLoggedInUserId());
unset($_SESSION['authenticated']);
unset($_SESSION['uid']);
DI::baseUrl()->redirect();
// NOTREACHED
}
}
function removeme_content(App $a)
{
if (!local_user()) {
DI::baseUrl()->redirect();
}
$hash = Strings::getRandomHex();
require_once("mod/settings.php");
settings_init($a);
$_SESSION['remove_account_verify'] = $hash;
$tpl = Renderer::getMarkupTemplate('removeme.tpl');
$o = Renderer::replaceMacros($tpl, [
'$basedir' => DI::baseUrl()->get(),
'$hash' => $hash,
'$title' => DI::l10n()->t('Remove My Account'),
'$desc' => DI::l10n()->t('This will completely remove your account. Once this has been done it is not recoverable.'),
'$passwd' => DI::l10n()->t('Please enter your password for verification:'),
'$submit' => DI::l10n()->t('Remove My Account')
]);
return $o;
}

View File

@ -1,64 +0,0 @@
<?php
/**
* @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
use Friendica\App;
use Friendica\Core\Protocol;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
function repair_ostatus_content(App $a) {
if (!local_user()) {
notice(DI::l10n()->t('Permission denied.'));
DI::baseUrl()->redirect('ostatus_repair');
// NOTREACHED
}
$o = '<h2>' . DI::l10n()->t('Resubscribing to OStatus contacts') . '</h2>';
$uid = local_user();
$counter = intval($_REQUEST['counter'] ?? 0);
$condition = ['uid' => $uid, 'network' => Protocol::OSTATUS, 'rel' => [Contact::FRIEND, Contact::SHARING]];
$total = DBA::count('contact', $condition);
if (!$total) {
return ($o . DI::l10n()->t('Error'));
}
$contact = Contact::selectToArray(['url'], $condition, ['order' => ['url'], 'limit' => [$counter++, 1]]);
if (!DBA::isResult($contact)) {
$o .= DI::l10n()->t('Done');
return $o;
}
$o .= '<p>' . $counter . '/' . $total . ': ' . $contact[0]['url'] . '</p>';
$o .= '<p>' . DI::l10n()->t('Keep this window open until done.') . '</p>';
Contact::createFromProbeForUser($a->getLoggedInUserId(), $contact[0]['url']);
DI::page()['htmlhead'] = '<meta http-equiv="refresh" content="1; URL=' . DI::baseUrl() . '/repair_ostatus?counter=' . $counter . '">';
return $o;
}

View File

@ -1,183 +0,0 @@
<?php
/**
* @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
use Friendica\App;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\GServer;
use Friendica\Model\Post;
use Friendica\Protocol\ActivityNamespace;
use Friendica\Protocol\OStatus;
use Friendica\Protocol\Salmon;
use Friendica\Util\Crypto;
use Friendica\Util\Network;
use Friendica\Util\Strings;
function salmon_post(App $a, $xml = '') {
if (empty($xml)) {
$xml = Network::postdata();
}
Logger::debug('new salmon ' . $xml);
$nick = trim(DI::args()->getArgv()[1] ?? '');
$importer = DBA::selectFirst('user', [], ['nickname' => $nick, 'account_expired' => false, 'account_removed' => false]);
if (! DBA::isResult($importer)) {
throw new \Friendica\Network\HTTPException\InternalServerErrorException();
}
// parse the xml
$dom = simplexml_load_string($xml,'SimpleXMLElement',0, ActivityNamespace::SALMON_ME);
$base = null;
// figure out where in the DOM tree our data is hiding
if (!empty($dom->provenance->data))
$base = $dom->provenance;
elseif (!empty($dom->env->data))
$base = $dom->env;
elseif (!empty($dom->data))
$base = $dom;
if (empty($base)) {
Logger::notice('unable to locate salmon data in xml');
throw new \Friendica\Network\HTTPException\BadRequestException();
}
// Stash the signature away for now. We have to find their key or it won't be good for anything.
$signature = Strings::base64UrlDecode($base->sig);
// unpack the data
// strip whitespace so our data element will return to one big base64 blob
$data = str_replace([" ","\t","\r","\n"],["","","",""],$base->data);
// stash away some other stuff for later
$type = $base->data[0]->attributes()->type[0];
$keyhash = $base->sig[0]->attributes()->keyhash[0] ?? '';
$encoding = $base->encoding;
$alg = $base->alg;
// Salmon magic signatures have evolved and there is no way of knowing ahead of time which
// flavour we have. We'll try and verify it regardless.
$stnet_signed_data = $data;
$signed_data = $data . '.' . Strings::base64UrlEncode($type) . '.' . Strings::base64UrlEncode($encoding) . '.' . Strings::base64UrlEncode($alg);
$compliant_format = str_replace('=', '', $signed_data);
// decode the data
$data = Strings::base64UrlDecode($data);
$author = OStatus::salmonAuthor($data, $importer);
$author_link = $author["author-link"];
if(! $author_link) {
Logger::notice('Could not retrieve author URI.');
throw new \Friendica\Network\HTTPException\BadRequestException();
}
// Once we have the author URI, go to the web and try to find their public key
Logger::notice('Fetching key for ' . $author_link);
$key = Salmon::getKey($author_link, $keyhash);
if(! $key) {
Logger::notice('Could not retrieve author key.');
throw new \Friendica\Network\HTTPException\BadRequestException();
}
$key_info = explode('.',$key);
$m = Strings::base64UrlDecode($key_info[1]);
$e = Strings::base64UrlDecode($key_info[2]);
Logger::info('key details', ['info' => $key_info]);
$pubkey = Crypto::meToPem($m, $e);
// We should have everything we need now. Let's see if it verifies.
// Try GNU Social format
$verify = Crypto::rsaVerify($signed_data, $signature, $pubkey);
$mode = 1;
if (! $verify) {
Logger::notice('message did not verify using protocol. Trying compliant format.');
$verify = Crypto::rsaVerify($compliant_format, $signature, $pubkey);
$mode = 2;
}
if (! $verify) {
Logger::notice('message did not verify using padding. Trying old statusnet format.');
$verify = Crypto::rsaVerify($stnet_signed_data, $signature, $pubkey);
$mode = 3;
}
if (! $verify) {
Logger::notice('Message did not verify. Discarding.');
throw new \Friendica\Network\HTTPException\BadRequestException();
}
Logger::notice('Message verified with mode '.$mode);
/*
*
* If we reached this point, the message is good. Now let's figure out if the author is allowed to send us stuff.
*
*/
$contact = DBA::selectFirst('contact', [], ["`network` IN (?, ?) AND (`nurl` = ? OR `alias` = ? OR `alias` = ?) AND `uid` = ?",
Protocol::OSTATUS, Protocol::DFRN, Strings::normaliseLink($author_link), $author_link, Strings::normaliseLink($author_link), $importer['uid']]);
if (!empty($contact['gsid'])) {
GServer::setProtocol($contact['gsid'], Post\DeliveryData::OSTATUS);
}
// Have we ignored the person?
// If so we can not accept this post.
if (!empty($contact['blocked'])) {
Logger::notice('Ignoring this author.');
throw new \Friendica\Network\HTTPException\AcceptedException();
}
// Placeholder for hub discovery.
$hub = '';
$contact = $contact ?: [];
OStatus::import($data, $importer, $contact, $hub);
throw new \Friendica\Network\HTTPException\OKException();
}

View File

@ -1,358 +0,0 @@
<?php
/**
* @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
use Friendica\App;
use Friendica\BaseModule;
use Friendica\Content\Feature;
use Friendica\Content\Nav;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Item;
use Friendica\Model\User;
use Friendica\Module\BaseSettings;
use Friendica\Module\Security\Login;
use Friendica\Protocol\Email;
function settings_init(App $a)
{
if (!local_user()) {
notice(DI::l10n()->t('Permission denied.'));
return;
}
BaseSettings::createAside();
}
function settings_post(App $a)
{
if (!$a->isLoggedIn()) {
notice(DI::l10n()->t('Permission denied.'));
return;
}
if (!empty($_SESSION['submanage'])) {
return;
}
if ((DI::args()->getArgc() > 1) && (DI::args()->getArgv()[1] == 'addon')) {
BaseModule::checkFormSecurityTokenRedirectOnError(DI::args()->getQueryString(), 'settings_addon');
Hook::callAll('addon_settings_post', $_POST);
DI::baseUrl()->redirect(DI::args()->getQueryString());
return;
}
$user = User::getById($a->getLoggedInUserId());
if ((DI::args()->getArgc() > 1) && (DI::args()->getArgv()[1] == 'connectors')) {
BaseModule::checkFormSecurityTokenRedirectOnError(DI::args()->getQueryString(), 'settings_connectors');
if (!empty($_POST['general-submit'])) {
DI::pConfig()->set(local_user(), 'system', 'accept_only_sharer', intval($_POST['accept_only_sharer']));
DI::pConfig()->set(local_user(), 'system', 'disable_cw', !intval($_POST['enable_cw']));
DI::pConfig()->set(local_user(), 'system', 'no_intelligent_shortening', !intval($_POST['enable_smart_shortening']));
DI::pConfig()->set(local_user(), 'system', 'simple_shortening', intval($_POST['simple_shortening']));
DI::pConfig()->set(local_user(), 'system', 'attach_link_title', intval($_POST['attach_link_title']));
DI::pConfig()->set(local_user(), 'ostatus', 'legacy_contact', $_POST['legacy_contact']);
} elseif (!empty($_POST['mail-submit'])) {
$mail_server = $_POST['mail_server'] ?? '';
$mail_port = $_POST['mail_port'] ?? '';
$mail_ssl = strtolower(trim($_POST['mail_ssl'] ?? ''));
$mail_user = $_POST['mail_user'] ?? '';
$mail_pass = trim($_POST['mail_pass'] ?? '');
$mail_action = trim($_POST['mail_action'] ?? '');
$mail_movetofolder = trim($_POST['mail_movetofolder'] ?? '');
$mail_replyto = $_POST['mail_replyto'] ?? '';
$mail_pubmail = $_POST['mail_pubmail'] ?? '';
if (function_exists('imap_open') && !DI::config()->get('system', 'imap_disabled')) {
if (!DBA::exists('mailacct', ['uid' => local_user()])) {
DBA::insert('mailacct', ['uid' => local_user()]);
}
if (strlen($mail_pass)) {
$pass = '';
openssl_public_encrypt($mail_pass, $pass, $user['pubkey']);
DBA::update('mailacct', ['pass' => bin2hex($pass)], ['uid' => local_user()]);
}
$r = DBA::update('mailacct', [
'server' => $mail_server,
'port' => $mail_port,
'ssltype' => $mail_ssl,
'user' => $mail_user,
'action' => $mail_action,
'movetofolder' => $mail_movetofolder,
'mailbox' => 'INBOX',
'reply_to' => $mail_replyto,
'pubmail' => $mail_pubmail
], ['uid' => local_user()]);
Logger::debug('updating mailaccount', ['response' => $r]);
$mailacct = DBA::selectFirst('mailacct', [], ['uid' => local_user()]);
if (DBA::isResult($mailacct)) {
$mb = Email::constructMailboxName($mailacct);
if (strlen($mailacct['server'])) {
$dcrpass = '';
openssl_private_decrypt(hex2bin($mailacct['pass']), $dcrpass, $user['prvkey']);
$mbox = Email::connect($mb, $mail_user, $dcrpass);
unset($dcrpass);
if (!$mbox) {
notice(DI::l10n()->t('Failed to connect with email account using the settings provided.'));
}
}
}
}
}
Hook::callAll('connector_settings_post', $_POST);
DI::baseUrl()->redirect(DI::args()->getQueryString());
return;
}
if ((DI::args()->getArgc() > 1) && (DI::args()->getArgv()[1] === 'features')) {
BaseModule::checkFormSecurityTokenRedirectOnError('/settings/features', 'settings_features');
foreach ($_POST as $k => $v) {
if (strpos($k, 'feature_') === 0) {
DI::pConfig()->set(local_user(), 'feature', substr($k, 8), ((intval($v)) ? 1 : 0));
}
}
return;
}
}
function settings_content(App $a)
{
$o = '';
Nav::setSelected('settings');
if (!local_user()) {
//notice(DI::l10n()->t('Permission denied.'));
return Login::form();
}
if (!empty($_SESSION['submanage'])) {
notice(DI::l10n()->t('Permission denied.'));
return '';
}
if ((DI::args()->getArgc() > 1) && (DI::args()->getArgv()[1] === 'oauth')) {
if ((DI::args()->getArgc() > 3) && (DI::args()->getArgv()[2] === 'delete')) {
BaseModule::checkFormSecurityTokenRedirectOnError('/settings/oauth', 'settings_oauth', 't');
DBA::delete('application-token', ['application-id' => DI::args()->getArgv()[3], 'uid' => local_user()]);
DI::baseUrl()->redirect('settings/oauth/', true);
return '';
}
$applications = DBA::selectToArray('application-view', ['id', 'uid', 'name', 'website', 'scopes', 'created_at'], ['uid' => local_user()]);
$tpl = Renderer::getMarkupTemplate('settings/oauth.tpl');
$o .= Renderer::replaceMacros($tpl, [
'$form_security_token' => BaseModule::getFormSecurityToken("settings_oauth"),
'$baseurl' => DI::baseUrl()->get(true),
'$title' => DI::l10n()->t('Connected Apps'),
'$name' => DI::l10n()->t('Name'),
'$website' => DI::l10n()->t('Home Page'),
'$created_at' => DI::l10n()->t('Created'),
'$delete' => DI::l10n()->t('Remove authorization'),
'$apps' => $applications,
]);
return $o;
}
if ((DI::args()->getArgc() > 1) && (DI::args()->getArgv()[1] === 'addon')) {
$addon_settings_forms = [];
foreach (DI::dba()->selectToArray('hook', ['file', 'function'], ['hook' => 'addon_settings']) as $hook) {
$data = [];
Hook::callSingle(DI::app(), 'addon_settings', [$hook['file'], $hook['function']], $data);
if (!empty($data['href'])) {
$tpl = Renderer::getMarkupTemplate('settings/addon/link.tpl');
$addon_settings_forms[] = Renderer::replaceMacros($tpl, [
'$addon' => $data['addon'],
'$title' => $data['title'],
'$href' => $data['href'],
]);
} elseif(!empty($data['addon'])) {
$tpl = Renderer::getMarkupTemplate('settings/addon/panel.tpl');
$addon_settings_forms[$data['addon']] = Renderer::replaceMacros($tpl, [
'$addon' => $data['addon'],
'$title' => $data['title'],
'$open' => (DI::args()->getArgv()[2] ?? '') === $data['addon'],
'$html' => $data['html'] ?? '',
'$submit' => $data['submit'] ?? DI::l10n()->t('Save Settings'),
]);
}
}
$tpl = Renderer::getMarkupTemplate('settings/addons.tpl');
$o .= Renderer::replaceMacros($tpl, [
'$form_security_token' => BaseModule::getFormSecurityToken("settings_addon"),
'$title' => DI::l10n()->t('Addon Settings'),
'$no_addons_settings_configured' => DI::l10n()->t('No Addon settings configured'),
'$addon_settings_forms' => $addon_settings_forms,
]);
return $o;
}
if ((DI::args()->getArgc() > 1) && (DI::args()->getArgv()[1] === 'features')) {
$arr = [];
$features = Feature::get();
foreach ($features as $fname => $fdata) {
$arr[$fname] = [];
$arr[$fname][0] = $fdata[0];
foreach (array_slice($fdata,1) as $f) {
$arr[$fname][1][] = ['feature_' . $f[0], $f[1], Feature::isEnabled(local_user(), $f[0]), $f[2]];
}
}
$tpl = Renderer::getMarkupTemplate('settings/features.tpl');
$o .= Renderer::replaceMacros($tpl, [
'$form_security_token' => BaseModule::getFormSecurityToken("settings_features"),
'$title' => DI::l10n()->t('Additional Features'),
'$features' => $arr,
'$submit' => DI::l10n()->t('Save Settings'),
]);
return $o;
}
if ((DI::args()->getArgc() > 1) && (DI::args()->getArgv()[1] === 'connectors')) {
$accept_only_sharer = intval(DI::pConfig()->get(local_user(), 'system', 'accept_only_sharer'));
$enable_cw = !intval(DI::pConfig()->get(local_user(), 'system', 'disable_cw'));
$enable_smart_shortening = !intval(DI::pConfig()->get(local_user(), 'system', 'no_intelligent_shortening'));
$simple_shortening = intval(DI::pConfig()->get(local_user(), 'system', 'simple_shortening'));
$attach_link_title = intval(DI::pConfig()->get(local_user(), 'system', 'attach_link_title'));
$legacy_contact = DI::pConfig()->get(local_user(), 'ostatus', 'legacy_contact');
if (!empty($legacy_contact)) {
/// @todo Isn't it supposed to be a $a->internalRedirect() call?
DI::page()['htmlhead'] = '<meta http-equiv="refresh" content="0; URL=' . DI::baseUrl().'/ostatus_subscribe?url=' . urlencode($legacy_contact) . '">';
}
$connector_settings_forms = [];
foreach (DI::dba()->selectToArray('hook', ['file', 'function'], ['hook' => 'connector_settings']) as $hook) {
$data = [];
Hook::callSingle(DI::app(), 'connector_settings', [$hook['file'], $hook['function']], $data);
$tpl = Renderer::getMarkupTemplate('settings/addon/connector.tpl');
$connector_settings_forms[$data['connector']] = Renderer::replaceMacros($tpl, [
'$connector' => $data['connector'],
'$title' => $data['title'],
'$image' => $data['image'] ?? '',
'$enabled' => $data['enabled'] ?? true,
'$open' => (DI::args()->getArgv()[2] ?? '') === $data['connector'],
'$html' => $data['html'] ?? '',
'$submit' => $data['submit'] ?? DI::l10n()->t('Save Settings'),
]);
}
if ($a->isSiteAdmin()) {
$diasp_enabled = DI::l10n()->t('Built-in support for %s connectivity is %s', DI::l10n()->t('Diaspora (Socialhome, Hubzilla)'), ((DI::config()->get('system', 'diaspora_enabled')) ? DI::l10n()->t('enabled') : DI::l10n()->t('disabled')));
$ostat_enabled = DI::l10n()->t('Built-in support for %s connectivity is %s', DI::l10n()->t('OStatus (GNU Social)'), ((DI::config()->get('system', 'ostatus_disabled')) ? DI::l10n()->t('disabled') : DI::l10n()->t('enabled')));
} else {
$diasp_enabled = "";
$ostat_enabled = "";
}
$mail_disabled = ((function_exists('imap_open') && (!DI::config()->get('system', 'imap_disabled'))) ? 0 : 1);
if (!$mail_disabled) {
$mailacct = DBA::selectFirst('mailacct', [], ['uid' => local_user()]);
} else {
$mailacct = null;
}
$mail_server = $mailacct['server'] ?? '';
$mail_port = (!empty($mailacct['port']) && is_numeric($mailacct['port'])) ? (int)$mailacct['port'] : '';
$mail_ssl = $mailacct['ssltype'] ?? '';
$mail_user = $mailacct['user'] ?? '';
$mail_replyto = $mailacct['reply_to'] ?? '';
$mail_pubmail = $mailacct['pubmail'] ?? 0;
$mail_action = $mailacct['action'] ?? 0;
$mail_movetofolder = $mailacct['movetofolder'] ?? '';
$mail_chk = $mailacct['last_check'] ?? DBA::NULL_DATETIME;
$tpl = Renderer::getMarkupTemplate('settings/connectors.tpl');
$mail_disabled_message = ($mail_disabled ? DI::l10n()->t('Email access is disabled on this site.') : '');
$ssl_options = ['TLS' => 'TLS', 'SSL' => 'SSL'];
if (DI::config()->get('system', 'insecure_imap')) {
$ssl_options['notls'] = DI::l10n()->t('None');
}
$o .= Renderer::replaceMacros($tpl, [
'$form_security_token' => BaseModule::getFormSecurityToken("settings_connectors"),
'$title' => DI::l10n()->t('Social Networks'),
'$diasp_enabled' => $diasp_enabled,
'$ostat_enabled' => $ostat_enabled,
'$general_settings' => DI::l10n()->t('General Social Media Settings'),
'$accept_only_sharer' => [
'accept_only_sharer',
DI::l10n()->t('Followed content scope'),
$accept_only_sharer,
DI::l10n()->t('By default, conversations in which your follows participated but didn\'t start will be shown in your timeline. You can turn this behavior off, or expand it to the conversations in which your follows liked a post.'),
[
Item::COMPLETION_NONE => DI::l10n()->t('Only conversations my follows started'),
Item::COMPLETION_COMMENT => DI::l10n()->t('Conversations my follows started or commented on (default)'),
Item::COMPLETION_LIKE => DI::l10n()->t('Any conversation my follows interacted with, including likes'),
]
],
'$enable_cw' => ['enable_cw', DI::l10n()->t('Enable Content Warning'), $enable_cw, DI::l10n()->t('Users on networks like Mastodon or Pleroma are able to set a content warning field which collapse their post by default. This enables the automatic collapsing instead of setting the content warning as the post title. Doesn\'t affect any other content filtering you eventually set up.')],
'$enable_smart_shortening' => ['enable_smart_shortening', DI::l10n()->t('Enable intelligent shortening'), $enable_smart_shortening, DI::l10n()->t('Normally the system tries to find the best link to add to shortened posts. If disabled, every shortened post will always point to the original friendica post.')],
'$simple_shortening' => ['simple_shortening', DI::l10n()->t('Enable simple text shortening'), $simple_shortening, DI::l10n()->t('Normally the system shortens posts at the next line feed. If this option is enabled then the system will shorten the text at the maximum character limit.')],
'$attach_link_title' => ['attach_link_title', DI::l10n()->t('Attach the link title'), $attach_link_title, DI::l10n()->t('When activated, the title of the attached link will be added as a title on posts to Diaspora. This is mostly helpful with "remote-self" contacts that share feed content.')],
'$legacy_contact' => ['legacy_contact', DI::l10n()->t('Your legacy ActivityPub/GNU Social account'), $legacy_contact, DI::l10n()->t("If you enter your old account name from an ActivityPub based system or your GNU Social/Statusnet account name here (in the format user@domain.tld), your contacts will be added automatically. The field will be emptied when done.")],
'$repair_ostatus_url' => DI::baseUrl() . '/repair_ostatus',
'$repair_ostatus_text' => DI::l10n()->t('Repair OStatus subscriptions'),
'$connector_settings_forms' => $connector_settings_forms,
'$h_mail' => DI::l10n()->t('Email/Mailbox Setup'),
'$mail_desc' => DI::l10n()->t("If you wish to communicate with email contacts using this service \x28optional\x29, please specify how to connect to your mailbox."),
'$mail_lastcheck' => ['mail_lastcheck', DI::l10n()->t('Last successful email check:'), $mail_chk, ''],
'$mail_disabled' => $mail_disabled_message,
'$mail_server' => ['mail_server', DI::l10n()->t('IMAP server name:'), $mail_server, ''],
'$mail_port' => ['mail_port', DI::l10n()->t('IMAP port:'), $mail_port, ''],
'$mail_ssl' => ['mail_ssl', DI::l10n()->t('Security:'), strtoupper($mail_ssl), '', $ssl_options],
'$mail_user' => ['mail_user', DI::l10n()->t('Email login name:'), $mail_user, ''],
'$mail_pass' => ['mail_pass', DI::l10n()->t('Email password:'), '', ''],
'$mail_replyto' => ['mail_replyto', DI::l10n()->t('Reply-to address:'), $mail_replyto, 'Optional'],
'$mail_pubmail' => ['mail_pubmail', DI::l10n()->t('Send public posts to all email contacts:'), $mail_pubmail, ''],
'$mail_action' => ['mail_action', DI::l10n()->t('Action after import:'), $mail_action, '', [0 => DI::l10n()->t('None'), 1 => DI::l10n()->t('Delete'), 2 => DI::l10n()->t('Mark as seen'), 3 => DI::l10n()->t('Move to folder')]],
'$mail_movetofolder' => ['mail_movetofolder', DI::l10n()->t('Move to folder:'), $mail_movetofolder, ''],
'$submit' => DI::l10n()->t('Save Settings'),
]);
Hook::callAll('display_settings', $o);
return $o;
}
}

View File

@ -1,58 +0,0 @@
<?php
/**
* @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
use Friendica\App;
use Friendica\Content\Widget;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Module\Contact as ModuleContact;
use Friendica\Network\HTTPException;
function suggest_content(App $a)
{
if (!local_user()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
}
$_SESSION['return_path'] = DI::args()->getCommand();
DI::page()['aside'] .= Widget::findPeople();
DI::page()['aside'] .= Widget::follow();
$contacts = Contact\Relation::getSuggestions(local_user());
if (!DBA::isResult($contacts)) {
return DI::l10n()->t('No suggestions available. If this is a new site, please try again in 24 hours.');
}
$entries = [];
foreach ($contacts as $contact) {
$entries[] = ModuleContact::getContactTemplateVars($contact);
}
$tpl = Renderer::getMarkupTemplate('viewcontact_template.tpl');
return Renderer::replaceMacros($tpl,[
'$title' => DI::l10n()->t('Friend Suggestions'),
'$contacts' => $entries,
]);
}

View File

@ -1,171 +0,0 @@
<?php
/**
* @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
use Friendica\App;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Item;
use Friendica\Model\Post;
use Friendica\Model\Tag;
use Friendica\Protocol\Activity;
use Friendica\Util\XML;
use Friendica\Worker\Delivery;
function tagger_content(App $a) {
if (!Session::isAuthenticated()) {
return;
}
$term = trim($_GET['term'] ?? '');
// no commas allowed
$term = str_replace([',',' ', '<', '>'],['','_', '', ''], $term);
if (!$term) {
return;
}
$item_id = ((DI::args()->getArgc() > 1) ? trim(DI::args()->getArgv()[1]) : 0);
Logger::info('tagger: tag', ['term' => $term, 'item' => $item_id]);
$item = Post::selectFirst([], ['id' => $item_id]);
if (!$item_id || !DBA::isResult($item)) {
Logger::notice('tagger: no item ' . $item_id);
return;
}
$owner_uid = $item['uid'];
if (local_user() != $owner_uid) {
return;
}
$contact = Contact::selectFirst([], ['self' => true, 'uid' => local_user()]);
if (!DBA::isResult($contact)) {
Logger::warning('Self contact not found.', ['uid' => local_user()]);
return;
}
$uri = Item::newURI();
$xterm = XML::escape($term);
$post_type = (($item['resource-id']) ? DI::l10n()->t('photo') : DI::l10n()->t('status'));
$targettype = (($item['resource-id']) ? Activity\ObjectType::IMAGE : Activity\ObjectType::NOTE );
$href = DI::baseUrl() . '/display/' . $item['guid'];
$link = XML::escape('<link rel="alternate" type="text/html" href="'. $href . '" />' . "\n");
$body = XML::escape($item['body']);
$target = <<< EOT
<target>
<type>$targettype</type>
<local>1</local>
<id>{$item['uri']}</id>
<link>$link</link>
<title></title>
<content>$body</content>
</target>
EOT;
$tagid = DI::baseUrl() . '/search?tag=' . $xterm;
$objtype = Activity\ObjectType::TAGTERM;
$obj = <<< EOT
<object>
<type>$objtype</type>
<local>1</local>
<id>$tagid</id>
<link>$tagid</link>
<title>$xterm</title>
<content>$xterm</content>
</object>
EOT;
$bodyverb = DI::l10n()->t('%1$s tagged %2$s\'s %3$s with %4$s');
if (!isset($bodyverb)) {
return;
}
$termlink = html_entity_decode('&#x2317;') . '[url=' . DI::baseUrl() . '/search?tag=' . $term . ']'. $term . '[/url]';
$arr = [];
$arr['guid'] = System::createUUID();
$arr['uri'] = $uri;
$arr['uid'] = $owner_uid;
$arr['contact-id'] = $contact['id'];
$arr['wall'] = $item['wall'];
$arr['gravity'] = GRAVITY_COMMENT;
$arr['parent'] = $item['id'];
$arr['thr-parent'] = $item['uri'];
$arr['owner-name'] = $item['author-name'];
$arr['owner-link'] = $item['author-link'];
$arr['owner-avatar'] = $item['author-avatar'];
$arr['author-name'] = $contact['name'];
$arr['author-link'] = $contact['url'];
$arr['author-avatar'] = $contact['thumb'];
$ulink = '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]';
$alink = '[url=' . $item['author-link'] . ']' . $item['author-name'] . '[/url]';
$plink = '[url=' . $item['plink'] . ']' . $post_type . '[/url]';
$arr['body'] = sprintf( $bodyverb, $ulink, $alink, $plink, $termlink );
$arr['verb'] = Activity::TAG;
$arr['target-type'] = $targettype;
$arr['target'] = $target;
$arr['object-type'] = $objtype;
$arr['object'] = $obj;
$arr['private'] = $item['private'];
$arr['allow_cid'] = $item['allow_cid'];
$arr['allow_gid'] = $item['allow_gid'];
$arr['deny_cid'] = $item['deny_cid'];
$arr['deny_gid'] = $item['deny_gid'];
$arr['visible'] = 1;
$arr['unseen'] = 1;
$arr['origin'] = 1;
$post_id = Item::insert($arr);
if (!$item['visible']) {
Item::update(['visible' => true], ['id' => $item['id']]);
}
Tag::store($item['uri-id'], Tag::HASHTAG, $term);
$arr['id'] = $post_id;
Hook::callAll('post_local_end', $arr);
$post = Post::selectFirst(['uri-id', 'uid'], ['id' => $post_id]);
Worker::add(PRIORITY_HIGH, "Notifier", Delivery::POST, $post['uri-id'], $post['uid']);
System::exit();
}

View File

@ -1,131 +0,0 @@
<?php
/**
* @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
use Friendica\App;
use Friendica\Content\Text\BBCode;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Post;
use Friendica\Model\Tag;
function tagrm_post(App $a)
{
if (!local_user()) {
DI::baseUrl()->redirect($_SESSION['photo_return']);
}
if (!empty($_POST['submit']) && ($_POST['submit'] === DI::l10n()->t('Cancel'))) {
DI::baseUrl()->redirect($_SESSION['photo_return']);
}
$tags = [];
foreach ($_POST['tag'] ?? [] as $tag) {
$tags[] = hex2bin(trim($tag));
}
$item_id = $_POST['item'] ?? 0;
update_tags($item_id, $tags);
DI::baseUrl()->redirect($_SESSION['photo_return']);
// NOTREACHED
}
/**
* Updates tags from an item
*
* @param $item_id
* @param $tags array
* @throws Exception
*/
function update_tags($item_id, $tags)
{
if (empty($item_id) || empty($tags)) {
return;
}
$item = Post::selectFirst(['uri-id'], ['id' => $item_id, 'uid' => local_user()]);
if (!DBA::isResult($item)) {
return;
}
foreach ($tags as $new_tag) {
if (preg_match_all('/([#@!])\[url\=([^\[\]]*)\]([^\[\]]*)\[\/url\]/ism', $new_tag, $results, PREG_SET_ORDER)) {
foreach ($results as $tag) {
Tag::removeByHash($item['uri-id'], $tag[1], $tag[3], $tag[2]);
}
}
}
}
function tagrm_content(App $a)
{
$o = '';
$photo_return = $_SESSION['photo_return'] ?? '';
if (!local_user()) {
DI::baseUrl()->redirect($photo_return);
// NOTREACHED
}
if (DI::args()->getArgc()== 3) {
update_tags(DI::args()->getArgv()[1], [trim(hex2bin(DI::args()->getArgv()[2]))]);
DI::baseUrl()->redirect($photo_return);
}
$item_id = ((DI::args()->getArgc()> 1) ? intval(DI::args()->getArgv()[1]) : 0);
if (!$item_id) {
DI::baseUrl()->redirect($photo_return);
// NOTREACHED
}
$item = Post::selectFirst(['uri-id'], ['id' => $item_id, 'uid' => local_user()]);
if (!DBA::isResult($item)) {
DI::baseUrl()->redirect($photo_return);
}
$tag_text = Tag::getCSVByURIId($item['uri-id']);
$arr = explode(',', $tag_text);
if (empty($arr)) {
DI::baseUrl()->redirect($photo_return);
}
$o .= '<h3>' . DI::l10n()->t('Remove Item Tag') . '</h3>';
$o .= '<p id="tag-remove-desc">' . DI::l10n()->t('Select a tag to remove: ') . '</p>';
$o .= '<form id="tagrm" action="tagrm" method="post" >';
$o .= '<input type="hidden" name="item" value="' . $item_id . '" />';
$o .= '<ul>';
foreach ($arr as $x) {
$o .= '<li><input type="checkbox" name="tag[]" value="' . bin2hex($x) . '" >' . BBCode::convert($x) . '</input></li>';
}
$o .= '</ul>';
$o .= '<input id="tagrm-submit" type="submit" name="submit" value="' . DI::l10n()->t('Remove') .'" />';
$o .= '<input id="tagrm-cancel" type="submit" name="submit" value="' . DI::l10n()->t('Cancel') .'" />';
$o .= '</form>';
return $o;
}

View File

@ -1,71 +0,0 @@
<?php
/**
* @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* View for user import
*/
use Friendica\App;
use Friendica\Core\Logger;
use Friendica\Core\UserImport;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\DI;
function uimport_post(App $a)
{
if ((DI::config()->get('config', 'register_policy') != \Friendica\Module\Register::OPEN) && !$a->isSiteAdmin()) {
notice(DI::l10n()->t('Permission denied.'));
return;
}
if (!empty($_FILES['accountfile'])) {
UserImport::importAccount($_FILES['accountfile']);
return;
}
}
function uimport_content(App $a)
{
if ((DI::config()->get('config', 'register_policy') != \Friendica\Module\Register::OPEN) && !$a->isSiteAdmin()) {
notice(DI::l10n()->t('User imports on closed servers can only be done by an administrator.'));
return;
}
$max_dailies = intval(DI::config()->get('system', 'max_daily_registrations'));
if ($max_dailies) {
$total = DBA::count('user', ["`register_date` > UTC_TIMESTAMP - INTERVAL 1 DAY"]);
if ($total >= $max_dailies) {
Logger::notice('max daily registrations exceeded.');
notice(DI::l10n()->t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.'));
return;
}
}
$tpl = Renderer::getMarkupTemplate("uimport.tpl");
return Renderer::replaceMacros($tpl, [
'$regbutt' => DI::l10n()->t('Import'),
'$import' => [
'title' => DI::l10n()->t("Move account"),
'intro' => DI::l10n()->t("You can import an account from another Friendica server."),
'instruct' => DI::l10n()->t("You need to export your account from the old server and upload it here. We will recreate your old account here with all your contacts. We will try also to inform your friends that you moved here."),
'warn' => DI::l10n()->t("This feature is experimental. We can't import contacts from the OStatus network \x28GNU Social/Statusnet\x29 or from Diaspora"),
'field' => ['accountfile', DI::l10n()->t('Account file'), '<input id="id_accountfile" name="accountfile" type="file">', DI::l10n()->t('To export your account, go to "Settings->Export your personal data" and select "Export account"')],
],
]);
}

View File

@ -1,151 +0,0 @@
<?php
/**
* @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
use Friendica\App;
use Friendica\Content\Widget;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\User;
use Friendica\Util\Strings;
function unfollow_post(App $a)
{
if (!local_user()) {
notice(DI::l10n()->t('Permission denied.'));
DI::baseUrl()->redirect('login');
// NOTREACHED
}
$url = trim($_REQUEST['url'] ?? '');
unfollow_process($url);
}
function unfollow_content(App $a)
{
$base_return_path = 'contact';
if (!local_user()) {
notice(DI::l10n()->t('Permission denied.'));
DI::baseUrl()->redirect('login');
// NOTREACHED
}
$uid = local_user();
$url = trim($_REQUEST['url']);
$condition = ["`uid` = ? AND (`rel` = ? OR `rel` = ?) AND (`nurl` = ? OR `alias` = ? OR `alias` = ?)",
local_user(), Contact::SHARING, Contact::FRIEND, Strings::normaliseLink($url),
Strings::normaliseLink($url), $url];
$contact = DBA::selectFirst('contact', ['url', 'id', 'uid', 'network', 'addr', 'name'], $condition);
if (!DBA::isResult($contact)) {
notice(DI::l10n()->t("You aren't following this contact."));
DI::baseUrl()->redirect($base_return_path);
// NOTREACHED
}
if (!Protocol::supportsFollow($contact['network'])) {
notice(DI::l10n()->t('Unfollowing is currently not supported by your network.'));
DI::baseUrl()->redirect($base_return_path . '/' . $contact['id']);
// NOTREACHED
}
$request = DI::baseUrl() . '/unfollow';
$tpl = Renderer::getMarkupTemplate('auto_request.tpl');
$self = DBA::selectFirst('contact', ['url'], ['uid' => $uid, 'self' => true]);
if (!DBA::isResult($self)) {
notice(DI::l10n()->t('Permission denied.'));
DI::baseUrl()->redirect($base_return_path);
// NOTREACHED
}
if (!empty($_REQUEST['auto'])) {
unfollow_process($contact['url']);
}
$o = Renderer::replaceMacros($tpl, [
'$header' => DI::l10n()->t('Disconnect/Unfollow'),
'$page_desc' => '',
'$your_address' => DI::l10n()->t('Your Identity Address:'),
'$invite_desc' => '',
'$submit' => DI::l10n()->t('Submit Request'),
'$cancel' => DI::l10n()->t('Cancel'),
'$url' => $contact['url'],
'$zrl' => Contact::magicLinkByContact($contact),
'$url_label' => DI::l10n()->t('Profile URL'),
'$myaddr' => $self['url'],
'$request' => $request,
'$keywords' => '',
'$keywords_label'=> ''
]);
DI::page()['aside'] = Widget\VCard::getHTML(Contact::getByURL($contact['url'], false));
$o .= Renderer::replaceMacros(Renderer::getMarkupTemplate('section_title.tpl'), ['$title' => DI::l10n()->t('Status Messages and Posts')]);
// Show last public posts
$o .= Contact::getPostsFromUrl($contact['url']);
return $o;
}
function unfollow_process(string $url)
{
$base_return_path = 'contact';
$uid = local_user();
$owner = User::getOwnerDataById($uid);
if (!$owner) {
throw new \Friendica\Network\HTTPException\NotFoundException();
}
$condition = ["`uid` = ? AND (`rel` = ? OR `rel` = ?) AND (`nurl` = ? OR `alias` = ? OR `alias` = ?)",
$uid, Contact::SHARING, Contact::FRIEND, Strings::normaliseLink($url),
Strings::normaliseLink($url), $url];
$contact = DBA::selectFirst('contact', [], $condition);
if (!DBA::isResult($contact)) {
notice(DI::l10n()->t("You aren't following this contact."));
DI::baseUrl()->redirect($base_return_path);
// NOTREACHED
}
$return_path = $base_return_path . '/' . $contact['id'];
try {
Contact::unfollow($contact);
$notice_message = DI::l10n()->t('Contact was successfully unfollowed');
} catch (Exception $e) {
DI::logger()->error($e->getMessage(), ['contact' => $contact]);
$notice_message = DI::l10n()->t('Unable to unfollow this contact, please contact your administrator');
}
notice($notice_message);
DI::baseUrl()->redirect($return_path);
}

View File

@ -30,7 +30,7 @@ use Friendica\Model\Contact;
function update_contact_content(App $a)
{
if (!empty(DI::args()->get(1)) && (!empty($_GET['force']) || !DI::pConfig()->get(local_user(), 'system', 'no_auto_update'))) {
if (!empty(DI::args()->get(1)) && (!empty($_GET['force']) || !DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'no_auto_update'))) {
$contact = Contact::getById(DI::args()->get(1), ['id', 'deleted']);
if (DBA::isResult($contact) && empty($contact['deleted'])) {
DI::page()['aside'] = '';

View File

@ -24,11 +24,11 @@ use Friendica\App;
use Friendica\Core\System;
use Friendica\DI;
require_once("mod/notes.php");
require_once 'mod/notes.php';
function update_notes_content(App $a) {
$profile_uid = intval($_GET["p"]);
function update_notes_content(App $a)
{
$profile_uid = intval($_GET['p']);
/**
*

View File

@ -1,137 +0,0 @@
<?php
/**
* @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
use Friendica\App;
use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Attach;
use Friendica\Model\User;
use Friendica\Util\Strings;
function wall_attach_post(App $a) {
$r_json = (!empty($_GET['response']) && $_GET['response']=='json');
if (DI::args()->getArgc() > 1) {
$nick = DI::args()->getArgv()[1];
$owner = User::getOwnerDataByNick($nick);
if (!DBA::isResult($owner)) {
if ($r_json) {
System::jsonExit(['error' => DI::l10n()->t('Invalid request.')]);
}
return;
}
} else {
if ($r_json) {
System::jsonExit(['error' => DI::l10n()->t('Invalid request.')]);
}
return;
}
$can_post = false;
$page_owner_uid = $owner['uid'];
$page_owner_cid = $owner['id'];
$community_page = $owner['page-flags'] == User::PAGE_FLAGS_COMMUNITY;
if (local_user() && (local_user() == $page_owner_uid)) {
$can_post = true;
} elseif ($community_page && !empty(Session::getRemoteContactID($page_owner_uid))) {
$contact_id = Session::getRemoteContactID($page_owner_uid);
$can_post = DBA::exists('contact', ['blocked' => false, 'pending' => false, 'id' => $contact_id, 'uid' => $page_owner_uid]);
}
if (!$can_post) {
if ($r_json) {
System::jsonExit(['error' => DI::l10n()->t('Permission denied.')]);
}
notice(DI::l10n()->t('Permission denied.') . EOL );
System::exit();
}
if (empty($_FILES['userfile'])) {
if ($r_json) {
System::jsonExit(['error' => DI::l10n()->t('Invalid request.')]);
}
System::exit();
}
$src = $_FILES['userfile']['tmp_name'];
$filename = basename($_FILES['userfile']['name']);
$filesize = intval($_FILES['userfile']['size']);
$maxfilesize = DI::config()->get('system','maxfilesize');
/* Found html code written in text field of form,
* when trying to upload a file with filesize
* greater than upload_max_filesize. Cause is unknown.
* Then Filesize gets <= 0.
*/
if ($filesize <= 0) {
$msg = DI::l10n()->t('Sorry, maybe your upload is bigger than the PHP configuration allows') . EOL .(DI::l10n()->t('Or - did you try to upload an empty file?'));
@unlink($src);
if ($r_json) {
System::jsonExit(['error' => $msg]);
} else {
notice($msg);
}
System::exit();
}
if ($maxfilesize && $filesize > $maxfilesize) {
$msg = DI::l10n()->t('File exceeds size limit of %s', Strings::formatBytes($maxfilesize));
@unlink($src);
if ($r_json) {
System::jsonExit(['error' => $msg]);
} else {
echo $msg . EOL;
}
System::exit();
}
$newid = Attach::storeFile($src, $page_owner_uid, $filename, '<' . $page_owner_cid . '>');
@unlink($src);
if ($newid === false) {
$msg = DI::l10n()->t('File upload failed.');
if ($r_json) {
System::jsonExit(['error' => $msg]);
} else {
echo $msg . EOL;
}
System::exit();
}
if ($r_json) {
System::jsonExit(['ok' => true, 'id' => $newid]);
}
$lf = "\n";
echo $lf . $lf . '[attachment]' . $newid . '[/attachment]' . $lf;
System::exit();
// NOTREACHED
}

View File

@ -1,286 +0,0 @@
<?php
/**
* @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* Module for uploading a picture to the profile wall
*
* By default the picture will be stored in the photo album with the name Wall Photos.
* You can specify a different album by adding an optional query string "album="
* to the url
*
*/
use Friendica\App;
use Friendica\Core\Logger;
use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Photo;
use Friendica\Model\User;
use Friendica\Module\BaseApi;
use Friendica\Object\Image;
use Friendica\Util\Images;
use Friendica\Util\Strings;
function wall_upload_post(App $a, $desktopmode = true)
{
Logger::info("wall upload: starting new upload");
$r_json = (!empty($_GET['response']) && $_GET['response'] == 'json');
$album = trim($_GET['album'] ?? '');
if (DI::args()->getArgc() > 1) {
if (empty($_FILES['media'])) {
$nick = DI::args()->getArgv()[1];
$user = DBA::selectFirst('owner-view', ['id', 'uid', 'nickname', 'page-flags'], ['nickname' => $nick, 'blocked' => false]);
if (!DBA::isResult($user)) {
if ($r_json) {
System::jsonExit(['error' => DI::l10n()->t('Invalid request.')]);
}
return;
}
} else {
$user = DBA::selectFirst('owner-view', ['id', 'uid', 'nickname', 'page-flags'], ['uid' => BaseApi::getCurrentUserID(), 'blocked' => false]);
}
} else {
if ($r_json) {
System::jsonExit(['error' => DI::l10n()->t('Invalid request.')]);
}
return;
}
/*
* Setup permissions structures
*/
$can_post = false;
$visitor = 0;
$page_owner_uid = $user['uid'];
$default_cid = $user['id'];
$page_owner_nick = $user['nickname'];
$community_page = (($user['page-flags'] == User::PAGE_FLAGS_COMMUNITY) ? true : false);
if ((local_user()) && (local_user() == $page_owner_uid)) {
$can_post = true;
} elseif ($community_page && !empty(Session::getRemoteContactID($page_owner_uid))) {
$contact_id = Session::getRemoteContactID($page_owner_uid);
$can_post = DBA::exists('contact', ['blocked' => false, 'pending' => false, 'id' => $contact_id, 'uid' => $page_owner_uid]);
$visitor = $contact_id;
}
if (!$can_post) {
if ($r_json) {
System::jsonExit(['error' => DI::l10n()->t('Permission denied.')]);
}
notice(DI::l10n()->t('Permission denied.'));
System::exit();
}
if (empty($_FILES['userfile']) && empty($_FILES['media'])) {
if ($r_json) {
System::jsonExit(['error' => DI::l10n()->t('Invalid request.')]);
}
System::exit();
}
$src = '';
$filename = '';
$filesize = 0;
$filetype = '';
if (!empty($_FILES['userfile'])) {
$src = $_FILES['userfile']['tmp_name'];
$filename = basename($_FILES['userfile']['name']);
$filesize = intval($_FILES['userfile']['size']);
$filetype = $_FILES['userfile']['type'];
} elseif (!empty($_FILES['media'])) {
if (!empty($_FILES['media']['tmp_name'])) {
if (is_array($_FILES['media']['tmp_name'])) {
$src = $_FILES['media']['tmp_name'][0];
} else {
$src = $_FILES['media']['tmp_name'];
}
}
if (!empty($_FILES['media']['name'])) {
if (is_array($_FILES['media']['name'])) {
$filename = basename($_FILES['media']['name'][0]);
} else {
$filename = basename($_FILES['media']['name']);
}
}
if (!empty($_FILES['media']['size'])) {
if (is_array($_FILES['media']['size'])) {
$filesize = intval($_FILES['media']['size'][0]);
} else {
$filesize = intval($_FILES['media']['size']);
}
}
if (!empty($_FILES['media']['type'])) {
if (is_array($_FILES['media']['type'])) {
$filetype = $_FILES['media']['type'][0];
} else {
$filetype = $_FILES['media']['type'];
}
}
}
if ($src == "") {
if ($r_json) {
System::jsonExit(['error' => DI::l10n()->t('Invalid request.')]);
}
notice(DI::l10n()->t('Invalid request.'));
System::exit();
}
$filetype = Images::getMimeTypeBySource($src, $filename, $filetype);
Logger::info("File upload src: " . $src . " - filename: " . $filename .
" - size: " . $filesize . " - type: " . $filetype);
$imagedata = @file_get_contents($src);
$image = new Image($imagedata, $filetype);
if (!$image->isValid()) {
$msg = DI::l10n()->t('Unable to process image.');
@unlink($src);
if ($r_json) {
System::jsonExit(['error' => $msg]);
} else {
echo $msg. EOL;
}
System::exit();
}
$image->orient($src);
@unlink($src);
$max_length = DI::config()->get('system', 'max_image_length');
if ($max_length > 0) {
$image->scaleDown($max_length);
$filesize = strlen($image->asString());
Logger::info("File upload: Scaling picture to new size " . $max_length);
}
$width = $image->getWidth();
$height = $image->getHeight();
$maximagesize = DI::config()->get('system', 'maximagesize');
if (!empty($maximagesize) && ($filesize > $maximagesize)) {
// Scale down to multiples of 640 until the maximum size isn't exceeded anymore
foreach ([5120, 2560, 1280, 640] as $pixels) {
if (($filesize > $maximagesize) && (max($width, $height) > $pixels)) {
Logger::info('Resize', ['size' => $filesize, 'width' => $width, 'height' => $height, 'max' => $maximagesize, 'pixels' => $pixels]);
$image->scaleDown($pixels);
$filesize = strlen($image->asString());
$width = $image->getWidth();
$height = $image->getHeight();
}
}
if ($filesize > $maximagesize) {
Logger::notice('Image size is too big', ['size' => $filesize, 'max' => $maximagesize]);
$msg = DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize));
@unlink($src);
if ($r_json) {
System::jsonExit(['error' => $msg]);
} else {
echo $msg. EOL;
}
System::exit();
}
}
$resource_id = Photo::newResource();
$smallest = 0;
// If we don't have an album name use the Wall Photos album
if (!strlen($album)) {
$album = DI::l10n()->t('Wall Photos');
}
$defperm = '<' . $default_cid . '>';
$r = Photo::store($image, $page_owner_uid, $visitor, $resource_id, $filename, $album, 0, Photo::DEFAULT, $defperm);
if (!$r) {
$msg = DI::l10n()->t('Image upload failed.');
if ($r_json) {
System::jsonExit(['error' => $msg]);
} else {
echo $msg. EOL;
}
System::exit();
}
if ($width > 640 || $height > 640) {
$image->scaleDown(640);
$r = Photo::store($image, $page_owner_uid, $visitor, $resource_id, $filename, $album, 1, Photo::DEFAULT, $defperm);
if ($r) {
$smallest = 1;
}
}
if ($width > 320 || $height > 320) {
$image->scaleDown(320);
$r = Photo::store($image, $page_owner_uid, $visitor, $resource_id, $filename, $album, 2, Photo::DEFAULT, $defperm);
if ($r && ($smallest == 0)) {
$smallest = 2;
}
}
if (!$desktopmode) {
$photo = Photo::selectFirst(['id', 'datasize', 'width', 'height', 'type'], ['resource-id' => $resource_id], ['order' => ['width']]);
if (!$photo) {
if ($r_json) {
System::jsonExit(['error' => '']);
}
return false;
}
$picture = [];
$picture["id"] = $photo["id"];
$picture["size"] = $photo["datasize"];
$picture["width"] = $photo["width"];
$picture["height"] = $photo["height"];
$picture["type"] = $photo["type"];
$picture["albumpage"] = DI::baseUrl() . '/photos/' . $page_owner_nick . '/image/' . $resource_id;
$picture["picture"] = DI::baseUrl() . "/photo/{$resource_id}-0." . $image->getExt();
$picture["preview"] = DI::baseUrl() . "/photo/{$resource_id}-{$smallest}." . $image->getExt();
if ($r_json) {
System::jsonExit(['picture' => $picture]);
}
Logger::info("upload done");
return $picture;
}
Logger::info("upload done");
if ($r_json) {
System::jsonExit(['ok' => true]);
}
echo "\n\n" . '[url=' . DI::baseUrl() . '/photos/' . $page_owner_nick . '/image/' . $resource_id . '][img]' . DI::baseUrl() . "/photo/{$resource_id}-{$smallest}." . $image->getExt() . "[/img][/url]\n\n";
System::exit();
// NOTREACHED
}

View File

@ -1,146 +0,0 @@
<?php
/**
* @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
use Friendica\App;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Mail;
use Friendica\Model\Profile;
use Friendica\Model\User;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Strings;
function wallmessage_post(App $a) {
$replyto = Profile::getMyURL();
if (!$replyto) {
notice(DI::l10n()->t('Permission denied.'));
return;
}
$subject = trim($_REQUEST['subject'] ?? '');
$body = Strings::escapeHtml(trim($_REQUEST['body'] ?? ''));
$recipient = ((DI::args()->getArgc() > 1) ? DI::args()->getArgv()[1] : '');
if ((! $recipient) || (! $body)) {
return;
}
$user = User::getByNickname($recipient);
if (empty($r)) {
Logger::notice('wallmessage: no recipient');
return;
}
if (!$user['unkmail']) {
notice(DI::l10n()->t('Permission denied.'));
return;
}
$total = DBA::count('mail', ["`uid` = ? AND `created` > ? AND `unknown`", $user['uid'], DateTimeFormat::utc('now - 1 day')]);
if ($total > $user['cntunkmail']) {
notice(DI::l10n()->t('Number of daily wall messages for %s exceeded. Message failed.', $user['username']));
return;
}
$ret = Mail::sendWall($user, $body, $subject, $replyto);
switch ($ret) {
case -1:
notice(DI::l10n()->t('No recipient selected.'));
break;
case -2:
notice(DI::l10n()->t('Unable to check your home location.'));
break;
case -3:
notice(DI::l10n()->t('Message could not be sent.'));
break;
case -4:
notice(DI::l10n()->t('Message collection failure.'));
break;
}
DI::baseUrl()->redirect('profile/'.$user['nickname']);
}
function wallmessage_content(App $a) {
if (!Profile::getMyURL()) {
notice(DI::l10n()->t('Permission denied.'));
return;
}
$recipient = ((DI::args()->getArgc() > 1) ? DI::args()->getArgv()[1] : '');
if (!$recipient) {
notice(DI::l10n()->t('No recipient.'));
return;
}
$user = User::getByNickname($recipient);
if (empty($user)) {
notice(DI::l10n()->t('No recipient.'));
Logger::notice('wallmessage: no recipient');
return;
}
if (!$user['unkmail']) {
notice(DI::l10n()->t('Permission denied.'));
return;
}
$total = DBA::count('mail', ["`uid` = ? AND `created` > ? AND `unknown`", $user['uid'], DateTimeFormat::utc('now - 1 day')]);
if ($total > $user['cntunkmail']) {
notice(DI::l10n()->t('Number of daily wall messages for %s exceeded. Message failed.', $user['username']));
return;
}
$tpl = Renderer::getMarkupTemplate('wallmsg-header.tpl');
DI::page()['htmlhead'] .= Renderer::replaceMacros($tpl, [
'$baseurl' => DI::baseUrl()->get(true),
'$nickname' => $user['nickname'],
'$linkurl' => DI::l10n()->t('Please enter a link URL:')
]);
$tpl = Renderer::getMarkupTemplate('wallmessage.tpl');
$o = Renderer::replaceMacros($tpl, [
'$header' => DI::l10n()->t('Send Private Message'),
'$subheader' => DI::l10n()->t('If you wish for %s to respond, please check that the privacy settings on your site allow private mail from unknown senders.', $user['username']),
'$to' => DI::l10n()->t('To:'),
'$subject' => DI::l10n()->t('Subject:'),
'$recipname' => $user['username'],
'$nickname' => $user['nickname'],
'$subjtxt' => $_REQUEST['subject'] ?? '',
'$text' => $_REQUEST['body'] ?? '',
'$readonly' => '',
'$yourmessage'=> DI::l10n()->t('Your message:'),
'$parent' => '',
'$upload' => DI::l10n()->t('Upload photo'),
'$insert' => DI::l10n()->t('Insert web link'),
'$wait' => DI::l10n()->t('Please wait')
]);
return $o;
}

Some files were not shown because too many files have changed in this diff Show More