Compare commits

...
Sign in to create a new pull request.

292 commits

Author SHA1 Message Date
Matthew Exon
29fce8b7af trying to get phototrack to work 2023-12-26 16:35:27 +00:00
Matthew Exon
a30d850ff1 some more robust mailstream stuff 2023-12-26 16:34:57 +00:00
Matthew Exon
2728f8a839 debugging some issues 2023-12-26 16:33:37 +00:00
Matthew Exon
45557455e4 more overdue adaptations 2023-12-26 15:52:57 +01:00
Matthew Exon
a99a0050e3 some changes that were long overdue 2023-12-26 15:14:35 +01:00
Matthew Exon
f0e1c25c81 more adaption to latest release 2023-12-26 13:44:36 +01:00
Matthew Exon
972ca553e4 adapt to latest release 2023-12-26 13:25:19 +01:00
Matthew Exon
61d6b97ff9 log uid but ignore results 2023-12-26 12:41:28 +01:00
Matthew Exon
ca8724618d remove duplicate use directive 2023-12-26 12:41:28 +01:00
Matthew Exon
da050ad7ed fix contact photo menu callback really 2023-12-26 12:41:28 +01:00
Matthew Exon
2ef545dc2f fix contact photo menu callback 2023-12-26 12:41:28 +01:00
Matthew Exon
3ae851298c replace local_user 2023-12-26 12:41:28 +01:00
5c274c49ea The priority is now a class constant 2023-12-26 12:41:25 +01:00
Matthew Exon
14ccd5819c Add missing use statement 2023-12-26 12:40:01 +01:00
Matthew Exon
ae312dd1d2 add types to parameters 2023-12-26 12:40:01 +01:00
Matthew Exon
7d2fab95a2 fix order of upgrade commands 2023-12-26 12:40:01 +01:00
Matthew Exon
f9b608ded3 add log lines to install 2023-12-26 12:40:01 +01:00
Matthew Exon
202f4d7d3e Fix length of keys 2023-12-26 12:40:01 +01:00
Matthew Exon
a635c5b40c Use new hook registration calls 2023-12-26 12:40:01 +01:00
Matthew Exon
c142f78666 Update to correct collation mode 2023-12-26 12:40:01 +01:00
Matthew Exon
531d949f9b Use separate album and repair dox for ces 2023-12-26 12:40:01 +01:00
Matthew Exon
8caf67196e fix comment 2023-12-26 12:40:01 +01:00
Matthew Exon
375380c481 correct use of fetchFull 2023-12-26 12:40:01 +01:00
Matthew Exon
1749ee4d00 fix argv stuff 2023-12-26 12:40:01 +01:00
Matthew Exon
a71e247af8 fix argv stuff 2023-12-26 12:40:01 +01:00
Matthew Exon
ae9435d14f use new temppath function 2023-12-26 12:40:01 +01:00
Matthew Exon
598a2b7173 fix sql syntax 2023-12-26 12:40:01 +01:00
Matthew Exon
bee61caa69 improvements 2023-12-26 12:40:01 +01:00
Matthew Exon
3bb542fd34 syntax errors 2023-12-26 12:40:01 +01:00
Matthew Exon
34959e6b7a syntax errors 2023-12-26 12:40:01 +01:00
Matthew Exon
8b7850f06b syntax errors 2023-12-26 12:40:01 +01:00
Matthew Exon
d12c4672e0 syntax errors 2023-12-26 12:40:01 +01:00
Matthew Exon
02f09b4d62 this is more correcter 2023-12-26 12:40:01 +01:00
Matthew Exon
48936be5d9 this is more correct 2023-12-26 12:40:01 +01:00
Matthew Exon
2294a6ae07 another migrated function 2023-12-26 12:40:01 +01:00
Matthew Exon
2b82f4a157 add anotehr check 2023-12-26 12:40:01 +01:00
Matthew Exon
014dc97262 also update these queries 2023-12-26 12:40:01 +01:00
Matthew Exon
d40c00c87c stray line 2023-12-26 12:40:01 +01:00
Matthew Exon
79c59b8774 perhaps it should be this style 2023-12-26 12:40:01 +01:00
Matthew Exon
b3856f74d4 attempt to handle one error 2023-12-26 12:40:01 +01:00
Matthew Exon
2185399ace new style of http request 2023-12-26 12:40:01 +01:00
Matthew Exon
43ef2c384d switch to new way of executing SQL 2023-12-26 12:40:01 +01:00
Matthew Exon
aae5c928bb switch to new way of executing SQL 2023-12-26 12:40:01 +01:00
Matthew Exon
c09c5dafab switch to new way of executing SQL 2023-12-26 12:40:01 +01:00
Matthew Exon
a69973c2f8 sync with submitted 2023-12-26 12:40:01 +01:00
Matthew Exon
f49acac141 error checking in retriever 2023-12-26 12:40:01 +01:00
Matthew Exon
920649ae54 fix another stupid mistake 2023-12-26 12:40:01 +01:00
Matthew Exon
df75544041 fix another stupid mistake 2023-12-26 12:40:01 +01:00
Matthew Exon
c175129dba Detect an error in mailstream 2023-12-26 12:40:01 +01:00
Matthew Exon
a8dbf18806 fixed another obvious mistake 2023-12-26 12:40:01 +01:00
Matthew Exon
2abbf2ecea Fix a typo 2023-12-26 12:40:01 +01:00
Matthew Exon
7276bef313 another check for empty results 2023-12-26 12:40:01 +01:00
Matthew Exon
b4da069277 Adapt Item methods to Post methods 2023-12-26 12:40:01 +01:00
Matthew Exon
c9179879b3 Remove binary field from httpRequest 2023-12-26 12:40:01 +01:00
Matthew Exon
88c572033c Replace fetchUrlFull with HTTPRequest version 2023-12-26 12:40:01 +01:00
Matthew Exon
f776f4620b Remove unneeded get_app 2023-12-26 12:40:01 +01:00
Matthew Exon
e0d2c0055b Fix page assembly 2023-12-26 12:40:01 +01:00
Matthew Exon
d356f455b4 Update with base url changes and strict key requirements 2023-12-26 12:40:01 +01:00
Matthew Exon
f9709ff0b0 Further updates to 2020.03 2023-12-26 12:40:01 +01:00
Matthew Exon
bb038a2010 Use new L10n thing 2023-12-26 12:40:01 +01:00
Matthew Exon
a3d0b0d5e0 Update to new module structure 2023-12-26 12:40:01 +01:00
Matthew Exon
ca7f028c4b maybe this way works better 2023-12-26 12:40:01 +01:00
Matthew Exon
4e8b58f6c3 New way of doing baseurl 2023-12-26 12:40:01 +01:00
Matthew Exon
534315cb97 Missing class 2023-12-26 12:40:01 +01:00
Matthew Exon
ed6b82e95e Update for new version 2023-12-26 12:40:01 +01:00
Matthew Exon
319d569a4c Fix bug in phototrack 2023-12-26 12:40:01 +01:00
Matthew Exon
6fff252845 remove help section if images not allowed 2023-12-26 12:40:01 +01:00
Matthew Exon
d0166e9083 Almost finished, maybe not working 2023-12-26 12:40:01 +01:00
Matthew Exon
6d0c547a44 working much better 2023-12-26 12:40:01 +01:00
Matthew Exon
7ed51175f3 I think this works 2023-12-26 12:40:01 +01:00
Matthew Exon
49e1b771de small addition 2023-12-26 12:40:01 +01:00
Matthew Exon
5a336b4776 small cleanup 2023-12-26 12:40:01 +01:00
Matthew Exon
a080cd84ab working much better 2023-12-26 12:40:01 +01:00
Matthew Exon
f1b253f222 maybe broken again 2023-12-26 12:40:01 +01:00
Matthew Exon
67f881e8d1 Now retriever works again 2023-12-26 12:40:01 +01:00
Matthew Exon
7202f2d500 extensive refactoring 2023-12-26 12:40:01 +01:00
Matthew Exon
525dd5a918 retriever tweaks 2023-12-26 12:40:01 +01:00
Matthew Exon
85ef79d017 Add phototrack and publicise 2023-12-26 12:40:01 +01:00
Matthew Exon
e15089c762 configurable number of requests 2023-12-26 12:40:01 +01:00
Matthew Exon
7720775c52 update version number 2023-12-26 12:40:01 +01:00
Matthew Exon
7b07411491 Stuff in retriever 2023-12-26 12:40:01 +01:00
Matthew Exon
58f0b71ba9 fixed image regex 2023-12-26 12:40:01 +01:00
Matthew Exon
262fb8d1d7 more dba stuff 2023-12-26 12:40:01 +01:00
Matthew Exon
f11d24c42f fakerei2 2023-12-26 12:40:01 +01:00
Matthew Exon
ca960d75f6 Fix bugs in retriever retrospective stuff 2023-12-26 12:40:01 +01:00
Matthew Exon
fac75634a9 more retriever stuff 2023-12-26 12:40:01 +01:00
Administrator
3776d01be7 Fix retriever database problems 2023-12-26 12:40:01 +01:00
Matthew Exon
205e685e8e retriever stuff 2023-12-26 12:40:01 +01:00
Matthew Exon
52c298d609 Change logging functions 2023-12-26 12:40:01 +01:00
Matthew Exon
77ae6b3d09 Improvement 2023-12-26 12:40:00 +01:00
Administrator
ddbba2f360 this is working OK 2023-12-26 12:40:00 +01:00
Matthew Exon
d9d02946f5 fixed a bug and commented on another 2023-12-26 12:40:00 +01:00
Matthew Exon
006569b67f fix 2023-12-26 12:40:00 +01:00
Matthew Exon
eb7ff8553e tentative database work 2023-12-26 12:40:00 +01:00
Matthew Exon
32e4bd0b25 More preparation for persistent cookies 2023-12-26 12:40:00 +01:00
Matthew Exon
62314370da beginnings of persistent cookiejar support 2023-12-26 12:40:00 +01:00
Matthew Exon
5a4db5c9cd now working retriever 2023-12-26 12:40:00 +01:00
Matthew Exon
1a3538619b more fixes 2023-12-26 12:40:00 +01:00
Matthew Exon
60e6cd8944 more fixes 2023-12-26 12:40:00 +01:00
Matthew Exon
1a03a37ce8 Fixes for retriever 2023-12-26 12:40:00 +01:00
Matthew Exon
28dbe07eae Latest version of retriever 2023-12-26 12:40:00 +01:00
b87588e371 Merge pull request 'Tumblr/Bluesky: Avoid problems on first fetch' (#1452) from heluecht/friendica-addons:first-fetch into 2023.09-rc
Reviewed-on: friendica/friendica-addons#1452
2023-12-21 13:45:24 +01:00
96c70489f5 Tumblr/Bluesky: Avoid problems on first fetch 2023-12-21 05:23:38 +00:00
77ad52d1f4 Merge pull request 'Bluesky/Tumblr: Set "received" to "created" if fetched after previous poll' (#1451) from heluecht/friendica-addons:received into 2023.09-rc
Reviewed-on: friendica/friendica-addons#1451
2023-12-21 05:21:43 +01:00
96a354bc65 Bluesky/Tumblr: Set "received" to "created" if fetched after previous poll 2023-12-20 20:46:24 +00:00
f32c90dc9f Merge pull request '[s3_storage] Bump version of akeeba/s3 to version 2.3.1' (#1450) from MrPetovan/friendica-addons:bug/deprecated into 2023.09-rc
Reviewed-on: friendica/friendica-addons#1450
2023-12-20 14:17:01 +01:00
3e74af9775 [s3_storage] Bump version of akeeba/s3 to version 2.3.1
- Address https://github.com/friendica/friendica/issues/12011#issuecomment-1854681792
2023-12-18 21:28:16 -05:00
9daa11eb10 [woodpecker] Remove PHP 7.3 PHPUnit instance
- Friendica now supports at least PHP 7.4
2023-12-18 21:27:36 -05:00
011edb711c Merge pull request 'Invidious: The addon is now user definable' (#1449) from heluecht/friendica-addons:invidious-user into 2023.09-rc
Reviewed-on: friendica/friendica-addons#1449
2023-12-18 19:33:55 +01:00
cabdd924d0 Fix white spaces 2023-12-18 17:51:34 +00:00
8ba44cf5c6 Invidious: The addon is now user definable 2023-12-18 17:47:19 +00:00
dad3d477d3 Merge pull request 'translation updates' (#1448) from tobias/friendica-addons:20231216-lng into 2023.09-rc
Reviewed-on: friendica/friendica-addons#1448
2023-12-16 15:57:57 +01:00
3a063f999d translation updates 2023-12-16 08:59:07 +01:00
fa01357445 Merge pull request 'Tumblr: Improved error handling whe fetching blog information' (#1447) from heluecht/friendica-addons:tumblr-warning into 2023.09-rc
Reviewed-on: friendica/friendica-addons#1447
2023-12-11 14:21:12 +01:00
a41a676bfb Tumblr: Improved error handling whe fetching blog information 2023-12-11 14:21:12 +01:00
3b518462ab Merge pull request 'This addon will replace "youtube.com" with the chosen Invidious instance' (#1441) from loma-one/friendica-addons:develop into 2023.09-rc
Reviewed-on: friendica/friendica-addons#1441
2023-12-08 20:50:22 +01:00
d53ad98af2 invidious/invidious.php aktualisiert 2023-12-08 20:50:22 +01:00
372e75a91c invidious/invidious.php aktualisiert 2023-12-08 20:50:22 +01:00
f45f6ba992 https://youtu.be Link
Many thanks for the hint. With a small change '/watch?v=' the link to https://youtu.be now also works
2023-12-08 20:50:22 +01:00
26983977c4 This addon will replace "youtube.com" with the chosen Invidious instance
Suggestion from @heluecht for combined URLs adopted
2023-12-08 20:50:22 +01:00
90d897f4fa This addon will replace "youtube.com" with the chosen Invidious instance
URL combine
2023-12-08 20:50:22 +01:00
668ea972cc invidious/invidious.php aktualisiert 2023-12-08 20:50:22 +01:00
dc2d00b6c6 invidious/lang/C/messages.po aktualisiert 2023-12-08 20:50:22 +01:00
0f65c23490 invidious/invidious.php aktualisiert
Redirects from youtu.be do not work reliably. Therefore this one has been removed.
2023-12-08 20:50:22 +01:00
c98caaf417 Dateien nach "invidious" hochladen 2023-12-08 20:50:22 +01:00
f46980c736 Dateien nach "invidious/lang/C" hochladen 2023-12-08 20:50:22 +01:00
ebf5ff1276 Dateien nach "invidious/templates" hochladen 2023-12-08 20:50:22 +01:00
9d932e6fa0 Dateien nach "invidious" hochladen
Replaces links to youtube.com to an invidious instance in all displays of postings on a node.
2023-12-08 20:50:22 +01:00
46fdcc1c0e invidious gelöscht 2023-12-08 20:50:22 +01:00
eadbcc069f invidious hinzugefügt 2023-12-08 20:50:22 +01:00
2c2a813324 [pageheader] Improve visibility
Removed commented out code from your pull request
2023-12-08 20:50:22 +01:00
9315b185e8 pageheader/pageheader.css aktualisiert 2023-12-08 20:50:22 +01:00
d685663ac0 Coloured box added 2023-12-08 20:50:22 +01:00
727eca1ce7 Coloured box added
Among other things, I use the page header to inform about current maintenance work or other upcoming work. The information should therefore be provided within an appropriate framework. With a little CSS, the page header gets a frame in green. The font was adjusted to an appropriate size.
2023-12-08 20:50:22 +01:00
3b5e8901dc Merge pull request 'Bluesky: remove @ and spaces from the handle' (#1444) from heluecht/friendica-addons:bluesky-trim-handle into 2023.09-rc
Reviewed-on: friendica/friendica-addons#1444
2023-12-07 13:07:42 +01:00
50d8d44489 Bluesky: remove @ and spaces from the handle 2023-12-07 12:03:53 +00:00
b6d575c37f Merge pull request 'Bluesky: Improved status on the connector page' (#1443) from heluecht/friendica-addons:bluesky-status into 2023.09-rc
Reviewed-on: friendica/friendica-addons#1443
2023-12-06 15:31:04 +01:00
397282cbb3 Bluesky: Improved on the connector page 2023-12-06 06:31:52 +00:00
2c6add7aa1 Merge pull request 'Bluesky: Fix adding a new account' (#1442) from heluecht/friendica-addons:bluesky-auth into 2023.09-rc
Reviewed-on: friendica/friendica-addons#1442
2023-12-04 21:31:59 +01:00
22bf23b833 Bluesky: Fix adding a new account 2023-12-04 20:29:31 +00:00
ed8c5945da Merge pull request 'Bluesky: Provide the correct user id while fetching content' (#1439) from heluecht/friendica-addons:bluesky-notices into 2023.09-rc
Reviewed-on: friendica/friendica-addons#1439
2023-11-25 23:06:40 +01:00
14fd900628 Store hash tags 2023-11-25 22:00:45 +00:00
48cde643f6 Improved logging message 2023-11-25 19:02:10 +00:00
e62f6a9586 Bluesky: Provide the correct user id while fetching content 2023-11-25 18:57:03 +00:00
c2dfda5d72 Merge pull request 'Bluesky: Tags are now supported' (#1438) from heluecht/friendica-addons:bluesky-tag into 2023.09-rc
Reviewed-on: friendica/friendica-addons#1438
2023-11-21 16:50:06 +01:00
9595760800 Bluesky: Tags are now supported 2023-11-20 21:07:09 +00:00
1c91ee200e Merge pull request 'Bluesky: Support personal data servers' (#1437) from heluecht/friendica-addons:bluesky-pds into 2023.09-rc
Reviewed-on: friendica/friendica-addons#1437
2023-11-20 00:48:07 +01:00
00e30b5c2b Bluesky: Support personal data servers 2023-11-19 18:55:05 +00:00
5f5c53ab49 Merge pull request '[advancedcontentfilter] Fix obsolete reference to Repository\PostMedia->splitAttachments' (#1436) from MrPetovan/friendica-addons:bug/1434-advancedcontentfilter-splitAttachments into 2023.09-rc
Reviewed-on: friendica/friendica-addons#1436
2023-11-15 20:05:31 +01:00
Benjamin Lorteau
6a46d05bca [advancedcontentfilter] Fix obsolete reference to Repository\PostMedia->splitAttachments 2023-11-14 16:25:06 -05:00
8d3d0f267b Merge pull request 'Bluesky: Support for transmitted languages' (#1435) from heluecht/friendica-addons:languages into 2023.09-rc
Reviewed-on: friendica/friendica-addons#1435
2023-11-13 01:15:45 +01:00
66fdd31915 Bluesky: Support for transmitted languages 2023-11-11 05:30:07 +00:00
607cc9238c Merge pull request 'CLD2: Use ISO-639-1 for the language detection' (#1433) from heluecht/friendica-addons:ISO-639-1 into 2023.09-rc
Reviewed-on: friendica/friendica-addons#1433
2023-11-03 19:07:04 +01:00
2a782b512e CLD2: Use ISO-639-1 for the language detection 2023-11-02 22:54:19 +00:00
a75c9ba373 Merge pull request 'Bluesky: Fix warnings' (#1432) from heluecht/friendica-addons:warnings into 2023.09-rc
Reviewed-on: friendica/friendica-addons#1432
2023-10-29 16:11:19 +01:00
77765ff6ed Bluesky: Fix warnings 2023-10-29 16:11:19 +01:00
9c53c0c8d1 Merge pull request '[smileybutton] Add explicit conversion from float to int' (#1431) from warnings into 2023.09-rc
Reviewed-on: friendica/friendica-addons#1431
2023-10-29 12:40:31 +01:00
43c46ae6d9 [smileybutton] Add explicit conversion from float to int
Address part of https://github.com/friendica/friendica/issues/13157#issuecomment-1771572442
2023-10-29 12:40:31 +01:00
c7e06bfa53 Merge pull request 'Langfilter: Use two letter code for the language / Bluesky: Remove callstack' (#1430) from heluecht/friendica-addons:callstack-language into 2023.09-rc
Reviewed-on: friendica/friendica-addons#1430
2023-10-18 22:30:52 +02:00
6948a15f1c Langfilter: Use two letter code for the language / Bluesky: Remove callstack 2023-10-18 22:30:52 +02:00
74c56c32b0 Merge pull request 'Upgrade PHP version in CI' (#1429) from nupplaPhil/friendica-addons:feat/phpunit_upgrade into 2023.09-rc
Reviewed-on: friendica/friendica-addons#1429
2023-10-13 15:21:46 +02:00
9bdaa8092e
Upgrade phpunit version in PHP-CI 2023-10-12 21:33:03 +02:00
b11538d195 Merge pull request 'CLD: Keep the original detected language array' (#1428) from heluecht/friendica-addons:cld into 2023.09-rc
Reviewed-on: friendica/friendica-addons#1428
2023-10-12 13:36:58 +02:00
73c6a0ff0c CLD: Keep the original detected language array 2023-10-11 18:57:04 +00:00
fbafa80815 Merge pull request 'CLD: New plugin for language detection via CLD2' (#1425) from heluecht/friendica-addons:cld2 into 2023.09-rc
Reviewed-on: friendica/friendica-addons#1425
2023-10-07 07:07:00 +02:00
92251f4a6c Updated CLD installation description 2023-10-07 07:07:00 +02:00
18266ea6ef Changed hook parameter / more languages added 2023-10-07 07:07:00 +02:00
80ce855189 Renamed hook 2023-10-07 07:07:00 +02:00
0eda161e04 Cleaned up code 2023-10-07 07:07:00 +02:00
981e6821d0 CLD: New plugin for language detection via CLD2 2023-10-07 07:07:00 +02:00
a5ed02ed23 Merge pull request '[CI/CD] Kick CI again' (#1427) from nupplaPhil/friendica-addons:2023.09-rc into 2023.09-rc
Reviewed-on: friendica/friendica-addons#1427
2023-10-05 22:10:33 +02:00
7a8f8fcbd2
[CI/CD] Kick CI again 2023-10-05 21:58:35 +02:00
30b9f73f5e
[CI/CD] Kick CI again 2023-10-05 21:57:17 +02:00
be8d8b9c10 Merge pull request 'Bluesky: Fix some issues when fetching posts' (#1424) from heluecht/friendica-addons:bluesky-fixes into develop
Reviewed-on: friendica/friendica-addons#1424
2023-10-03 03:54:41 +02:00
16d99dbdfc Bluesky: Fix some issues when fetching posts 2023-10-01 04:37:11 +00:00
410613d7a0 Merge pull request 'Tumblr/Bluesky: Store the subscribed feed/tag' (#1416) from heluecht/friendica-addons:subscription into develop
Reviewed-on: friendica/friendica-addons#1416
2023-08-28 16:42:36 +02:00
af31a988aa Tumblr/Bluesky: Store the subscribed feed/tag 2023-08-28 16:42:23 +02:00
187ba8383d Merge pull request '[bluesky] Fix double dollar sign in bluesky_fetch_notifications' (#1415) from MrPetovan/friendica-addons:bug/warnings into develop
Reviewed-on: friendica/friendica-addons#1415
2023-08-28 06:51:12 +02:00
c89abdb74c [bluesky] Fix double dollar sign in bluesky_fetch_notifications 2023-08-22 09:01:12 -04:00
b76f143e60 Merge pull request 'Audon audioplayer App' (#1414) from loma-one/friendica-addons:develop into develop
Reviewed-on: friendica/friendica-addons#1414
2023-08-18 18:41:32 +02:00
94a4c93368 audon/lang/C/messages.po aktualisiert 2023-08-18 18:41:32 +02:00
dfbf8d4acf audon/lang/C/messages.po hinzugefügt 2023-08-18 18:41:32 +02:00
983d334ef5 audon/C/messages.po gelöscht 2023-08-18 18:41:32 +02:00
2fa030aa65 audon/C/messages.po aktualisiert 2023-08-18 18:41:32 +02:00
7ef59da623 audon/C/messages.po hinzugefügt 2023-08-18 18:41:32 +02:00
476fdd1bb7 audon/lang/C gelöscht
Signed-off-by: loma-one <loma-one@noreply.git.friendi.ca>
2023-08-18 18:41:32 +02:00
9786b605b6 audon/lang/C aktualisiert
now :)
2023-08-18 18:41:32 +02:00
a26c2c9758 audon/lang/C aktualisiert 2023-08-18 18:41:32 +02:00
8ef6fafdaa audon/audon.php aktualisiert 2023-08-18 18:41:32 +02:00
c93e6840fa audon/audon.php aktualisiert 2023-08-18 18:41:32 +02:00
65d8e467fe audon/templates/admin.tpl aktualisiert 2023-08-18 18:41:32 +02:00
38460a4cff audon/audon.php aktualisiert 2023-08-18 18:41:32 +02:00
db218ac4f6 audon/audon.php aktualisiert 2023-08-18 18:41:32 +02:00
e391a65695 „audon/audon.php“ ändern 2023-08-18 18:41:32 +02:00
a3dc032a51 „audon/lang/C“ hinzufügen 2023-08-18 18:41:32 +02:00
9035144e5b Dateien hochladen nach „audon/templates“ 2023-08-18 18:41:32 +02:00
4e17f3c9db „audon/admin.tpl“ löschen 2023-08-18 18:41:32 +02:00
630f4ab991 „audon/messages.po“ löschen 2023-08-18 18:41:32 +02:00
effa19c467 Audon Audio Chat based on the WebRTC Addon
This Addon based on webrtc. Audon is a service of realtime audio chat.
With small changes, the WebRTC addon could be adapted to Audon so that it can be loaded into an iframe. In the ifram, the Friendica handle can be connected and a room opened. Audio conversations between Friendica users are possible.
https://github.com/friendica/friendica-addons/pull/1357
2023-08-18 18:41:32 +02:00
6d200dd419 Merge pull request 'Twitter: Fix posting' (#1413) from heluecht/friendica-addons:resize into develop
Reviewed-on: friendica/friendica-addons#1413
2023-08-16 20:58:34 +02:00
340f3f41d7 Twitter: Fix posting 2023-08-16 14:58:04 -04:00
886638f8a5 Merge pull request 'Simplified status display' (#1412) from heluecht/friendica-addons:resize into develop
Reviewed-on: friendica/friendica-addons#1412
2023-08-16 12:27:28 +02:00
339c88353b Test the connection when API credential changed 2023-08-16 12:27:28 +02:00
a3e24a55ec Last status is split for better readability 2023-08-16 12:27:28 +02:00
3d6748eaf7 Simplified status display 2023-08-16 12:27:28 +02:00
fb9e6e5df6 Merge pull request 'Nluesky/Twitter: Resize picture before uploading' (#1411) from heluecht/friendica-addons:resize into develop
Reviewed-on: friendica/friendica-addons#1411
2023-08-15 22:38:49 +02:00
8b66b3a194 Nluesky/Twitter: Resize picture before uploading 2023-08-15 20:25:17 +00:00
f39b25b437 Merge pull request 'Twitter: the connector now works as a posting only connector' (#1410) from heluecht/friendica-addons:twitter into develop
Reviewed-on: friendica/friendica-addons#1410
2023-08-10 23:51:37 +02:00
15ea39d830 Reformatted code 2023-08-10 21:36:09 +00:00
21006aec74 Resize picture before uploading 2023-08-10 21:26:10 +00:00
603c8defb1 Avoid upload problems by reducing the picture size 2023-08-10 06:46:17 +00:00
e004e20352 Transmit the media type 2023-08-09 23:13:37 +00:00
c0eac366fe Fix newlines 2023-08-09 20:08:32 +00:00
34f0fa7dc8 License readded 2023-08-09 20:07:29 +00:00
a97b3f690c Twitter: the connector now works as a posting only connector 2023-08-09 20:01:57 +00:00
5d13889f2c Merge pull request '[CI] Add .phpunit' (#1408) from nupplaPhil/friendica-addons:feat/strategies into develop
Reviewed-on: friendica/friendica-addons#1408
2023-07-28 19:51:39 +02:00
dc55b89e02
Unify "Capability" 2023-07-26 21:44:57 +02:00
d76b6b50c3
Introduce .phpunit 2023-07-26 19:19:07 +02:00
546841e3a2 Merge pull request '[monolog] Fix extra line' (#1407) from nupplaPhil/friendica-addons:bug/monolog into develop
Reviewed-on: friendica/friendica-addons#1407
2023-07-23 23:06:52 +02:00
bd405ec98a
[monolog] Fix extra line 2023-07-23 23:04:53 +02:00
923437e8b6 Merge pull request '[monolog] update/fix Monolog' (#1400) from nupplaPhil/friendica-addons:feat/addons into develop
Reviewed-on: friendica/friendica-addons#1400
2023-07-23 13:00:31 +02:00
d9c5419351 Adhere feedback
- rename hooks.config.php to strategies.config.php
- change all corresponding classes and tests
2023-07-23 13:00:31 +02:00
e315abc788 Add tests for InstanceManager and remove Decorator hook logic (avoid complex Dice logic) 2023-07-23 13:00:31 +02:00
745f9c1e5f Fix Monolog
- Use new hook-loading
2023-07-23 13:00:31 +02:00
f328dc2b83 Merge pull request 'Bluesky: Fix "E_WARNING: Undefined property: stdClass::$cid"' (#1405) from heluecht/friendica-addons:bluesky-warning into develop
Reviewed-on: friendica/friendica-addons#1405
2023-07-22 19:04:34 +02:00
3377ef3ba3 Bluesky: Fix "E_WARNING: Undefined property: stdClass::$cid" 2023-07-22 13:38:13 +00:00
5d666fbd1e Merge pull request 'Use "convertForUriId" whenever possible' (#1404) from heluecht/friendica-addons:more-privacy into develop
Reviewed-on: friendica/friendica-addons#1404
2023-07-17 14:05:14 +02:00
f4110880a1 Use "convertForUriId" whenever possible 2023-07-16 10:37:33 +00:00
a52fa4dfb0 Merge pull request 'Bluesky: Fix for quoted posts with media' (#1403) from heluecht/friendica-addons:bluesky-quote into develop
Reviewed-on: friendica/friendica-addons#1403
2023-07-09 15:49:48 +02:00
cf435277a7 Bluesky: Fix for quoted posts with media 2023-07-09 15:49:48 +02:00
61a5973937 Merge pull request 'Bluesky: don't remove hashtags upon posting' (#1402) from heluecht/friendica-addons:bluesky-tags into develop
Reviewed-on: friendica/friendica-addons#1402
2023-07-08 17:02:45 +02:00
d80d376762 Bluesky: don't remove hashtags upon posting 2023-07-08 14:54:56 +00:00
463f5eb7e0 Merge pull request '[showmoredyn] fix: tweak z-index to not clash with sidebar on mobile' (#1401) from csolisr/friendica-addons:fix-showmore-dyn-css into develop
Reviewed-on: friendica/friendica-addons#1401
2023-07-07 17:08:50 +02:00
e91fa307d0 fix: tweak z-index to not clash with sidebar on mobile
By default, the z-index of the toggle button is above the z-index of the sidebar on mobile devices. This fix tweaks the z-index so that it remains below the sidebar while it's open.
2023-07-07 17:02:44 +02:00
aa0d829de6 Merge pull request 'Bluesky: Tasks are now done by workers' (#1399) from heluecht/friendica-addons:bluesky-worker into develop
Reviewed-on: friendica/friendica-addons#1399
2023-06-19 00:29:53 +02:00
7795a53cb3 New functions to perform XRPC post/get commands 2023-06-13 20:43:51 +00:00
c85b559f69 Remove unicode character 2023-06-12 22:06:31 +00:00
9f0857af1d Bluesky: Tasks are now done by workers 2023-06-11 19:24:44 +00:00
ba1af2b73e Merge pull request 'Bluesky: Improved link transmission /thread import' (#1398) from heluecht/friendica-addons:bluesky-links into develop
Reviewed-on: friendica/friendica-addons#1398
2023-06-07 00:47:37 +02:00
e67097e0e8 Bluesky: Improved link transmission /thread import 2023-06-07 00:47:37 +02:00
2183bace8a Merge pull request '[bluesky] added DE, ZH-CN translation' (#1397) from tobias/friendica-addons:20230605-lng into develop
Reviewed-on: friendica/friendica-addons#1397
2023-06-05 18:58:05 +02:00
c740573b99 [bluesky] added DE, ZH-CN translation 2023-06-05 18:58:05 +02:00
db4546c190 Merge pull request 'Bluesky: Pinned feeds can now be imported' (#1396) from heluecht/friendica-addons:bluesky-feeds into develop
Reviewed-on: friendica/friendica-addons#1396
2023-06-05 07:08:19 +02:00
2a4bfae9b3 Bluesky: Pinned feeds can now be imported 2023-06-05 04:36:50 +00:00
aa9f0c2281 Merge pull request 'Bluesky: Import is mosty feature complete' (#1395) from heluecht/friendica-addons:bluesky into develop
Reviewed-on: friendica/friendica-addons#1395
2023-06-04 02:56:58 +02:00
5d614bc6d3 Bluesky: Import is mosty feature complete 2023-06-03 23:06:31 +00:00
9557b5e000 Merge pull request 'Rename group and forum' (#1394) from MrPetovan/friendica-addons:task/13114-rename-group-forum into develop
Reviewed-on: friendica/friendica-addons#1394
2023-06-04 00:20:07 +02:00
49d308c44b [various] Rename forum to group
- Drop support for forumdirectory
- Add support for groupdirectory
2023-06-04 00:20:07 +02:00
aa0f74832a [various] Rename group to circle
- Drop support for group_text
- Add support for circle_text
2023-06-04 00:20:07 +02:00
941b8c5a14 Merge pull request '[nsfw] Rewrite string condition to avoid warning message' (#1393) from MrPetovan/friendica-addons:bug/warnings into develop
Reviewed-on: friendica/friendica-addons#1393
2023-05-30 07:20:35 +02:00
9bfb5e879d [nsfw] Rewrite string condition to avoid warning message
- Address https://github.com/friendica/friendica/issues/13157#issuecomment-1567337197
2023-05-29 19:34:01 -04:00
54f4a054c7 Merge pull request 'catch exception during http request' (#1392) from mexon/friendica-addons:mat/mailstream-exception into develop
Reviewed-on: friendica/friendica-addons#1392
2023-05-28 16:46:42 +02:00
Matthew Exon
9832fa6c45 catch exception during http request 2023-05-28 11:02:32 +02:00
2ce14fb2ff Merge pull request 'Deprecated Addon Blockem removed' (#1391) from andy/friendica-addons:develop into develop
Reviewed-on: friendica/friendica-addons#1391
2023-05-27 14:37:04 +02:00
82c2f8e37f Deprecated Addon Blockem removed 2023-05-27 10:18:51 +07:00
5c45c05cdb Merge pull request 'Bluesky: Improved import and export' (#1390) from heluecht/friendica-addons:bluesky-import2 into develop
Reviewed-on: friendica/friendica-addons#1390
2023-05-26 23:13:31 +02:00
c45c163471 Bluesly: Improved import and export 2023-05-26 20:54:00 +00:00
cd7cec1de2 Merge pull request 'Bluesky: readme is updated' (#1389) from heluecht/friendica-addons:bluesky-import into develop
Reviewed-on: friendica/friendica-addons#1389
2023-05-24 13:16:29 +02:00
d8fe3bd119 Merge remote-tracking branch 'upstream/develop' into bluesky-import 2023-05-24 06:11:09 +00:00
e19fafa918 Updated readme 2023-05-24 06:09:25 +00:00
421964b406 Merge pull request 'Bluesky: Import of remote timeline' (#1388) from heluecht/friendica-addons:bluesky-import into develop
Reviewed-on: friendica/friendica-addons#1388
2023-05-24 08:00:33 +02:00
6ade40efae Merge remote-tracking branch 'upstream/develop' into bluesky-import 2023-05-24 06:00:04 +00:00
435a993502 Bluesky: updated messages.po 2023-05-24 05:53:12 +00:00
16a5a895bb Bluesky import and transmission of activities is now possible 2023-05-24 05:49:26 +00:00
f2cc0312ca Merge pull request 'Bluesky: readme is added' (#1387) from heluecht/friendica-addons:bluesky-readme into 2023.05-rc
Reviewed-on: friendica/friendica-addons#1387
2023-05-23 13:26:08 +02:00
e3ca7c73ce Merge pull request 'HU translation updates THX Balázs Úr' (#1386) from tobias/friendica-addons:20230523-hu into 2023.05-rc
Reviewed-on: friendica/friendica-addons#1386
2023-05-23 07:47:43 +02:00
654a9da297 Bluesky: readme is added 2023-05-23 05:45:18 +00:00
1fe81df15d Bluesky: Import of remote timeline 2023-05-23 05:23:13 +00:00
7a1af5fb5b HU translation updates 2023-05-23 06:46:36 +02:00
a4b91826ba Merge pull request 'Bluesky: Basic connector for Bluesky is added' (#1385) from heluecht/friendica-addons:bluesky into 2023.05-rc
Reviewed-on: friendica/friendica-addons#1385
2023-05-22 02:59:36 +02:00
a7ea815642 Post up to 4 images 2023-05-21 20:14:20 +00:00
ea6e79448d Simplify token creation 2023-05-21 19:25:57 +00:00
77813a2acd Make the host readonly 2023-05-21 18:58:05 +00:00
dff48c3295 Bluesky: Basic connector for Bluesky is added 2023-05-21 18:54:02 +00:00
e91962b0b6 Merge pull request '[various] Ensure probe_detect hook functions don't set the result key with an empty array' (#1382) from MrPetovan/friendica-addons:bug/13080-probe_detect-result into develop
Reviewed-on: friendica/friendica-addons#1382
2023-05-06 12:24:07 +02:00
e0778d2bdd Merge pull request 'use new style of accessing baseUrl' (#1384) from mexon/friendica-addons:mailstream-fix-3 into develop
Reviewed-on: friendica/friendica-addons#1384
2023-05-05 18:46:25 +02:00
Matthew Exon
631bfd83e9 use new style of accessing baseUrl 2023-05-05 18:08:51 +02:00
4b31588484 Merge pull request 'remove App arguments' (#1383) from mexon/friendica-addons:mailstream-fix-2 into develop
Reviewed-on: friendica/friendica-addons#1383
2023-05-05 17:40:52 +02:00
Matthew Exon
8886c90d1e remove App arguments 2023-05-05 17:36:11 +02:00
f5d8604e59 [twitter] Return null in the probe_detect hook result key on unsuccessful probe
- Add authoritative probe result setting
2023-05-05 00:08:17 -04:00
a0574ab045 [tumblr] Have tumblr_get_contact_by_url return null for unsuccessful probe
- Add result setting for unsuccessful authoritative probe
2023-05-05 00:07:24 -04:00
e1de842ffb Merge pull request '[piwik] updated DE translation' (#1381) from tobias/friendica-addons:20230501-de into develop
Reviewed-on: friendica/friendica-addons#1381
2023-05-01 16:42:03 +02:00
ca134e9ed3 [piwik] updated DE translation 2023-05-01 10:05:20 +02:00
1a2554fe95 Merge pull request '[piwiki] regenerated messages-po file' (#1380) from 20230501-piwik into develop
Reviewed-on: friendica/friendica-addons#1380
2023-05-01 07:42:53 +02:00
13da605435 [piwiki] regenerated messages-po file 2023-05-01 07:40:12 +02:00
df2e9863ed Merge pull request '[piwik] Short Endpoint option' (#1379) from EntropyEngineer/friendica-addons:piwik-Short-Endpoint-option into develop
Reviewed-on: friendica/friendica-addons#1379
2023-04-30 13:43:35 +02:00
199205a07c [piwik] Short Endpoint option 2023-04-30 10:34:28 +02:00
94eb2ec197 Merge pull request 'Tumblr: Users can now follow tags' (#1378) from heluecht/friendica-addons:tumblr-tags into develop
Reviewed-on: friendica/friendica-addons#1378
2023-04-29 21:23:58 +02:00
58fce248c1 Use ?? instead of the parameter for the default value 2023-04-29 19:16:51 +00:00
dcd097b5b0 Tumblr: Users can now follow tags 2023-04-29 06:56:51 +00:00
040c735243 Merge pull request 'Repair broken log line' (#1377) from mexon/friendica-addons:mailstream-fix into develop
Reviewed-on: friendica/friendica-addons#1377
2023-04-28 23:14:58 +02:00
Matthew Exon
4eedc9423a Repair broken log line 2023-04-28 23:09:40 +02:00
675 changed files with 12861 additions and 34732 deletions

113
.woodpecker/.phpunit.yml Normal file
View file

@ -0,0 +1,113 @@
matrix:
include:
- PHP_MAJOR_VERSION: 7.4
PHP_VERSION: 7.4.33
- PHP_MAJOR_VERSION: 8.0
PHP_VERSION: 8.0.30
- PHP_MAJOR_VERSION: 8.1
PHP_VERSION: 8.1.23
- PHP_MAJOR_VERSION: 8.2
PHP_VERSION: 8.2.11
# This forces PHP Unit executions at the "opensocial" labeled location (because of much more power...)
labels:
location: opensocial
skip_clone: true
pipeline:
clone_friendica_base:
image: alpine/git
commands:
- git clone https://github.com/friendica/friendica.git .
- git checkout $CI_COMMIT_BRANCH
clone_friendica_addon:
image: alpine/git
commands:
- git config --global user.email "no-reply@friendi.ca"
- git config --global user.name "Friendica"
- git clone $CI_REPO_LINK addon
- cd addon/
- git checkout $CI_COMMIT_BRANCH
- git fetch origin $CI_COMMIT_REF
- git merge $CI_COMMIT_SHA
restore_cache:
image: meltwater/drone-cache:dev
settings:
backend: "filesystem"
restore: true
cache_key: "{{ .Repo.Name }}_php${PHP_MAJOR_VERSION}_{{ arch }}_{{ os }}"
archive_format: "gzip"
mount:
- '.composer'
volumes:
- /tmp/drone-cache:/tmp/cache
composer_install:
image: friendicaci/php${PHP_MAJOR_VERSION}:php${PHP_VERSION}
commands:
- export COMPOSER_HOME=.composer
- ./bin/composer.phar validate
- ./bin/composer.phar install --prefer-dist
volumes:
- /etc/hosts:/etc/hosts
rebuild_cache:
image: meltwater/drone-cache:dev
settings:
backend: "filesystem"
rebuild: true
cache_key: "{{ .Repo.Name }}_php${PHP_MAJOR_VERSION}_{{ arch }}_{{ os }}"
archive_format: "gzip"
mount:
- '.composer'
volumes:
- /tmp/drone-cache:/tmp/cache
test:
image: friendicaci/php${PHP_MAJOR_VERSION}:php${PHP_VERSION}
environment:
MYSQL_HOST: "mariadb"
MYSQL_PORT: "3306"
MYSQL_DATABASE: "test"
MYSQL_PASSWORD: "test"
MYSQL_USER: "test"
REDIS_HOST: "redis"
MEMCACHED_HOST: "memcached"
MEMCACHE_HOST: "memcached"
commands:
- cp config/local-sample.config.php config/local.config.php
- if ! bin/wait-for-connection $MYSQL_HOST $MYSQL_PORT 300; then echo "[ERROR] Waited 300 seconds, no response" >&2; exit 1; fi
- mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
- if [ "${PHP_MAJOR_VERSION}" = "7.4" -a "${CI_REPO}" = "friendica/friendica-addons" ]; then
phpenmod xdebug;
export XDEBUG_MODE=coverage;
phpunit --configuration tests/phpunit-addons.xml --coverage-clover clover.xml;
else
phpunit --configuration tests/phpunit-addons.xml;
fi
codecov:
image: friendicaci/codecov
when:
matrix:
PHP_MAJOR_VERSION: 7.4
PHP_VERSION: 7.4.33
repo:
- friendica/friendica-addons
commands:
- codecov -R '.' -Z -f 'clover.xml'
secrets:
- source: codecov-token
target: codecov_token
services:
mariadb:
image: mariadb:latest
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
MYSQL_DATABASE: "test"
MYSQL_PASSWORD: "test"
MYSQL_USER: "test"
memcached:
image: memcached
redis:
image: redis

View file

@ -455,7 +455,7 @@ function advancedcontentfilter_prepare_item_row(array $item_row): array
$item_row['tags'] = $tags['tags'];
$item_row['hashtags'] = $tags['hashtags'];
$item_row['mentions'] = $tags['mentions'];
$item_row['attachments'] = Post\Media::splitAttachments($item_row['uri-id']);
$item_row['attachments'] = DI::postMediaRepository()->splitAttachments($item_row['uri-id']);
return $item_row;
}

6
audon/README.md Normal file
View file

@ -0,0 +1,6 @@
Audon Addon
=============
This is a quick and dirty addon to add a [Audon][1] website as an app. This Addon based on webrtc. Audon is a service of realtime audio chat
[1]: https://codeberg.org/nmkj/audon

69
audon/audon.php Normal file
View file

@ -0,0 +1,69 @@
<?php
/*
* Name: Audon Application
* Description: add a Audon instance. Based on webRTC Addon
* Version: 0.1
* Author: Stephen Mahood <https://friends.mayfirst.org/profile/marxistvegan>
* Author: Tobias Diekershoff <https://f.diekershoff.de/profile/tobias>
* Author: Matthias Ebers <https://loma.ml/profile/feb>
*/
use Friendica\Core\Hook;
use Friendica\Core\Renderer;
use Friendica\DI;
function audon_install()
{
Hook::register('app_menu', __FILE__, 'audon_app_menu');
}
function audon_app_menu(array &$b)
{
$b['app_menu'][] = '<div class="app-title"><a href="audon">' . DI::l10n()->t('Audon Audiochat') . '</a></div>';
}
function audon_addon_admin(string &$o)
{
$t = Renderer::getMarkupTemplate('admin.tpl', 'addon/audon/');
$o = Renderer::replaceMacros($t, [
'$submit' => DI::l10n()->t('Save Settings'),
'$audonurl' => [
'audonurl',
DI::l10n()->t('Audon Base URL'),
DI::config()->get('audon','audonurl'),
DI::l10n()->t('Page your users will create an Audon audio chat room on. For example you could use https://audon.space.'),
],
]);
}
function audon_addon_admin_post()
{
DI::config()->set('audon', 'audonurl', trim($_POST['audonurl'] ?? ''));
}
/**
* This is a statement rather than an actual function definition. The simple
* existence of this method is checked to figure out if the addon offers a
* module.
*/
function audon_module() {}
function audon_content(): string
{
$o = '';
/* landingpage to create chatrooms */
$audonurl = DI::config()->get('audon', 'audonurl');
/* embedd the landing page in an iframe */
$o .= '<h2>' . DI::l10n()->t('Audio Chat') . '</h2>';
$o .= '<p>' . DI::l10n()->t('Audon is an audio conferencing tool. Connect your account to Audon and create a room. Share the generated link to talk to other participants.') . '</p>';
if ($audonurl == '') {
$o .= '<p>' . DI::l10n()->t('Please contact your Friendica administrator to remind them to configure the Audon addon.') . '</p>';
} else {
$o .= '<iframe src="' . $audonurl . '" width="740px" height="600px"></iframe>';
}
return $o;
}

52
audon/lang/C/messages.po Normal file
View file

@ -0,0 +1,52 @@
# ADDON audon
# Copyright (C)
# This file is distributed under the same license as the Friendica audon addon package.
#
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-18 18:23+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: audon.php:22
msgid "Audon Audiochat"
msgstr ""
#: audon.php:29
msgid "Save Settings"
msgstr ""
#: audon.php:32
msgid "Audon Base URL"
msgstr ""
#: audon.php:34
msgid ""
"Page your users will create an Audon audio chat room on. For example you "
"could use https://audon.space."
msgstr ""
#: audon.php:60
msgid "Audio Chat"
msgstr ""
#: audon.php:61
msgid ""
"Audon is an audio conferencing tool. Connect your account to Audon and "
"create a room. Share the generated link to talk to other participants."
msgstr ""
#: audon.php:63
msgid ""
"Please contact your Friendica administrator to remind them to configure the "
"Audon addon."
msgstr ""

View file

@ -0,0 +1,2 @@
{{include file="field_input.tpl" field=$audonurl}}
<button type="submit">{{$submit}}</button>

View file

@ -1,230 +0,0 @@
<?php
/**
* Name: blockem
* Description: Allows users to hide content by collapsing posts and replies.
* Version: 1.0
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
* Author: Roland Haeder <https://f.haeder.net/roland>
* Status: unsupported
*/
use Friendica\App;
use Friendica\Core\Hook;
use Friendica\Core\Renderer;
use Friendica\DI;
use Friendica\Util\Strings;
global $blockem_words;
function blockem_install()
{
Hook::register('prepare_body_content_filter', 'addon/blockem/blockem.php', 'blockem_prepare_body_content_filter');
Hook::register('display_item' , 'addon/blockem/blockem.php', 'blockem_display_item');
Hook::register('addon_settings' , 'addon/blockem/blockem.php', 'blockem_addon_settings');
Hook::register('addon_settings_post' , 'addon/blockem/blockem.php', 'blockem_addon_settings_post');
Hook::register('conversation_start' , 'addon/blockem/blockem.php', 'blockem_conversation_start');
Hook::register('item_photo_menu' , 'addon/blockem/blockem.php', 'blockem_item_photo_menu');
Hook::register('enotify_store' , 'addon/blockem/blockem.php', 'blockem_enotify_store');
}
function blockem_addon_settings(array &$data)
{
if (!DI::userSession()->getLocalUserId()) {
return;
}
$words = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'blockem', 'words', '');
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/blockem/');
$html = Renderer::replaceMacros($t, [
'$info' => DI::l10n()->t("Hides user's content by collapsing posts. Also replaces their avatar with generic image."),
'$words' => ['blockem-words', DI::l10n()->t('Comma separated profile URLS:'), $words],
]);
$data = [
'addon' => 'blockem',
'title' => DI::l10n()->t('Blockem'),
'html' => $html,
];
}
function blockem_addon_settings_post(array &$b)
{
if (!DI::userSession()->getLocalUserId()) {
return;
}
if (!empty($_POST['blockem-submit'])) {
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'blockem', 'words', trim($_POST['blockem-words']));
}
}
function blockem_enotify_store(array &$b)
{
$words = DI::pConfig()->get($b['uid'], 'blockem', 'words');
if ($words) {
$arr = explode(',', $words);
} else {
return;
}
$found = false;
if (count($arr)) {
foreach ($arr as $word) {
if (!strlen(trim($word))) {
continue;
}
if (Strings::compareLink($b['url'], $word)) {
$found = true;
break;
}
}
}
if ($found) {
// empty out the fields
$b = [];
}
}
function blockem_prepare_body_content_filter(array &$hook_data)
{
if (!DI::userSession()->getLocalUserId()) {
return;
}
$profiles_string = null;
if (DI::userSession()->getLocalUserId()) {
$profiles_string = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'blockem', 'words');
}
if ($profiles_string) {
$profiles_array = explode(',', $profiles_string);
} else {
return;
}
$found = false;
foreach ($profiles_array as $word) {
if (Strings::compareLink($hook_data['item']['author-link'], trim($word))) {
$found = true;
break;
}
}
if ($found) {
$hook_data['filter_reasons'][] = DI::l10n()->t('Filtered user: %s', $hook_data['item']['author-name']);
}
}
function blockem_display_item(array &$b = null)
{
if (!empty($b['output']['body']) && strstr($b['output']['body'], 'id="blockem-wrap-')) {
$b['output']['thumb'] = DI::baseUrl() . "/images/person-80.jpg";
}
}
function blockem_conversation_start(array &$b)
{
global $blockem_words;
if (!DI::userSession()->getLocalUserId()) {
return;
}
$words = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'blockem', 'words');
if ($words) {
$blockem_words = explode(',', $words);
}
DI::page()['htmlhead'] .= <<< EOT
<script>
function blockemBlock(author) {
$.get('blockem?block=' +author, function(data) {
location.reload(true);
});
}
function blockemUnblock(author) {
$.get('blockem?unblock=' +author, function(data) {
location.reload(true);
});
}
</script>
EOT;
}
function blockem_item_photo_menu(array &$b)
{
global $blockem_words;
if (!DI::userSession()->getLocalUserId() || $b['item']['self']) {
return;
}
$blocked = false;
$author = $b['item']['author-link'];
if (!empty($blockem_words)) {
foreach($blockem_words as $bloke) {
if (Strings::compareLink($bloke,$author)) {
$blocked = true;
break;
}
}
}
if ($blocked) {
$b['menu'][DI::l10n()->t('Unblock Author')] = 'javascript:blockemUnblock(\'' . $author . '\');';
} else {
$b['menu'][DI::l10n()->t('Block Author')] = 'javascript:blockemBlock(\'' . $author . '\');';
}
}
/**
* This is a statement rather than an actual function definition. The simple
* existence of this method is checked to figure out if the addon offers a
* module.
*/
function blockem_module() {}
function blockem_init()
{
if (!DI::userSession()->getLocalUserId()) {
return;
}
$words = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'blockem', 'words');
if (array_key_exists('block', $_GET) && $_GET['block']) {
if (strlen($words)) {
$words .= ',';
}
$words .= trim($_GET['block']);
}
if (array_key_exists('unblock', $_GET) && $_GET['unblock']) {
$arr = explode(',',$words);
$newarr = [];
if (count($arr)) {
foreach ($arr as $x) {
if (!Strings::compareLink(trim($x), trim($_GET['unblock']))) {
$newarr[] = $x;
}
}
}
$words = implode(',', $newarr);
}
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'blockem', 'words', $words);
exit();
}

View file

@ -1,45 +0,0 @@
# ADDON blockem
# Copyright (C)
# This file is distributed under the same license as the Friendica blockem addon package.
#
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-11-21 19:13-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: blockem.php:39
msgid ""
"Hides user's content by collapsing posts. Also replaces their avatar with "
"generic image."
msgstr ""
#: blockem.php:40
msgid "Comma separated profile URLS:"
msgstr ""
#: blockem.php:45
msgid "Blockem"
msgstr ""
#: blockem.php:120
#, php-format
msgid "Filtered user: %s"
msgstr ""
#: blockem.php:183
msgid "Unblock Author"
msgstr ""
#: blockem.php:185
msgid "Block Author"
msgstr ""

View file

@ -1,52 +0,0 @@
# ADDON blockem
# Copyright (C)
# This file is distributed under the same license as the Friendica blockem addon package.
#
#
# Translators:
# abidin toumi <abidin24@tutanota.com>, 2021
# Farida Khalaf <faridakhalaf@hotmail.com>, 2021
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-01 18:15+0100\n"
"PO-Revision-Date: 2021-10-29 08:15+0000\n"
"Last-Translator: abidin toumi <abidin24@tutanota.com>\n"
"Language-Team: Arabic (http://www.transifex.com/Friendica/friendica/language/ar/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ar\n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"
#: blockem.php:42 blockem.php:46
msgid "Blockem"
msgstr "احجبه<br>"
#: blockem.php:50
msgid ""
"Hides user's content by collapsing posts. Also replaces their avatar with "
"generic image."
msgstr "إخفاء محتوى المستخدم عن طريق تصغير المشاركات. و استبدال الصورة الرمزية الخاصة بهم بصورة عامة."
#: blockem.php:51
msgid "Comma separated profile URLS:"
msgstr "عناوين الملفات الشخصية مفصولة بفواصل:"
#: blockem.php:55
msgid "Save Settings"
msgstr "احفظ الإعدادات"
#: blockem.php:131
#, php-format
msgid "Filtered user: %s"
msgstr "ترشيح المستخدم :1%s"
#: blockem.php:190
msgid "Unblock Author"
msgstr "ألغ الحجب عن المدون"
#: blockem.php:192
msgid "Block Author"
msgstr "احجب المدون"

View file

@ -1,14 +0,0 @@
<?php
if(! function_exists("string_plural_select_ar")) {
function string_plural_select_ar($n){
$n = intval($n);
if ($n==0) { return 0; } else if ($n==1) { return 1; } else if ($n==2) { return 2; } else if ($n%100>=3 && $n%100<=10) { return 3; } else if ($n%100>=11 && $n%100<=99) { return 4; } else { return 5; }
}}
$a->strings['Blockem'] = 'احجبه<br>';
$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'إخفاء محتوى المستخدم عن طريق تصغير المشاركات. و استبدال الصورة الرمزية الخاصة بهم بصورة عامة.';
$a->strings['Comma separated profile URLS:'] = 'عناوين الملفات الشخصية مفصولة بفواصل:';
$a->strings['Save Settings'] = 'احفظ الإعدادات';
$a->strings['Filtered user: %s'] = 'ترشيح المستخدم :1%s';
$a->strings['Unblock Author'] = 'ألغ الحجب عن المدون';
$a->strings['Block Author'] = 'احجب المدون';

View file

@ -1,59 +0,0 @@
# ADDON blockem
# Copyright (C)
# This file is distributed under the same license as the Friendica blockem addon package.
#
#
# Translators:
# Joan Bar <friendica@tutanota.com>, 2019
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-08-17 10:23+0200\n"
"PO-Revision-Date: 2019-10-14 11:50+0000\n"
"Last-Translator: Joan Bar <friendica@tutanota.com>\n"
"Language-Team: Catalan (http://www.transifex.com/Friendica/friendica/language/ca/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ca\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: blockem.php:54 blockem.php:58
msgid "Blockem"
msgstr "Blockem"
#: blockem.php:62
msgid ""
"Hides user's content by collapsing posts. Also replaces their avatar with "
"generic image."
msgstr "Amaga el contingut de l'usuari mitjançant la publicació col·lapsada. També substitueix el seu avatar per una imatge genèrica"
#: blockem.php:63
msgid "Comma separated profile URLS:"
msgstr "URL de perfil separats per comes:"
#: blockem.php:67
msgid "Save Settings"
msgstr "Desa la configuració"
#: blockem.php:81
msgid "BLOCKEM Settings saved."
msgstr "S'ha desat la configuració de BLOCKEM."
#: blockem.php:143
#, php-format
msgid "Filtered user: %s"
msgstr "Usuari filtrat:%s"
#: blockem.php:202
msgid "Unblock Author"
msgstr "Desbloca l'autor"
#: blockem.php:204
msgid "Block Author"
msgstr "Autor de bloc"
#: blockem.php:244
msgid "blockem settings updated"
msgstr "S'ha actualitzat la configuració de blockem"

View file

@ -1,16 +0,0 @@
<?php
if(! function_exists("string_plural_select_ca")) {
function string_plural_select_ca($n){
$n = intval($n);
return intval($n != 1);
}}
$a->strings['Blockem'] = 'Blockem';
$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Amaga el contingut de l\'usuari mitjançant la publicació col·lapsada. També substitueix el seu avatar per una imatge genèrica';
$a->strings['Comma separated profile URLS:'] = 'URL de perfil separats per comes:';
$a->strings['Save Settings'] = 'Desa la configuració';
$a->strings['BLOCKEM Settings saved.'] = 'S\'ha desat la configuració de BLOCKEM.';
$a->strings['Filtered user: %s'] = 'Usuari filtrat:%s';
$a->strings['Unblock Author'] = 'Desbloca l\'autor';
$a->strings['Block Author'] = 'Autor de bloc';
$a->strings['blockem settings updated'] = 'S\'ha actualitzat la configuració de blockem';

View file

@ -1,60 +0,0 @@
# ADDON blockem
# Copyright (C)
# This file is distributed under the same license as the Friendica blockem addon package.
#
#
# Translators:
# Aditoo, 2018
# michal_s <msupler@gmail.com>, 2014
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-08-17 10:23+0200\n"
"PO-Revision-Date: 2018-08-18 12:25+0000\n"
"Last-Translator: Aditoo\n"
"Language-Team: Czech (http://www.transifex.com/Friendica/friendica/language/cs/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: cs\n"
"Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;\n"
#: blockem.php:54 blockem.php:58
msgid "Blockem"
msgstr "Blockem"
#: blockem.php:62
msgid ""
"Hides user's content by collapsing posts. Also replaces their avatar with "
"generic image."
msgstr "Skrývá uživatelský obsah zabalením příspěvků. Navíc nahrazuje avatar generickým obrázkem."
#: blockem.php:63
msgid "Comma separated profile URLS:"
msgstr "URL adresy profilů, oddělené čárkami:"
#: blockem.php:67
msgid "Save Settings"
msgstr "Uložit nastavení"
#: blockem.php:81
msgid "BLOCKEM Settings saved."
msgstr "Nastavení BLOCKEM uložena."
#: blockem.php:143
#, php-format
msgid "Filtered user: %s"
msgstr "Filtrovaný uživatel: %s"
#: blockem.php:202
msgid "Unblock Author"
msgstr "Odblokovat autora"
#: blockem.php:204
msgid "Block Author"
msgstr "Zablokovat autora"
#: blockem.php:244
msgid "blockem settings updated"
msgstr "nastavení blockem aktualizována"

View file

@ -1,16 +0,0 @@
<?php
if(! function_exists("string_plural_select_cs")) {
function string_plural_select_cs($n){
$n = intval($n);
if (($n == 1 && $n % 1 == 0)) { return 0; } else if (($n >= 2 && $n <= 4 && $n % 1 == 0)) { return 1; } else if (($n % 1 != 0 )) { return 2; } else { return 3; }
}}
$a->strings['Blockem'] = 'Blockem';
$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Skrývá uživatelský obsah zabalením příspěvků. Navíc nahrazuje avatar generickým obrázkem.';
$a->strings['Comma separated profile URLS:'] = 'URL adresy profilů, oddělené čárkami:';
$a->strings['Save Settings'] = 'Uložit nastavení';
$a->strings['BLOCKEM Settings saved.'] = 'Nastavení BLOCKEM uložena.';
$a->strings['Filtered user: %s'] = 'Filtrovaný uživatel: %s';
$a->strings['Unblock Author'] = 'Odblokovat autora';
$a->strings['Block Author'] = 'Zablokovat autora';
$a->strings['blockem settings updated'] = 'nastavení blockem aktualizována';

View file

@ -1,47 +0,0 @@
# ADDON blockem
# Copyright (C)
# This file is distributed under the same license as the Friendica blockem addon package.
#
#
# Translators:
# Anton <dev@atjn.dk>, 2022
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-11-21 19:13-0500\n"
"PO-Revision-Date: 2014-06-22 11:20+0000\n"
"Last-Translator: Anton <dev@atjn.dk>, 2022\n"
"Language-Team: Danish (Denmark) (http://www.transifex.com/Friendica/friendica/language/da_DK/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: da_DK\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: blockem.php:39
msgid ""
"Hides user's content by collapsing posts. Also replaces their avatar with "
"generic image."
msgstr "Skjul brugers indhold ved at kollapse deres opslag. Erstatter også deres avatar med et generisk billede."
#: blockem.php:40
msgid "Comma separated profile URLS:"
msgstr "Kommasepareret liste over profil-URL's:"
#: blockem.php:45
msgid "Blockem"
msgstr "Blokdem"
#: blockem.php:120
#, php-format
msgid "Filtered user: %s"
msgstr "Filtreret bruger: %s"
#: blockem.php:183
msgid "Unblock Author"
msgstr "Fjern blokering af forfatter"
#: blockem.php:185
msgid "Block Author"
msgstr "Blokér forfatter"

View file

@ -1,13 +0,0 @@
<?php
if(! function_exists("string_plural_select_da_dk")) {
function string_plural_select_da_dk($n){
$n = intval($n);
return intval($n != 1);
}}
$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Skjul brugers indhold ved at kollapse deres opslag. Erstatter også deres avatar med et generisk billede.';
$a->strings['Comma separated profile URLS:'] = 'Kommasepareret liste over profil-URL\'s:';
$a->strings['Blockem'] = 'Blokdem';
$a->strings['Filtered user: %s'] = 'Filtreret bruger: %s';
$a->strings['Unblock Author'] = 'Fjern blokering af forfatter';
$a->strings['Block Author'] = 'Blokér forfatter';

View file

@ -1,50 +0,0 @@
# ADDON blockem
# Copyright (C)
# This file is distributed under the same license as the Friendica blockem addon package.
#
#
# Translators:
# Andreas H., 2018
# Tobias Diekershoff <tobias.diekershoff@gmx.net>, 2014
# Tobias Diekershoff <tobias.diekershoff@gmx.net>, 2018
# Ulf Rompe <transifex.com@rompe.org>, 2019
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-11-21 19:13-0500\n"
"PO-Revision-Date: 2021-12-22 15:27+0000\n"
"Last-Translator: Transifex Bot <>\n"
"Language-Team: German (http://www.transifex.com/Friendica/friendica/language/de/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: de\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: blockem.php:39
msgid ""
"Hides user's content by collapsing posts. Also replaces their avatar with "
"generic image."
msgstr "Verbirgt Inhalte von Benutzern durch Zusammenklappen der Beiträge. Des Weiteren wird das Profilbild durch einen generischen Avatar ersetzt."
#: blockem.php:40
msgid "Comma separated profile URLS:"
msgstr "Komma-separierte Liste von Profil-URLs"
#: blockem.php:45
msgid "Blockem"
msgstr "Blockem"
#: blockem.php:120
#, php-format
msgid "Filtered user: %s"
msgstr "Gefilterte Person: %s"
#: blockem.php:183
msgid "Unblock Author"
msgstr "Autor freischalten"
#: blockem.php:185
msgid "Block Author"
msgstr "Autor blockieren"

View file

@ -1,13 +0,0 @@
<?php
if(! function_exists("string_plural_select_de")) {
function string_plural_select_de($n){
$n = intval($n);
return intval($n != 1);
}}
$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Verbirgt Inhalte von Benutzern durch Zusammenklappen der Beiträge. Des Weiteren wird das Profilbild durch einen generischen Avatar ersetzt.';
$a->strings['Comma separated profile URLS:'] = 'Komma-separierte Liste von Profil-URLs';
$a->strings['Blockem'] = 'Blockem';
$a->strings['Filtered user: %s'] = 'Gefilterte Person: %s';
$a->strings['Unblock Author'] = 'Autor freischalten';
$a->strings['Block Author'] = 'Autor blockieren';

View file

@ -1,59 +0,0 @@
# ADDON blockem
# Copyright (C)
# This file is distributed under the same license as the Friendica blockem addon package.
#
#
# Translators:
# Andy H3 <andy@hubup.pro>, 2018
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-09 13:00+0100\n"
"PO-Revision-Date: 2018-03-15 14:10+0000\n"
"Last-Translator: Andy H3 <andy@hubup.pro>\n"
"Language-Team: English (United Kingdom) (http://www.transifex.com/Friendica/friendica/language/en_GB/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: en_GB\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: blockem.php:51 blockem.php:55
msgid "\"Blockem\""
msgstr "\"Blockem\""
#: blockem.php:59
msgid ""
"Hides user's content by collapsing posts. Also replaces their avatar with "
"generic image."
msgstr "Hides user's content by collapsing posts. Also replaces their avatar with generic image."
#: blockem.php:60
msgid "Comma separated profile URLS:"
msgstr "Comma separated profile URLs:"
#: blockem.php:64
msgid "Save Settings"
msgstr "Save settings"
#: blockem.php:77
msgid "BLOCKEM Settings saved."
msgstr "Blockem settings saved."
#: blockem.php:140
#, php-format
msgid "Hidden content by %s - Click to open/close"
msgstr "Hidden content by %s - Reveal/hide"
#: blockem.php:193
msgid "Unblock Author"
msgstr "Unblock author"
#: blockem.php:195
msgid "Block Author"
msgstr "Block author"
#: blockem.php:227
msgid "blockem settings updated"
msgstr "Blockem settings updated"

View file

@ -1,16 +0,0 @@
<?php
if(! function_exists("string_plural_select_en_gb")) {
function string_plural_select_en_gb($n){
$n = intval($n);
return intval($n != 1);
}}
$a->strings['"Blockem"'] = '"Blockem"';
$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.';
$a->strings['Comma separated profile URLS:'] = 'Comma separated profile URLs:';
$a->strings['Save Settings'] = 'Save settings';
$a->strings['BLOCKEM Settings saved.'] = 'Blockem settings saved.';
$a->strings['Hidden content by %s - Click to open/close'] = 'Hidden content by %s - Reveal/hide';
$a->strings['Unblock Author'] = 'Unblock author';
$a->strings['Block Author'] = 'Block author';
$a->strings['blockem settings updated'] = 'Blockem settings updated';

View file

@ -1,61 +0,0 @@
# ADDON blockem
# Copyright (C)
# This file is distributed under the same license as the Friendica blockem addon package.
#
#
# Translators:
# Adam Clark <adam@isurf.ca>, 2018
# Andy H3 <andy@hubup.pro>, 2018
# R C <miqrogroove@gmail.com>, 2018
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-04-01 11:11-0400\n"
"PO-Revision-Date: 2018-06-13 02:40+0000\n"
"Last-Translator: R C <miqrogroove@gmail.com>\n"
"Language-Team: English (United States) (http://www.transifex.com/Friendica/friendica/language/en_US/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: en_US\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: blockem.php:52 blockem.php:56
msgid "\"Blockem\""
msgstr "Blockem"
#: blockem.php:60
msgid ""
"Hides user's content by collapsing posts. Also replaces their avatar with "
"generic image."
msgstr "Hides user's content by collapsing posts. Also replaces their avatar with generic image."
#: blockem.php:61
msgid "Comma separated profile URLS:"
msgstr "Comma-separated profile URLs:"
#: blockem.php:65
msgid "Save Settings"
msgstr "Save settings"
#: blockem.php:78
msgid "BLOCKEM Settings saved."
msgstr "Blockem settings saved."
#: blockem.php:136
#, php-format
msgid "Filtered user: %s"
msgstr "Filtered user: %s"
#: blockem.php:189
msgid "Unblock Author"
msgstr "Unblock author"
#: blockem.php:191
msgid "Block Author"
msgstr "Block author"
#: blockem.php:223
msgid "blockem settings updated"
msgstr "Blockem settings updated"

View file

@ -1,16 +0,0 @@
<?php
if(! function_exists("string_plural_select_en_us")) {
function string_plural_select_en_us($n){
$n = intval($n);
return intval($n != 1);
}}
$a->strings['"Blockem"'] = 'Blockem';
$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.';
$a->strings['Comma separated profile URLS:'] = 'Comma-separated profile URLs:';
$a->strings['Save Settings'] = 'Save settings';
$a->strings['BLOCKEM Settings saved.'] = 'Blockem settings saved.';
$a->strings['Filtered user: %s'] = 'Filtered user: %s';
$a->strings['Unblock Author'] = 'Unblock author';
$a->strings['Block Author'] = 'Block author';
$a->strings['blockem settings updated'] = 'Blockem settings updated';

View file

@ -1,10 +0,0 @@
<?php
$a->strings["\"Blockem\" Settings"] = "\"Blockem\" Agordoj";
$a->strings["Comma separated profile URLS to block"] = "Blokotaj URL adresoj, disigita per komo";
$a->strings["Submit"] = "Sendi";
$a->strings["BLOCKEM Settings saved."] = "Konservis Agordojn de BLOCKEM.";
$a->strings["Blocked %s - Click to open/close"] = "%s blokita - Klaku por malfermi/fermi";
$a->strings["Unblock Author"] = "Malbloki Aŭtoron";
$a->strings["Block Author"] = "Bloki Aŭtoron";
$a->strings["blockem settings updated"] = "Ĝisdatigis la blockem agordojn";

View file

@ -1,53 +0,0 @@
# ADDON blockem
# Copyright (C)
# This file is distributed under the same license as the Friendica blockem addon package.
#
#
# Translators:
# Albert, 2018
# Senex Petrovic <javierruizo@hotmail.com>, 2021
# Tupambae.org, 2016
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-01 18:15+0100\n"
"PO-Revision-Date: 2021-04-01 09:45+0000\n"
"Last-Translator: Senex Petrovic <javierruizo@hotmail.com>\n"
"Language-Team: Spanish (http://www.transifex.com/Friendica/friendica/language/es/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: es\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: blockem.php:42 blockem.php:46
msgid "Blockem"
msgstr "Blockem (Bloquealos)"
#: blockem.php:50
msgid ""
"Hides user's content by collapsing posts. Also replaces their avatar with "
"generic image."
msgstr "Oculta el contenido del usuario al colapsar las publicaciones. También reemplaza su avatar con una imagen genérica."
#: blockem.php:51
msgid "Comma separated profile URLS:"
msgstr "URLs de perfil separadas por comas:"
#: blockem.php:55
msgid "Save Settings"
msgstr "Guardar configuración"
#: blockem.php:131
#, php-format
msgid "Filtered user: %s"
msgstr "Usuario filtrado: %s"
#: blockem.php:190
msgid "Unblock Author"
msgstr "Desbloquear autor"
#: blockem.php:192
msgid "Block Author"
msgstr "Bloquear autor"

View file

@ -1,14 +0,0 @@
<?php
if(! function_exists("string_plural_select_es")) {
function string_plural_select_es($n){
$n = intval($n);
return intval($n != 1);
}}
$a->strings['Blockem'] = 'Blockem (Bloquealos)';
$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Oculta el contenido del usuario al colapsar las publicaciones. También reemplaza su avatar con una imagen genérica.';
$a->strings['Comma separated profile URLS:'] = 'URLs de perfil separadas por comas:';
$a->strings['Save Settings'] = 'Guardar configuración';
$a->strings['Filtered user: %s'] = 'Usuario filtrado: %s';
$a->strings['Unblock Author'] = 'Desbloquear autor';
$a->strings['Block Author'] = 'Bloquear autor';

View file

@ -1,60 +0,0 @@
# ADDON blockem
# Copyright (C)
# This file is distributed under the same license as the Friendica blockem addon package.
#
#
# Translators:
# Kris, 2018
# Kris, 2018
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-04-01 11:11-0400\n"
"PO-Revision-Date: 2018-04-18 14:44+0000\n"
"Last-Translator: Kris\n"
"Language-Team: Finnish (Finland) (http://www.transifex.com/Friendica/friendica/language/fi_FI/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: fi_FI\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: blockem.php:52 blockem.php:56
msgid "\"Blockem\""
msgstr "\"Blockem\""
#: blockem.php:60
msgid ""
"Hides user's content by collapsing posts. Also replaces their avatar with "
"generic image."
msgstr ""
#: blockem.php:61
msgid "Comma separated profile URLS:"
msgstr "Profiilien URL-osoitteet pilkulla erotettuina:"
#: blockem.php:65
msgid "Save Settings"
msgstr "Tallenna asetukset"
#: blockem.php:78
msgid "BLOCKEM Settings saved."
msgstr "Blockem -asetukset tallennettu"
#: blockem.php:136
#, php-format
msgid "Filtered user: %s"
msgstr "Suodatettu käyttäjä: %s"
#: blockem.php:189
msgid "Unblock Author"
msgstr "Poista kirjoittaja estolistalta"
#: blockem.php:191
msgid "Block Author"
msgstr "Lisää kirjoittaja estolistalle"
#: blockem.php:223
msgid "blockem settings updated"
msgstr "blockem -asetukset päivitetty"

View file

@ -1,15 +0,0 @@
<?php
if(! function_exists("string_plural_select_fi_fi")) {
function string_plural_select_fi_fi($n){
$n = intval($n);
return intval($n != 1);
}}
$a->strings['"Blockem"'] = '"Blockem"';
$a->strings['Comma separated profile URLS:'] = 'Profiilien URL-osoitteet pilkulla erotettuina:';
$a->strings['Save Settings'] = 'Tallenna asetukset';
$a->strings['BLOCKEM Settings saved.'] = 'Blockem -asetukset tallennettu';
$a->strings['Filtered user: %s'] = 'Suodatettu käyttäjä: %s';
$a->strings['Unblock Author'] = 'Poista kirjoittaja estolistalta';
$a->strings['Block Author'] = 'Lisää kirjoittaja estolistalle';
$a->strings['blockem settings updated'] = 'blockem -asetukset päivitetty';

View file

@ -1,50 +0,0 @@
# ADDON blockem
# Copyright (C)
# This file is distributed under the same license as the Friendica blockem addon package.
#
#
# Translators:
# Hypolite Petovan <hypolite@mrpetovan.com>, 2016
# Marie Olive <lacellule101@gmail.com>, 2018
# StefOfficiel <pichard.stephane@free.fr>, 2015
# Vladimir Núñez <lapoubelle111@gmail.com>, 2018
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-11-21 19:13-0500\n"
"PO-Revision-Date: 2014-06-22 11:20+0000\n"
"Last-Translator: Vladimir Núñez <lapoubelle111@gmail.com>, 2018\n"
"Language-Team: French (http://www.transifex.com/Friendica/friendica/language/fr/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: fr\n"
"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n"
#: blockem.php:39
msgid ""
"Hides user's content by collapsing posts. Also replaces their avatar with "
"generic image."
msgstr "Cache le contenu de l'utilisateur en contractant les publications. Remplace aussi leur avatar par une image générique."
#: blockem.php:40
msgid "Comma separated profile URLS:"
msgstr "URLs de profil séparées par des virgules:"
#: blockem.php:45
msgid "Blockem"
msgstr "Bloquez-les"
#: blockem.php:120
#, php-format
msgid "Filtered user: %s"
msgstr "Utilisateur filtré:%s"
#: blockem.php:183
msgid "Unblock Author"
msgstr "Débloquer l'Auteur"
#: blockem.php:185
msgid "Block Author"
msgstr "Bloquer l'Auteur"

View file

@ -1,13 +0,0 @@
<?php
if(! function_exists("string_plural_select_fr")) {
function string_plural_select_fr($n){
$n = intval($n);
if (($n == 0 || $n == 1)) { return 0; } else if ($n != 0 && $n % 1000000 == 0) { return 1; } else { return 2; }
}}
$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Cache le contenu de l\'utilisateur en contractant les publications. Remplace aussi leur avatar par une image générique.';
$a->strings['Comma separated profile URLS:'] = 'URLs de profil séparées par des virgules:';
$a->strings['Blockem'] = 'Bloquez-les';
$a->strings['Filtered user: %s'] = 'Utilisateur filtré:%s';
$a->strings['Unblock Author'] = 'Débloquer l\'Auteur';
$a->strings['Block Author'] = 'Bloquer l\'Auteur';

View file

@ -1,47 +0,0 @@
# ADDON blockem
# Copyright (C)
# This file is distributed under the same license as the Friendica blockem addon package.
#
#
# Translators:
# Balázs Úr, 2020
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-11-21 19:13-0500\n"
"PO-Revision-Date: 2014-06-22 11:20+0000\n"
"Last-Translator: Balázs Úr, 2020\n"
"Language-Team: Hungarian (http://www.transifex.com/Friendica/friendica/language/hu/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: hu\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: blockem.php:39
msgid ""
"Hides user's content by collapsing posts. Also replaces their avatar with "
"generic image."
msgstr "Elrejti a felhasználók tartalmát a bejegyzések összecsukásával. Ezenkívül lecseréli a profilképeiket egy általános képre."
#: blockem.php:40
msgid "Comma separated profile URLS:"
msgstr "Profil URL-ek vesszővel elválasztva:"
#: blockem.php:45
msgid "Blockem"
msgstr "Blockem"
#: blockem.php:120
#, php-format
msgid "Filtered user: %s"
msgstr "Kiszűrt felhasználó: %s"
#: blockem.php:183
msgid "Unblock Author"
msgstr "Szerző tiltásának feloldása"
#: blockem.php:185
msgid "Block Author"
msgstr "Szerző tiltása"

View file

@ -1,13 +0,0 @@
<?php
if(! function_exists("string_plural_select_hu")) {
function string_plural_select_hu($n){
$n = intval($n);
return intval($n != 1);
}}
$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Elrejti a felhasználók tartalmát a bejegyzések összecsukásával. Ezenkívül lecseréli a profilképeiket egy általános képre.';
$a->strings['Comma separated profile URLS:'] = 'Profil URL-ek vesszővel elválasztva:';
$a->strings['Blockem'] = 'Blockem';
$a->strings['Filtered user: %s'] = 'Kiszűrt felhasználó: %s';
$a->strings['Unblock Author'] = 'Szerző tiltásának feloldása';
$a->strings['Block Author'] = 'Szerző tiltása';

View file

@ -1,10 +0,0 @@
<?php
$a->strings["\"Blockem\" Settings"] = "\"Blockem\" stillingar";
$a->strings["Comma separated profile URLS to block"] = "Banna lista af forsíðum (komma á milli)";
$a->strings["Submit"] = "Senda inn";
$a->strings["BLOCKEM Settings saved."] = "BLOCKEM stillingar vistaðar.";
$a->strings["Blocked %s - Click to open/close"] = "%s sett í straff - Smella til að taka úr/setja á";
$a->strings["Unblock Author"] = "Leyfa notanda";
$a->strings["Block Author"] = "Banna notanda";
$a->strings["blockem settings updated"] = "";

View file

@ -1,59 +0,0 @@
# ADDON blockem
# Copyright (C)
# This file is distributed under the same license as the Friendica blockem addon package.
#
#
# Translators:
# fabrixxm <fabrix.xm@gmail.com>, 2014,2018-2019
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-08-17 10:23+0200\n"
"PO-Revision-Date: 2019-03-11 14:21+0000\n"
"Last-Translator: fabrixxm <fabrix.xm@gmail.com>\n"
"Language-Team: Italian (http://www.transifex.com/Friendica/friendica/language/it/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: it\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: blockem.php:54 blockem.php:58
msgid "Blockem"
msgstr "Blockem"
#: blockem.php:62
msgid ""
"Hides user's content by collapsing posts. Also replaces their avatar with "
"generic image."
msgstr "Nascondi il contenuto degli utenti collassando i messaggi. Sostituisce anche gli avatar con un'immagine generica."
#: blockem.php:63
msgid "Comma separated profile URLS:"
msgstr "URL profili separati da virgola:"
#: blockem.php:67
msgid "Save Settings"
msgstr "Salva Impostazioni"
#: blockem.php:81
msgid "BLOCKEM Settings saved."
msgstr "Impostazioni BLOCKEM salvate."
#: blockem.php:143
#, php-format
msgid "Filtered user: %s"
msgstr "Utente filtrato: %s"
#: blockem.php:202
msgid "Unblock Author"
msgstr "Sblocca autore"
#: blockem.php:204
msgid "Block Author"
msgstr "Blocca autore"
#: blockem.php:244
msgid "blockem settings updated"
msgstr "Impostazioni 'blockem' aggiornate."

View file

@ -1,16 +0,0 @@
<?php
if(! function_exists("string_plural_select_it")) {
function string_plural_select_it($n){
$n = intval($n);
return intval($n != 1);
}}
$a->strings['Blockem'] = 'Blockem';
$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Nascondi il contenuto degli utenti collassando i messaggi. Sostituisce anche gli avatar con un\'immagine generica.';
$a->strings['Comma separated profile URLS:'] = 'URL profili separati da virgola:';
$a->strings['Save Settings'] = 'Salva Impostazioni';
$a->strings['BLOCKEM Settings saved.'] = 'Impostazioni BLOCKEM salvate.';
$a->strings['Filtered user: %s'] = 'Utente filtrato: %s';
$a->strings['Unblock Author'] = 'Sblocca autore';
$a->strings['Block Author'] = 'Blocca autore';
$a->strings['blockem settings updated'] = 'Impostazioni \'blockem\' aggiornate.';

View file

@ -1,10 +0,0 @@
<?php
$a->strings["\"Blockem\" Settings"] = "";
$a->strings["Comma separated profile URLS to block"] = "";
$a->strings["Submit"] = "Lagre";
$a->strings["BLOCKEM Settings saved."] = "";
$a->strings["Blocked %s - Click to open/close"] = "";
$a->strings["Unblock Author"] = "";
$a->strings["Block Author"] = "";
$a->strings["blockem settings updated"] = "";

View file

@ -1,60 +0,0 @@
# ADDON blockem
# Copyright (C)
# This file is distributed under the same license as the Friendica blockem addon package.
#
#
# Translators:
# AgnesElisa <agneselisa@disroot.org>, 2018
# Jeroen De Meerleer <me@jeroened.be>, 2018
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-08-17 10:23+0200\n"
"PO-Revision-Date: 2018-08-24 13:49+0000\n"
"Last-Translator: Jeroen De Meerleer <me@jeroened.be>\n"
"Language-Team: Dutch (http://www.transifex.com/Friendica/friendica/language/nl/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: nl\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: blockem.php:54 blockem.php:58
msgid "Blockem"
msgstr "Blockem"
#: blockem.php:62
msgid ""
"Hides user's content by collapsing posts. Also replaces their avatar with "
"generic image."
msgstr "Verbergt de inhoud van het bericht van de gebruiker. Daarnaast vervangt het de avatar door een standaardafbeelding."
#: blockem.php:63
msgid "Comma separated profile URLS:"
msgstr "Profiel URLs (kommagescheiden):"
#: blockem.php:67
msgid "Save Settings"
msgstr "Instellingen opslaan"
#: blockem.php:81
msgid "BLOCKEM Settings saved."
msgstr "BLOCKEM instellingen opgeslagen."
#: blockem.php:143
#, php-format
msgid "Filtered user: %s"
msgstr "Gefilterde gebruiker: %s"
#: blockem.php:202
msgid "Unblock Author"
msgstr "Deblokkeer Auteur"
#: blockem.php:204
msgid "Block Author"
msgstr "Auteur blokkeren"
#: blockem.php:244
msgid "blockem settings updated"
msgstr "blockem instellingen opgeslagen"

View file

@ -1,16 +0,0 @@
<?php
if(! function_exists("string_plural_select_nl")) {
function string_plural_select_nl($n){
$n = intval($n);
return intval($n != 1);
}}
$a->strings['Blockem'] = 'Blockem';
$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Verbergt de inhoud van het bericht van de gebruiker. Daarnaast vervangt het de avatar door een standaardafbeelding.';
$a->strings['Comma separated profile URLS:'] = 'Profiel URLs (kommagescheiden):';
$a->strings['Save Settings'] = 'Instellingen opslaan';
$a->strings['BLOCKEM Settings saved.'] = 'BLOCKEM instellingen opgeslagen.';
$a->strings['Filtered user: %s'] = 'Gefilterde gebruiker: %s';
$a->strings['Unblock Author'] = 'Deblokkeer Auteur';
$a->strings['Block Author'] = 'Auteur blokkeren';
$a->strings['blockem settings updated'] = 'blockem instellingen opgeslagen';

View file

@ -1,47 +0,0 @@
# ADDON blockem
# Copyright (C)
# This file is distributed under the same license as the Friendica blockem addon package.
#
#
# Translators:
# Waldemar Stoczkowski, 2018
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-11-21 19:13-0500\n"
"PO-Revision-Date: 2014-06-22 11:20+0000\n"
"Last-Translator: Waldemar Stoczkowski, 2018\n"
"Language-Team: Polish (http://www.transifex.com/Friendica/friendica/language/pl/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: pl\n"
"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n"
#: blockem.php:39
msgid ""
"Hides user's content by collapsing posts. Also replaces their avatar with "
"generic image."
msgstr "Ukrywa zawartość użytkownika, zwijając posty. Zastępuje również awatar wygenerowanym obrazem."
#: blockem.php:40
msgid "Comma separated profile URLS:"
msgstr "Rozdzielone przecinkami adresy URL profilu:"
#: blockem.php:45
msgid "Blockem"
msgstr "Zablokowanie"
#: blockem.php:120
#, php-format
msgid "Filtered user: %s"
msgstr "Użytkownik filtrowany: %s"
#: blockem.php:183
msgid "Unblock Author"
msgstr "Odblokuj autora"
#: blockem.php:185
msgid "Block Author"
msgstr "Zablokuj autora"

View file

@ -1,13 +0,0 @@
<?php
if(! function_exists("string_plural_select_pl")) {
function string_plural_select_pl($n){
$n = intval($n);
if ($n==1) { return 0; } else if (($n%10>=2 && $n%10<=4) && ($n%100<12 || $n%100>14)) { return 1; } else if ($n!=1 && ($n%10>=0 && $n%10<=1) || ($n%10>=5 && $n%10<=9) || ($n%100>=12 && $n%100<=14)) { return 2; } else { return 3; }
}}
$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Ukrywa zawartość użytkownika, zwijając posty. Zastępuje również awatar wygenerowanym obrazem.';
$a->strings['Comma separated profile URLS:'] = 'Rozdzielone przecinkami adresy URL profilu:';
$a->strings['Blockem'] = 'Zablokowanie';
$a->strings['Filtered user: %s'] = 'Użytkownik filtrowany: %s';
$a->strings['Unblock Author'] = 'Odblokuj autora';
$a->strings['Block Author'] = 'Zablokuj autora';

View file

@ -1,10 +0,0 @@
<?php
$a->strings["\"Blockem\" Settings"] = "Configurações \"Blockem\"";
$a->strings["Comma separated profile URLS to block"] = "URLS de perfis separados por vírgulas a serem bloqueados";
$a->strings["Submit"] = "Enviar";
$a->strings["BLOCKEM Settings saved."] = "Configurações BLOCKEM armazenadas.";
$a->strings["Blocked %s - Click to open/close"] = "Bloqueado %s - Clique para abrir/fechar";
$a->strings["Unblock Author"] = "Desbloqueie Autor";
$a->strings["Block Author"] = "Bloqueie Autor";
$a->strings["blockem settings updated"] = "configurações blockem atualizadas";

View file

@ -1,52 +0,0 @@
# ADDON blockem
# Copyright (C)
# This file is distributed under the same license as the Friendica blockem addon package.
#
#
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-06-22 13:18+0200\n"
"PO-Revision-Date: 2014-07-08 11:43+0000\n"
"Last-Translator: Arian - Cazare Muncitori <arianserv@gmail.com>\n"
"Language-Team: Romanian (Romania) (http://www.transifex.com/projects/p/friendica/language/ro_RO/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ro_RO\n"
"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n"
#: blockem.php:53 blockem.php:57
msgid "\"Blockem\""
msgstr "\"Blockem\""
#: blockem.php:61
msgid "Comma separated profile URLS to block"
msgstr "Adresele URL de profil, de blocat, separate prin virgulă"
#: blockem.php:65
msgid "Save Settings"
msgstr "Salvare Configurări"
#: blockem.php:78
msgid "BLOCKEM Settings saved."
msgstr "Configurările BLOCKEM au fost salvate."
#: blockem.php:142
#, php-format
msgid "Blocked %s - Click to open/close"
msgstr "%s Blocate - Apăsați pentru a deschide/închide"
#: blockem.php:197
msgid "Unblock Author"
msgstr "Deblocare Autor"
#: blockem.php:199
msgid "Block Author"
msgstr "Blocare Autor"
#: blockem.php:231
msgid "blockem settings updated"
msgstr "Configurările blockem au fost actualizate"

View file

@ -1,15 +0,0 @@
<?php
if(! function_exists("string_plural_select_ro")) {
function string_plural_select_ro($n){
$n = intval($n);
if ($n==1) { return 0; } else if ((($n%100>19)||(($n%100==0)&&($n!=0)))) { return 2; } else { return 1; }
}}
$a->strings['"Blockem"'] = '"Blockem"';
$a->strings['Comma separated profile URLS to block'] = 'Adresele URL de profil, de blocat, separate prin virgulă';
$a->strings['Save Settings'] = 'Salvare Configurări';
$a->strings['BLOCKEM Settings saved.'] = 'Configurările BLOCKEM au fost salvate.';
$a->strings['Blocked %s - Click to open/close'] = '%s Blocate - Apăsați pentru a deschide/închide';
$a->strings['Unblock Author'] = 'Deblocare Autor';
$a->strings['Block Author'] = 'Blocare Autor';
$a->strings['blockem settings updated'] = 'Configurările blockem au fost actualizate';

View file

@ -1,60 +0,0 @@
# ADDON blockem
# Copyright (C)
# This file is distributed under the same license as the Friendica blockem addon package.
#
#
# Translators:
# Alexander An <ravnina@gmail.com>, 2020
# Stanislav N. <pztrn@pztrn.name>, 2017-2018
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-08-17 10:23+0200\n"
"PO-Revision-Date: 2020-04-23 14:13+0000\n"
"Last-Translator: Alexander An <ravnina@gmail.com>\n"
"Language-Team: Russian (http://www.transifex.com/Friendica/friendica/language/ru/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ru\n"
"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n"
#: blockem.php:54 blockem.php:58
msgid "Blockem"
msgstr "Blockem"
#: blockem.php:62
msgid ""
"Hides user's content by collapsing posts. Also replaces their avatar with "
"generic image."
msgstr "Скрыть контент пользователя. Также заменяет его аватар изображением по-умолчанию."
#: blockem.php:63
msgid "Comma separated profile URLS:"
msgstr "URL профилей, разделенные запятыми:"
#: blockem.php:67
msgid "Save Settings"
msgstr "Сохранить настройки"
#: blockem.php:81
msgid "BLOCKEM Settings saved."
msgstr "BLOCKEM Настройки сохранены."
#: blockem.php:143
#, php-format
msgid "Filtered user: %s"
msgstr "Отфильтрованный пользователь: %s"
#: blockem.php:202
msgid "Unblock Author"
msgstr "Разблокировать автора"
#: blockem.php:204
msgid "Block Author"
msgstr "Блокировать автора"
#: blockem.php:244
msgid "blockem settings updated"
msgstr "Настройки Blockem обновлены"

View file

@ -1,16 +0,0 @@
<?php
if(! function_exists("string_plural_select_ru")) {
function string_plural_select_ru($n){
$n = intval($n);
if ($n%10==1 && $n%100!=11) { return 0; } else if ($n%10>=2 && $n%10<=4 && ($n%100<12 || $n%100>14)) { return 1; } else if ($n%10==0 || ($n%10>=5 && $n%10<=9) || ($n%100>=11 && $n%100<=14)) { return 2; } else { return 3; }
}}
$a->strings['Blockem'] = 'Blockem';
$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Скрыть контент пользователя. Также заменяет его аватар изображением по-умолчанию.';
$a->strings['Comma separated profile URLS:'] = 'URL профилей, разделенные запятыми:';
$a->strings['Save Settings'] = 'Сохранить настройки';
$a->strings['BLOCKEM Settings saved.'] = 'BLOCKEM Настройки сохранены.';
$a->strings['Filtered user: %s'] = 'Отфильтрованный пользователь: %s';
$a->strings['Unblock Author'] = 'Разблокировать автора';
$a->strings['Block Author'] = 'Блокировать автора';
$a->strings['blockem settings updated'] = 'Настройки Blockem обновлены';

View file

@ -1,47 +0,0 @@
# ADDON blockem
# Copyright (C)
# This file is distributed under the same license as the Friendica blockem addon package.
#
#
# Translators:
# Bjoessi <torbjorn.andersson@syte.se>, 2019
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-11-21 19:13-0500\n"
"PO-Revision-Date: 2021-12-22 15:27+0000\n"
"Last-Translator: Transifex Bot <>\n"
"Language-Team: Swedish (http://www.transifex.com/Friendica/friendica/language/sv/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: sv\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: blockem.php:39
msgid ""
"Hides user's content by collapsing posts. Also replaces their avatar with "
"generic image."
msgstr "Döljer användares inlägg genom sammanslagning nedåt. Användarens profilbild ersätts med en standardbild."
#: blockem.php:40
msgid "Comma separated profile URLS:"
msgstr "Kommaseparerade profiladresser:"
#: blockem.php:45
msgid "Blockem"
msgstr "BLOCKEM"
#: blockem.php:120
#, php-format
msgid "Filtered user: %s"
msgstr "Filtrerat på användare:%s"
#: blockem.php:183
msgid "Unblock Author"
msgstr "Avblockera författare"
#: blockem.php:185
msgid "Block Author"
msgstr "Blockera författare"

View file

@ -1,13 +0,0 @@
<?php
if(! function_exists("string_plural_select_sv")) {
function string_plural_select_sv($n){
$n = intval($n);
return intval($n != 1);
}}
$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Döljer användares inlägg genom sammanslagning nedåt. Användarens profilbild ersätts med en standardbild.';
$a->strings['Comma separated profile URLS:'] = 'Kommaseparerade profiladresser:';
$a->strings['Blockem'] = 'BLOCKEM';
$a->strings['Filtered user: %s'] = 'Filtrerat på användare:%s';
$a->strings['Unblock Author'] = 'Avblockera författare';
$a->strings['Block Author'] = 'Blockera författare';

View file

@ -1,10 +0,0 @@
<?php
$a->strings["\"Blockem\" Settings"] = "「Blockem」配置";
$a->strings["Comma separated profile URLS to block"] = "逗号分简介URL为栏";
$a->strings["Submit"] = "提交";
$a->strings["BLOCKEM Settings saved."] = "「Blockem」配置保存了。";
$a->strings["Blocked %s - Click to open/close"] = "%s拦了点击为开关";
$a->strings["Unblock Author"] = "不拦作家";
$a->strings["Block Author"] = "拦作家";
$a->strings["blockem settings updated"] = "blockem设置更新了";

View file

@ -1 +0,0 @@
{{include file="field_textarea.tpl" field=$words}}

9
bluesky/README.md Normal file
View file

@ -0,0 +1,9 @@
Bluesky Addon
==============
This addon supports posting to and receiving posts from Bluesky.
No setup is needed for the admins to make it work for their users.
Bluesky itself is under development as well. It is planned to make it decentral.
The addon is prepared to support different servers. But it isn't enabled yet.

1775
bluesky/bluesky.php Normal file
View file

@ -0,0 +1,1775 @@
<?php
/**
* Name: Bluesky Connector
* Description: Post to Bluesky
* Version: 1.1
* Author: Michael Vogel <https://pirati.ca/profile/heluecht>
*
* @todo
* Currently technical issues in the core:
* - Outgoing mentions
*
* At some point in time:
* - Sending Quote shares https://atproto.com/lexicons/app-bsky-embed#appbskyembedrecord and https://atproto.com/lexicons/app-bsky-embed#appbskyembedrecordwithmedia
*
* Possibly not possible:
* - only fetch new posts
*
* Currently not possible, due to limitations in Friendica
* - mute contacts https://atproto.com/lexicons/app-bsky-graph#appbskygraphmuteactor
* - unmute contacts https://atproto.com/lexicons/app-bsky-graph#appbskygraphunmuteactor
*
* Possibly interesting:
* - https://atproto.com/lexicons/com-atproto-label#comatprotolabelsubscribelabels
*/
use Friendica\Content\Text\BBCode;
use Friendica\Content\Text\HTML;
use Friendica\Content\Text\Plaintext;
use Friendica\Core\Cache\Enum\Duration;
use Friendica\Core\Config\Util\ConfigFileManager;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\GServer;
use Friendica\Model\Item;
use Friendica\Model\ItemURI;
use Friendica\Model\Photo;
use Friendica\Model\Post;
use Friendica\Model\Tag;
use Friendica\Network\HTTPClient\Client\HttpClientAccept;
use Friendica\Network\HTTPClient\Client\HttpClientOptions;
use Friendica\Object\Image;
use Friendica\Protocol\Activity;
use Friendica\Protocol\Relay;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Strings;
const BLUESKY_DEFAULT_POLL_INTERVAL = 10; // given in minutes
const BLUESKY_IMAGE_SIZE = [1000000, 500000, 100000, 50000];
const BLUEKSY_STATUS_UNKNOWN = 0;
const BLUEKSY_STATUS_TOKEN_OK = 1;
const BLUEKSY_STATUS_SUCCESS = 2;
const BLUEKSY_STATUS_API_FAIL = 10;
const BLUEKSY_STATUS_DID_FAIL = 11;
const BLUEKSY_STATUS_PDS_FAIL = 12;
const BLUEKSY_STATUS_TOKEN_FAIL = 13;
/*
* (Currently) hard wired paths for Bluesky services
*/
const BLUESKY_DIRECTORY = 'https://plc.directory'; // Path to the directory server service to fetch the PDS of a given DID
const BLUESKY_PDS = 'https://bsky.social'; // Path to the personal data server service (PDS) to fetch the DID for a given handle
const BLUESKY_WEB = 'https://bsky.app'; // Path to the web interface with the user profile and posts
function bluesky_install()
{
Hook::register('load_config', __FILE__, 'bluesky_load_config');
Hook::register('hook_fork', __FILE__, 'bluesky_hook_fork');
Hook::register('post_local', __FILE__, 'bluesky_post_local');
Hook::register('notifier_normal', __FILE__, 'bluesky_send');
Hook::register('jot_networks', __FILE__, 'bluesky_jot_nets');
Hook::register('connector_settings', __FILE__, 'bluesky_settings');
Hook::register('connector_settings_post', __FILE__, 'bluesky_settings_post');
Hook::register('cron', __FILE__, 'bluesky_cron');
Hook::register('support_follow', __FILE__, 'bluesky_support_follow');
Hook::register('support_probe', __FILE__, 'bluesky_support_probe');
Hook::register('follow', __FILE__, 'bluesky_follow');
Hook::register('unfollow', __FILE__, 'bluesky_unfollow');
Hook::register('block', __FILE__, 'bluesky_block');
Hook::register('unblock', __FILE__, 'bluesky_unblock');
Hook::register('check_item_notification', __FILE__, 'bluesky_check_item_notification');
Hook::register('probe_detect', __FILE__, 'bluesky_probe_detect');
Hook::register('item_by_link', __FILE__, 'bluesky_item_by_link');
}
function bluesky_load_config(ConfigFileManager $loader)
{
DI::app()->getConfigCache()->load($loader->loadAddonConfig('bluesky'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
}
function bluesky_check_item_notification(array &$notification_data)
{
$did = DI::pConfig()->get($notification_data['uid'], 'bluesky', 'did');
if (!empty($did)) {
$notification_data['profiles'][] = $did;
}
}
function bluesky_probe_detect(array &$hookData)
{
// Don't overwrite an existing result
if (isset($hookData['result'])) {
return;
}
// Avoid a lookup for the wrong network
if (!in_array($hookData['network'], ['', Protocol::BLUESKY])) {
return;
}
$pconfig = DBA::selectFirst('pconfig', ['uid'], ["`cat` = ? AND `k` = ? AND `v` != ?", 'bluesky', 'access_token', '']);
if (empty($pconfig['uid'])) {
return;
}
if (parse_url($hookData['uri'], PHP_URL_SCHEME) == 'did') {
$did = $hookData['uri'];
} elseif (preg_match('#^' . BLUESKY_WEB . '/profile/(.+)#', $hookData['uri'], $matches)) {
$did = bluesky_get_did($matches[1]);
if (empty($did)) {
return;
}
} else {
return;
}
$token = bluesky_get_token($pconfig['uid']);
if (empty($token)) {
return;
}
$data = bluesky_xrpc_get($pconfig['uid'], 'app.bsky.actor.getProfile', ['actor' => $did]);
if (empty($data)) {
return;
}
$hookData['result'] = bluesky_get_contact_fields($data, 0, false);
$hookData['result']['baseurl'] = bluesky_get_pds($did);
// Preparing probe data. This differs slightly from the contact array
$hookData['result']['about'] = HTML::toBBCode($data->description ?? '');
$hookData['result']['photo'] = $data->avatar ?? '';
$hookData['result']['header'] = $data->banner ?? '';
$hookData['result']['batch'] = '';
$hookData['result']['notify'] = '';
$hookData['result']['poll'] = '';
$hookData['result']['poco'] = '';
$hookData['result']['pubkey'] = '';
$hookData['result']['priority'] = 0;
$hookData['result']['guid'] = '';
}
function bluesky_item_by_link(array &$hookData)
{
// Don't overwrite an existing result
if (isset($hookData['item_id'])) {
return;
}
$token = bluesky_get_token($hookData['uid']);
if (empty($token)) {
return;
}
if (!preg_match('#^' . BLUESKY_WEB . '/profile/(.+)/post/(.+)#', $hookData['uri'], $matches)) {
return;
}
$did = bluesky_get_did($matches[1]);
if (empty($did)) {
return;
}
Logger::debug('Found bluesky post', ['url' => $hookData['uri'], 'handle' => $matches[1], 'did' => $did, 'cid' => $matches[2]]);
$uri = 'at://' . $did . '/app.bsky.feed.post/' . $matches[2];
$uri = bluesky_fetch_missing_post($uri, $hookData['uid'], $hookData['uid'], 0, 0);
Logger::debug('Got post', ['profile' => $matches[1], 'cid' => $matches[2], 'result' => $uri]);
if (!empty($uri)) {
$item = Post::selectFirst(['id'], ['uri' => $uri, 'uid' => $hookData['uid']]);
if (!empty($item['id'])) {
$hookData['item_id'] = $item['id'];
}
}
}
function bluesky_support_follow(array &$data)
{
if ($data['protocol'] == Protocol::BLUESKY) {
$data['result'] = true;
}
}
function bluesky_support_probe(array &$data)
{
if ($data['protocol'] == Protocol::BLUESKY) {
$data['result'] = true;
}
}
function bluesky_follow(array &$hook_data)
{
$token = bluesky_get_token($hook_data['uid']);
if (empty($token)) {
return;
}
Logger::debug('Check if contact is bluesky', ['data' => $hook_data]);
$contact = DBA::selectFirst('contact', [], ['network' => Protocol::BLUESKY, 'url' => $hook_data['url'], 'uid' => [0, $hook_data['uid']]]);
if (empty($contact)) {
return;
}
$record = [
'subject' => $contact['url'],
'createdAt' => DateTimeFormat::utcNow(DateTimeFormat::ATOM),
'$type' => 'app.bsky.graph.follow'
];
$post = [
'collection' => 'app.bsky.graph.follow',
'repo' => DI::pConfig()->get($hook_data['uid'], 'bluesky', 'did'),
'record' => $record
];
$activity = bluesky_xrpc_post($hook_data['uid'], 'com.atproto.repo.createRecord', $post);
if (!empty($activity->uri)) {
$hook_data['contact'] = $contact;
Logger::debug('Successfully start following', ['url' => $contact['url'], 'uri' => $activity->uri]);
}
}
function bluesky_unfollow(array &$hook_data)
{
$token = bluesky_get_token($hook_data['uid']);
if (empty($token)) {
return;
}
if ($hook_data['contact']['network'] != Protocol::BLUESKY) {
return;
}
$data = bluesky_xrpc_get($hook_data['uid'], 'app.bsky.actor.getProfile', ['actor' => $hook_data['contact']['url']]);
if (empty($data->viewer) || empty($data->viewer->following)) {
return;
}
bluesky_delete_post($data->viewer->following, $hook_data['uid']);
$hook_data['result'] = true;
}
function bluesky_block(array &$hook_data)
{
$token = bluesky_get_token($hook_data['uid']);
if (empty($token)) {
return;
}
Logger::debug('Check if contact is bluesky', ['data' => $hook_data]);
$contact = DBA::selectFirst('contact', [], ['network' => Protocol::BLUESKY, 'url' => $hook_data['url'], 'uid' => [0, $hook_data['uid']]]);
if (empty($contact)) {
return;
}
$record = [
'subject' => $contact['url'],
'createdAt' => DateTimeFormat::utcNow(DateTimeFormat::ATOM),
'$type' => 'app.bsky.graph.block'
];
$post = [
'collection' => 'app.bsky.graph.block',
'repo' => DI::pConfig()->get($hook_data['uid'], 'bluesky', 'did'),
'record' => $record
];
$activity = bluesky_xrpc_post($hook_data['uid'], 'com.atproto.repo.createRecord', $post);
if (!empty($activity->uri)) {
$cdata = Contact::getPublicAndUserContactID($hook_data['contact']['id'], $hook_data['uid']);
if (!empty($cdata['user'])) {
Contact::remove($cdata['user']);
}
Logger::debug('Successfully blocked contact', ['url' => $hook_data['contact']['url'], 'uri' => $activity->uri]);
}
}
function bluesky_unblock(array &$hook_data)
{
$token = bluesky_get_token($hook_data['uid']);
if (empty($token)) {
return;
}
if ($hook_data['contact']['network'] != Protocol::BLUESKY) {
return;
}
$data = bluesky_xrpc_get($hook_data['uid'], 'app.bsky.actor.getProfile', ['actor' => $hook_data['contact']['url']]);
if (empty($data->viewer) || empty($data->viewer->blocking)) {
return;
}
bluesky_delete_post($data->viewer->blocking, $hook_data['uid']);
$hook_data['result'] = true;
}
function bluesky_settings(array &$data)
{
if (!DI::userSession()->getLocalUserId()) {
return;
}
$enabled = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'post') ?? false;
$def_enabled = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'post_by_default') ?? false;
$pds = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'pds');
$handle = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'handle');
$did = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'did');
$token = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'access_token');
$import = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'import') ?? false;
$import_feeds = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'import_feeds') ?? false;
$t = Renderer::getMarkupTemplate('connector_settings.tpl', 'addon/bluesky/');
$html = Renderer::replaceMacros($t, [
'$enable' => ['bluesky', DI::l10n()->t('Enable Bluesky Post Addon'), $enabled],
'$bydefault' => ['bluesky_bydefault', DI::l10n()->t('Post to Bluesky by default'), $def_enabled],
'$import' => ['bluesky_import', DI::l10n()->t('Import the remote timeline'), $import],
'$import_feeds' => ['bluesky_import_feeds', DI::l10n()->t('Import the pinned feeds'), $import_feeds, DI::l10n()->t('When activated, Posts will be imported from all the feeds that you pinned in Bluesky.')],
'$pds' => ['bluesky_pds', DI::l10n()->t('Personal Data Server'), $pds, DI::l10n()->t('The personal data server (PDS) is the system that hosts your profile.'), '', 'readonly'],
'$handle' => ['bluesky_handle', DI::l10n()->t('Bluesky handle'), $handle],
'$did' => ['bluesky_did', DI::l10n()->t('Bluesky DID'), $did, DI::l10n()->t('This is the unique identifier. It will be fetched automatically, when the handle is entered.'), '', 'readonly'],
'$password' => ['bluesky_password', DI::l10n()->t('Bluesky app password'), '', DI::l10n()->t("Please don't add your real password here, but instead create a specific app password in the Bluesky settings.")],
'$status' => bluesky_get_status($handle, $did, $pds, $token),
]);
$data = [
'connector' => 'bluesky',
'title' => DI::l10n()->t('Bluesky Import/Export'),
'image' => 'images/bluesky.jpg',
'enabled' => $enabled,
'html' => $html,
];
}
function bluesky_get_status(string $handle = null, string $did = null, string $pds = null, string $token = null): string
{
if (empty($handle)) {
return DI::l10n()->t('You are not authenticated. Please enter your handle and the app password.');
}
$status = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'status') ?? BLUEKSY_STATUS_UNKNOWN;
// Fallback mechanism for connection that had been established before the introduction of the status
if ($status == BLUEKSY_STATUS_UNKNOWN) {
if (empty($did)) {
$status = BLUEKSY_STATUS_DID_FAIL;
} elseif (empty($pds)) {
$status = BLUEKSY_STATUS_PDS_FAIL;
} elseif (!empty($token)) {
$status = BLUEKSY_STATUS_TOKEN_OK;
} else {
$status = BLUEKSY_STATUS_TOKEN_FAIL;
}
}
switch ($status) {
case BLUEKSY_STATUS_TOKEN_OK:
return DI::l10n()->t("You are authenticated to Bluesky. For security reasons the password isn't stored.");
case BLUEKSY_STATUS_SUCCESS:
return DI::l10n()->t('The communication with the personal data server service (PDS) is established.');
case BLUEKSY_STATUS_API_FAIL;
return DI::l10n()->t('Communication issues with the personal data server service (PDS).');
case BLUEKSY_STATUS_DID_FAIL:
return DI::l10n()->t('The DID for the provided handle could not be detected. Please check if you entered the correct handle.');
case BLUEKSY_STATUS_PDS_FAIL:
return DI::l10n()->t('The personal data server service (PDS) could not be detected.');
case BLUEKSY_STATUS_TOKEN_FAIL:
return DI::l10n()->t('The authentication with the provided handle and password failed. Please check if you entered the correct password.');
default:
return '';
}
}
function bluesky_settings_post(array &$b)
{
if (empty($_POST['bluesky-submit'])) {
return;
}
$old_pds = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'pds');
$old_handle = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'handle');
$old_did = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'did');
$handle = trim($_POST['bluesky_handle'], ' @');
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'bluesky', 'post', intval($_POST['bluesky']));
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'bluesky', 'post_by_default', intval($_POST['bluesky_bydefault']));
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'bluesky', 'handle', $handle);
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'bluesky', 'import', intval($_POST['bluesky_import']));
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'bluesky', 'import_feeds', intval($_POST['bluesky_import_feeds']));
if (!empty($handle)) {
if (empty($old_did) || $old_handle != $handle) {
$did = bluesky_get_did(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'handle'));
if (empty($did)) {
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'bluesky', 'status', BLUEKSY_STATUS_DID_FAIL);
}
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'bluesky', 'did', $did);
} else {
$did = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'did');
}
if (!empty($did) && (empty($old_pds) || $old_handle != $handle)) {
$pds = bluesky_get_pds($did);
if (empty($pds)) {
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'bluesky', 'status', BLUEKSY_STATUS_PDS_FAIL);
}
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'bluesky', 'pds', $pds);
} else {
$pds = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'pds');
}
} else {
DI::pConfig()->delete(DI::userSession()->getLocalUserId(), 'bluesky', 'did');
DI::pConfig()->delete(DI::userSession()->getLocalUserId(), 'bluesky', 'pds');
DI::pConfig()->delete(DI::userSession()->getLocalUserId(), 'bluesky', 'access_token');
DI::pConfig()->delete(DI::userSession()->getLocalUserId(), 'bluesky', 'refresh_token');
DI::pConfig()->delete(DI::userSession()->getLocalUserId(), 'bluesky', 'token_created');
DI::pConfig()->delete(DI::userSession()->getLocalUserId(), 'bluesky', 'status');
}
if (!empty($did) && !empty($pds) && !empty($_POST['bluesky_password'])) {
bluesky_create_token(DI::userSession()->getLocalUserId(), $_POST['bluesky_password']);
}
}
function bluesky_jot_nets(array &$jotnets_fields)
{
if (!DI::userSession()->getLocalUserId()) {
return;
}
if (DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'post')) {
$jotnets_fields[] = [
'type' => 'checkbox',
'field' => [
'bluesky_enable',
DI::l10n()->t('Post to Bluesky'),
DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'post_by_default')
]
];
}
}
function bluesky_cron()
{
$last = (int)DI::keyValue()->get('bluesky_last_poll');
$poll_interval = intval(DI::config()->get('bluesky', 'poll_interval'));
if (!$poll_interval) {
$poll_interval = BLUESKY_DEFAULT_POLL_INTERVAL;
}
if ($last) {
$next = $last + ($poll_interval * 60);
if ($next > time()) {
Logger::notice('poll interval not reached');
return;
}
}
Logger::notice('cron_start');
$abandon_days = intval(DI::config()->get('system', 'account_abandon_days'));
if ($abandon_days < 1) {
$abandon_days = 0;
}
$abandon_limit = date(DateTimeFormat::MYSQL, time() - $abandon_days * 86400);
$pconfigs = DBA::selectToArray('pconfig', [], ['cat' => 'bluesky', 'k' => 'import', 'v' => true]);
foreach ($pconfigs as $pconfig) {
if ($abandon_days != 0) {
if (!DBA::exists('user', ["`uid` = ? AND `login_date` >= ?", $pconfig['uid'], $abandon_limit])) {
Logger::notice('abandoned account: timeline from user will not be imported', ['user' => $pconfig['uid']]);
continue;
}
}
// Refresh the token now, so that it doesn't need to be refreshed in parallel by the following workers
bluesky_get_token($pconfig['uid']);
Worker::add(['priority' => Worker::PRIORITY_MEDIUM, 'force_priority' => true], 'addon/bluesky/bluesky_timeline.php', $pconfig['uid'], $last);
Worker::add(['priority' => Worker::PRIORITY_MEDIUM, 'force_priority' => true], 'addon/bluesky/bluesky_notifications.php', $pconfig['uid'], $last);
if (DI::pConfig()->get($pconfig['uid'], 'bluesky', 'import_feeds')) {
$feeds = bluesky_get_feeds($pconfig['uid']);
foreach ($feeds as $feed) {
Worker::add(['priority' => Worker::PRIORITY_MEDIUM, 'force_priority' => true], 'addon/bluesky/bluesky_feed.php', $pconfig['uid'], $feed, $last);
}
}
}
$last_clean = DI::keyValue()->get('bluesky_last_clean');
if (empty($last_clean) || ($last_clean + 86400 < time())) {
Logger::notice('Start contact cleanup');
$contacts = DBA::select('account-user-view', ['id', 'pid'], ["`network` = ? AND `uid` != ? AND `rel` = ?", Protocol::BLUESKY, 0, Contact::NOTHING]);
while ($contact = DBA::fetch($contacts)) {
Worker::add(Worker::PRIORITY_LOW, 'MergeContact', $contact['pid'], $contact['id'], 0);
}
DBA::close($contacts);
DI::keyValue()->set('bluesky_last_clean', time());
Logger::notice('Contact cleanup done');
}
Logger::notice('cron_end');
DI::keyValue()->set('bluesky_last_poll', time());
}
function bluesky_hook_fork(array &$b)
{
if ($b['name'] != 'notifier_normal') {
return;
}
$post = $b['data'];
if (($post['created'] !== $post['edited']) && !$post['deleted']) {
DI::logger()->info('Editing is not supported by the addon');
$b['execute'] = false;
return;
}
if (DI::pConfig()->get($post['uid'], 'bluesky', 'import')) {
// Don't post if it isn't a reply to a bluesky post
if (($post['parent'] != $post['id']) && !Post::exists(['id' => $post['parent'], 'network' => Protocol::BLUESKY])) {
Logger::notice('No bluesky parent found', ['item' => $post['id']]);
$b['execute'] = false;
return;
}
} elseif (!strstr($post['postopts'] ?? '', 'bluesky') || ($post['parent'] != $post['id']) || $post['private']) {
DI::logger()->info('Activities are never exported when we don\'t import the bluesky timeline', ['uid' => $post['uid']]);
$b['execute'] = false;
return;
}
}
function bluesky_post_local(array &$b)
{
if ($b['edit']) {
return;
}
if (!DI::userSession()->getLocalUserId() || (DI::userSession()->getLocalUserId() != $b['uid'])) {
return;
}
if ($b['private'] || $b['parent']) {
return;
}
$bluesky_post = intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'post'));
$bluesky_enable = (($bluesky_post && !empty($_REQUEST['bluesky_enable'])) ? intval($_REQUEST['bluesky_enable']) : 0);
// if API is used, default to the chosen settings
if ($b['api_source'] && intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'post_by_default'))) {
$bluesky_enable = 1;
}
if (!$bluesky_enable) {
return;
}
if (strlen($b['postopts'])) {
$b['postopts'] .= ',';
}
$b['postopts'] .= 'bluesky';
}
function bluesky_send(array &$b)
{
if (($b['created'] !== $b['edited']) && !$b['deleted']) {
return;
}
if ($b['gravity'] != Item::GRAVITY_PARENT) {
Logger::debug('Got comment', ['item' => $b]);
if ($b['deleted']) {
$uri = bluesky_get_uri_class($b['uri']);
if (empty($uri)) {
Logger::debug('Not a bluesky post', ['uri' => $b['uri']]);
return;
}
bluesky_delete_post($b['uri'], $b['uid']);
return;
}
$root = bluesky_get_uri_class($b['parent-uri']);
$parent = bluesky_get_uri_class($b['thr-parent']);
if (empty($root) || empty($parent)) {
Logger::debug('No bluesky post', ['parent' => $b['parent'], 'thr-parent' => $b['thr-parent']]);
return;
}
if ($b['gravity'] == Item::GRAVITY_COMMENT) {
Logger::debug('Posting comment', ['root' => $root, 'parent' => $parent]);
bluesky_create_post($b, $root, $parent);
return;
} elseif (in_array($b['verb'], [Activity::LIKE, Activity::ANNOUNCE])) {
bluesky_create_activity($b, $parent);
}
return;
} elseif ($b['private'] || !strstr($b['postopts'], 'bluesky')) {
return;
}
bluesky_create_post($b);
}
function bluesky_create_activity(array $item, stdClass $parent = null)
{
$uid = $item['uid'];
$token = bluesky_get_token($uid);
if (empty($token)) {
return;
}
$did = DI::pConfig()->get($uid, 'bluesky', 'did');
if ($item['verb'] == Activity::LIKE) {
$record = [
'subject' => $parent,
'createdAt' => DateTimeFormat::utcNow(DateTimeFormat::ATOM),
'$type' => 'app.bsky.feed.like'
];
$post = [
'collection' => 'app.bsky.feed.like',
'repo' => $did,
'record' => $record
];
} elseif ($item['verb'] == Activity::ANNOUNCE) {
$record = [
'subject' => $parent,
'createdAt' => DateTimeFormat::utcNow(DateTimeFormat::ATOM),
'$type' => 'app.bsky.feed.repost'
];
$post = [
'collection' => 'app.bsky.feed.repost',
'repo' => $did,
'record' => $record
];
}
$activity = bluesky_xrpc_post($uid, 'com.atproto.repo.createRecord', $post);
if (empty($activity)) {
return;
}
Logger::debug('Activity done', ['return' => $activity]);
$uri = bluesky_get_uri($activity);
Item::update(['extid' => $uri], ['id' => $item['id']]);
Logger::debug('Set extid', ['id' => $item['id'], 'extid' => $activity]);
}
function bluesky_create_post(array $item, stdClass $root = null, stdClass $parent = null)
{
$uid = $item['uid'];
$token = bluesky_get_token($uid);
if (empty($token)) {
return;
}
// Try to fetch the language from the post itself
if (!empty($item['language'])) {
$language = array_key_first(json_decode($item['language'], true));
} else {
$language = '';
}
$did = DI::pConfig()->get($uid, 'bluesky', 'did');
$urls = bluesky_get_urls(Post\Media::removeFromBody($item['body']));
$item['body'] = $urls['body'];
$msg = Plaintext::getPost($item, 300, false, BBCode::BLUESKY);
foreach ($msg['parts'] as $key => $part) {
$facets = bluesky_get_facets($part, $urls['urls']);
$record = [
'text' => $facets['body'],
'$type' => 'app.bsky.feed.post',
'createdAt' => DateTimeFormat::utcNow(DateTimeFormat::ATOM),
];
if (!empty($language)) {
$record['langs'] = [$language];
}
if (!empty($facets['facets'])) {
$record['facets'] = $facets['facets'];
}
if (!empty($root)) {
$record['reply'] = ['root' => $root, 'parent' => $parent];
}
if ($key == count($msg['parts']) - 1) {
$record = bluesky_add_embed($uid, $msg, $record);
if (empty($record)) {
if (Worker::getRetrial() < 3) {
Worker::defer();
}
return;
}
}
$post = [
'collection' => 'app.bsky.feed.post',
'repo' => $did,
'record' => $record
];
$parent = bluesky_xrpc_post($uid, 'com.atproto.repo.createRecord', $post);
if (empty($parent)) {
if ($part == 0) {
Worker::defer();
}
return;
}
Logger::debug('Posting done', ['return' => $parent]);
if (empty($root)) {
$root = $parent;
}
if (($key == 0) && ($item['gravity'] != Item::GRAVITY_PARENT)) {
$uri = bluesky_get_uri($parent);
Item::update(['extid' => $uri], ['id' => $item['id']]);
Logger::debug('Set extid', ['id' => $item['id'], 'extid' => $uri]);
}
}
}
function bluesky_get_urls(string $body): array
{
// Remove all hashtag and mention links
$body = preg_replace("/([@!])\[url\=(.*?)\](.*?)\[\/url\]/ism", '$1$3', $body);
$body = BBCode::expandVideoLinks($body);
$urls = [];
// Search for hash tags
if (preg_match_all("/#\[url\=(https?:.*?)\](.*?)\[\/url\]/ism", $body, $matches, PREG_SET_ORDER)) {
foreach ($matches as $match) {
$text = '#' . $match[2];
$urls[] = ['tag' => $match[2], 'text' => $text, 'hash' => $text];
$body = str_replace($match[0], $text, $body);
}
}
// Search for pure links
if (preg_match_all("/\[url\](https?:.*?)\[\/url\]/ism", $body, $matches, PREG_SET_ORDER)) {
foreach ($matches as $match) {
$text = Strings::getStyledURL($match[1]);
$hash = bluesky_get_hash_for_url($match[0], mb_strlen($text));
$urls[] = ['url' => $match[1], 'text' => $text, 'hash' => $hash];
$body = str_replace($match[0], $hash, $body);
}
}
// Search for links with descriptions
if (preg_match_all("/\[url\=(https?:.*?)\](.*?)\[\/url\]/ism", $body, $matches, PREG_SET_ORDER)) {
foreach ($matches as $match) {
if ($match[1] == $match[2]) {
$text = Strings::getStyledURL($match[1]);
} else {
$text = $match[2];
}
if (mb_strlen($text) < 100) {
$hash = bluesky_get_hash_for_url($match[0], mb_strlen($text));
$urls[] = ['url' => $match[1], 'text' => $text, 'hash' => $hash];
$body = str_replace($match[0], $hash, $body);
} else {
$text = Strings::getStyledURL($match[1]);
$hash = bluesky_get_hash_for_url($match[0], mb_strlen($text));
$urls[] = ['url' => $match[1], 'text' => $text, 'hash' => $hash];
$body = str_replace($match[0], $text . ' ' . $hash, $body);
}
}
}
return ['body' => $body, 'urls' => $urls];
}
function bluesky_get_hash_for_url(string $text, int $linklength): string
{
if ($linklength <= 10) {
return '|' . hash('crc32', $text) . '|';
}
return substr('|' . hash('crc32', $text) . base64_encode($text), 0, $linklength - 2) . '|';
}
function bluesky_get_facets(string $body, array $urls): array
{
$facets = [];
foreach ($urls as $url) {
$pos = strpos($body, $url['hash']);
if ($pos === false) {
continue;
}
if ($pos > 0) {
$prefix = substr($body, 0, $pos);
} else {
$prefix = '';
}
$body = $prefix . $url['text'] . substr($body, $pos + strlen($url['hash']));
$facet = new stdClass;
$facet->index = new stdClass;
$facet->index->byteEnd = $pos + strlen($url['text']);
$facet->index->byteStart = $pos;
$feature = new stdClass;
$type = '$type';
if (!empty($url['tag'])) {
$feature->tag = $url['tag'];
$feature->$type = 'app.bsky.richtext.facet#tag';
} elseif (!empty($url['url'])) {
$feature->uri = $url['url'];
$feature->$type = 'app.bsky.richtext.facet#link';
} else {
continue;
}
$facet->features = [$feature];
$facets[] = $facet;
}
return ['facets' => $facets, 'body' => $body];
}
function bluesky_add_embed(int $uid, array $msg, array $record): array
{
if (($msg['type'] != 'link') && !empty($msg['images'])) {
$images = [];
foreach ($msg['images'] as $image) {
if (count($images) == 4) {
continue;
}
$photo = Photo::selectFirst([], ['id' => $image['id']]);
$blob = bluesky_upload_blob($uid, $photo);
if (empty($blob)) {
return [];
}
$images[] = ['alt' => $image['description'] ?? '', 'image' => $blob];
}
if (!empty($images)) {
$record['embed'] = ['$type' => 'app.bsky.embed.images', 'images' => $images];
}
} elseif ($msg['type'] == 'link') {
$record['embed'] = [
'$type' => 'app.bsky.embed.external',
'external' => [
'uri' => $msg['url'],
'title' => $msg['title'] ?? '',
'description' => $msg['description'] ?? '',
]
];
if (!empty($msg['image'])) {
$photo = Photo::createPhotoForExternalResource($msg['image']);
$blob = bluesky_upload_blob($uid, $photo);
if (!empty($blob)) {
$record['embed']['external']['thumb'] = $blob;
}
}
}
return $record;
}
function bluesky_upload_blob(int $uid, array $photo): ?stdClass
{
$retrial = Worker::getRetrial();
$content = Photo::getImageForPhoto($photo);
$picture = new Image($content, $photo['type']);
$height = $picture->getHeight();
$width = $picture->getWidth();
$size = strlen($content);
$picture = Photo::resizeToFileSize($picture, BLUESKY_IMAGE_SIZE[$retrial]);
$new_height = $picture->getHeight();
$new_width = $picture->getWidth();
$content = $picture->asString();
$new_size = strlen($content);
Logger::info('Uploading', ['uid' => $uid, 'retrial' => $retrial, 'height' => $new_height, 'width' => $new_width, 'size' => $new_size, 'orig-height' => $height, 'orig-width' => $width, 'orig-size' => $size]);
$data = bluesky_post($uid, '/xrpc/com.atproto.repo.uploadBlob', $content, ['Content-type' => $photo['type'], 'Authorization' => ['Bearer ' . bluesky_get_token($uid)]]);
if (empty($data)) {
Logger::info('Uploading failed', ['uid' => $uid, 'retrial' => $retrial, 'height' => $new_height, 'width' => $new_width, 'size' => $new_size, 'orig-height' => $height, 'orig-width' => $width, 'orig-size' => $size]);
return null;
}
Logger::debug('Uploaded blob', ['return' => $data, 'uid' => $uid, 'retrial' => $retrial, 'height' => $new_height, 'width' => $new_width, 'size' => $new_size, 'orig-height' => $height, 'orig-width' => $width, 'orig-size' => $size]);
return $data->blob;
}
function bluesky_delete_post(string $uri, int $uid)
{
$parts = bluesky_get_uri_parts($uri);
if (empty($parts)) {
Logger::debug('No uri delected', ['uri' => $uri]);
return;
}
bluesky_xrpc_post($uid, 'com.atproto.repo.deleteRecord', $parts);
Logger::debug('Deleted', ['parts' => $parts]);
}
function bluesky_fetch_timeline(int $uid, int $last_poll)
{
$data = bluesky_xrpc_get($uid, 'app.bsky.feed.getTimeline');
if (empty($data)) {
return;
}
if (empty($data->feed)) {
return;
}
foreach (array_reverse($data->feed) as $entry) {
bluesky_process_post($entry->post, $uid, Item::PR_NONE, 0, $last_poll);
if (!empty($entry->reason)) {
bluesky_process_reason($entry->reason, bluesky_get_uri($entry->post), $uid);
}
}
// @todo Support paging
// [cursor] => 1684670516000::bafyreidq3ilwslmlx72jf5vrk367xcc63s6lrhzlyup2bi3zwcvso6w2vi
}
function bluesky_process_reason(stdClass $reason, string $uri, int $uid)
{
$type = '$type';
if ($reason->$type != 'app.bsky.feed.defs#reasonRepost') {
return;
}
$contact = bluesky_get_contact($reason->by, $uid, $uid);
$item = [
'network' => Protocol::BLUESKY,
'uid' => $uid,
'wall' => false,
'uri' => $reason->by->did . '/app.bsky.feed.repost/' . $reason->indexedAt,
'private' => Item::UNLISTED,
'verb' => Activity::POST,
'contact-id' => $contact['id'],
'author-name' => $contact['name'],
'author-link' => $contact['url'],
'author-avatar' => $contact['avatar'],
'verb' => Activity::ANNOUNCE,
'body' => Activity::ANNOUNCE,
'gravity' => Item::GRAVITY_ACTIVITY,
'object-type' => Activity\ObjectType::NOTE,
'thr-parent' => $uri,
];
if (Post::exists(['uri' => $item['uri'], 'uid' => $uid])) {
return;
}
$item['guid'] = Item::guidFromUri($item['uri'], $contact['alias']);
$item['owner-name'] = $item['author-name'];
$item['owner-link'] = $item['author-link'];
$item['owner-avatar'] = $item['author-avatar'];
if (Item::insert($item)) {
$cdata = Contact::getPublicAndUserContactID($contact['id'], $uid);
Item::update(['post-reason' => Item::PR_ANNOUNCEMENT, 'causer-id' => $cdata['public']], ['uri' => $uri, 'uid' => $uid]);
}
}
function bluesky_fetch_notifications(int $uid, int $last_poll)
{
$data = bluesky_xrpc_get($uid, 'app.bsky.notification.listNotifications');
if (empty($data->notifications)) {
return;
}
foreach ($data->notifications as $notification) {
$uri = bluesky_get_uri($notification);
if (Post::exists(['uri' => $uri, 'uid' => $uid]) || Post::exists(['extid' => $uri, 'uid' => $uid])) {
Logger::debug('Notification already processed', ['uid' => $uid, 'reason' => $notification->reason, 'uri' => $uri, 'indexedAt' => $notification->indexedAt]);
continue;
}
Logger::debug('Process notification', ['uid' => $uid, 'reason' => $notification->reason, 'uri' => $uri, 'indexedAt' => $notification->indexedAt]);
switch ($notification->reason) {
case 'like':
$item = bluesky_get_header($notification, $uri, $uid, $uid);
$item['gravity'] = Item::GRAVITY_ACTIVITY;
$item['body'] = $item['verb'] = Activity::LIKE;
$item['thr-parent'] = bluesky_get_uri($notification->record->subject);
$item['thr-parent'] = bluesky_fetch_missing_post($item['thr-parent'], $uid, $uid, $item['contact-id'], 0, $last_poll);
if (!empty($item['thr-parent'])) {
$data = Item::insert($item);
Logger::debug('Got like', ['uid' => $uid, 'result' => $data, 'uri' => $uri]);
} else {
Logger::info('Thread parent not found', ['uid' => $uid, 'parent' => $item['thr-parent'], 'uri' => $uri]);
}
break;
case 'repost':
$item = bluesky_get_header($notification, $uri, $uid, $uid);
$item['gravity'] = Item::GRAVITY_ACTIVITY;
$item['body'] = $item['verb'] = Activity::ANNOUNCE;
$item['thr-parent'] = bluesky_get_uri($notification->record->subject);
$item['thr-parent'] = bluesky_fetch_missing_post($item['thr-parent'], $uid, $uid, $item['contact-id'], 0, $last_poll);
if (!empty($item['thr-parent'])) {
$data = Item::insert($item);
Logger::debug('Got repost', ['uid' => $uid, 'result' => $data, 'uri' => $uri]);
} else {
Logger::info('Thread parent not found', ['uid' => $uid, 'parent' => $item['thr-parent'], 'uri' => $uri]);
}
break;
case 'follow':
$contact = bluesky_get_contact($notification->author, $uid, $uid);
Logger::debug('New follower', ['uid' => $uid, 'nick' => $contact['nick'], 'uri' => $uri]);
break;
case 'mention':
$data = bluesky_process_post($notification, $uid, Item::PR_PUSHED, 0, $last_poll);
Logger::debug('Got mention', ['uid' => $uid, 'result' => $data, 'uri' => $uri]);
break;
case 'reply':
$data = bluesky_process_post($notification, $uid, Item::PR_PUSHED, 0, $last_poll);
Logger::debug('Got reply', ['uid' => $uid, 'result' => $data, 'uri' => $uri]);
break;
case 'quote':
$data = bluesky_process_post($notification, $uid, Item::PR_PUSHED, 0, $last_poll);
Logger::debug('Got quote', ['uid' => $uid, 'result' => $data, 'uri' => $uri]);
break;
default:
Logger::notice('Unhandled reason', ['reason' => $notification->reason, 'uri' => $uri]);
break;
}
}
}
function bluesky_fetch_feed(int $uid, string $feed, int $last_poll)
{
$data = bluesky_xrpc_get($uid, 'app.bsky.feed.getFeed', ['feed' => $feed]);
if (empty($data)) {
return;
}
if (empty($data->feed)) {
return;
}
$feeddata = bluesky_xrpc_get($uid, 'app.bsky.feed.getFeedGenerator', ['feed' => $feed]);
if (!empty($feeddata)) {
$feedurl = $feeddata->view->uri;
$feedname = $feeddata->view->displayName;
} else {
$feedurl = $feed;
$feedname = $feed;
}
foreach (array_reverse($data->feed) as $entry) {
$contact = bluesky_get_contact($entry->post->author, 0, $uid);
$languages = $entry->post->record->langs ?? [];
if (!Relay::isWantedLanguage($entry->post->record->text, 0, $contact['id'] ?? 0, $languages)) {
Logger::debug('Unwanted language detected', ['text' => $entry->post->record->text]);
continue;
}
$id = bluesky_process_post($entry->post, $uid, Item::PR_TAG, 0, $last_poll);
if (!empty($id)) {
$post = Post::selectFirst(['uri-id'], ['id' => $id]);
if (!empty($post['uri-id'])) {
$stored = Post\Category::storeFileByURIId($post['uri-id'], $uid, Post\Category::SUBCRIPTION, $feedname, $feedurl);
Logger::debug('Stored tag subscription for user', ['uri-id' => $post['uri-id'], 'uid' => $uid, 'name' => $feedname, 'url' => $feedurl, 'stored' => $stored]);
} else {
Logger::notice('Post not found', ['id' => $id, 'entry' => $entry]);
}
}
if (!empty($entry->reason)) {
bluesky_process_reason($entry->reason, bluesky_get_uri($entry->post), $uid);
}
}
}
function bluesky_process_post(stdClass $post, int $uid, int $post_reason, int $level, int $last_poll): int
{
$uri = bluesky_get_uri($post);
if ($id = Post::selectFirst(['id'], ['uri' => $uri, 'uid' => $uid])) {
return $id['id'];
}
if ($id = Post::selectFirst(['id'], ['extid' => $uri, 'uid' => $uid])) {
return $id['id'];
}
Logger::debug('Importing post', ['uid' => $uid, 'indexedAt' => $post->indexedAt, 'uri' => $post->uri, 'cid' => $post->cid, 'root' => $post->record->reply->root ?? '']);
$item = bluesky_get_header($post, $uri, $uid, $uid);
$item = bluesky_get_content($item, $post->record, $uri, $uid, $uid, $level, $last_poll);
if (empty($item)) {
return 0;
}
if (!empty($post->embed)) {
$item = bluesky_add_media($post->embed, $item, $uid, $level, $last_poll);
}
if (empty($item['post-reason'])) {
$item['post-reason'] = $post_reason;
}
return Item::insert($item);
}
function bluesky_get_header(stdClass $post, string $uri, int $uid, int $fetch_uid): array
{
$parts = bluesky_get_uri_parts($uri);
if (empty($post->author)) {
return [];
}
$contact = bluesky_get_contact($post->author, $uid, $fetch_uid);
$item = [
'network' => Protocol::BLUESKY,
'uid' => $uid,
'wall' => false,
'uri' => $uri,
'guid' => $post->cid,
'private' => Item::UNLISTED,
'verb' => Activity::POST,
'contact-id' => $contact['id'],
'author-name' => $contact['name'],
'author-link' => $contact['url'],
'author-avatar' => $contact['avatar'],
'plink' => $contact['alias'] . '/post/' . $parts->rkey,
'source' => json_encode($post),
];
$item['uri-id'] = ItemURI::getIdByURI($uri);
$item['owner-name'] = $item['author-name'];
$item['owner-link'] = $item['author-link'];
$item['owner-avatar'] = $item['author-avatar'];
if (in_array($contact['rel'], [Contact::SHARING, Contact::FRIEND])) {
$item['post-reason'] = Item::PR_FOLLOWER;
}
return $item;
}
function bluesky_get_content(array $item, stdClass $record, string $uri, int $uid, int $fetch_uid, int $level, int $last_poll): array
{
if (empty($item)) {
return [];
}
if (!empty($record->reply)) {
$item['parent-uri'] = bluesky_get_uri($record->reply->root);
if ($item['parent-uri'] != $uri) {
$item['parent-uri'] = bluesky_fetch_missing_post($item['parent-uri'], $uid, $fetch_uid, $item['contact-id'], $level, $last_poll);
if (empty($item['parent-uri'])) {
return [];
}
}
$item['thr-parent'] = bluesky_get_uri($record->reply->parent);
if (!in_array($item['thr-parent'], [$uri, $item['parent-uri']])) {
$item['thr-parent'] = bluesky_fetch_missing_post($item['thr-parent'], $uid, $fetch_uid, $item['contact-id'], $level, $last_poll, $item['parent-uri']);
if (empty($item['thr-parent'])) {
return [];
}
}
}
$item['body'] = bluesky_get_text($record, $item['uri-id']);
$item['created'] = DateTimeFormat::utc($record->createdAt, DateTimeFormat::MYSQL);
$item['transmitted-languages'] = $record->langs ?? [];
if (($last_poll != 0) && strtotime($item['created']) > $last_poll) {
$item['received'] = $item['created'];
}
return $item;
}
function bluesky_get_text(stdClass $record, int $uri_id): string
{
$text = $record->text ?? '';
if (empty($record->facets)) {
return $text;
}
$facets = [];
foreach ($record->facets as $facet) {
$facets[$facet->index->byteStart] = $facet;
}
krsort($facets);
foreach ($facets as $facet) {
$prefix = substr($text, 0, $facet->index->byteStart);
$linktext = substr($text, $facet->index->byteStart, $facet->index->byteEnd - $facet->index->byteStart);
$suffix = substr($text, $facet->index->byteEnd);
$url = '';
$type = '$type';
foreach ($facet->features as $feature) {
switch ($feature->$type) {
case 'app.bsky.richtext.facet#link':
$url = $feature->uri;
break;
case 'app.bsky.richtext.facet#mention':
$contact = Contact::getByURL($feature->did, null, ['id']);
if (!empty($contact['id'])) {
$url = DI::baseUrl() . '/contact/' . $contact['id'];
if (substr($linktext, 0, 1) == '@') {
$prefix .= '@';
$linktext = substr($linktext, 1);
}
}
break;
case 'app.bsky.richtext.facet#tag';
Tag::store($uri_id, Tag::HASHTAG, $feature->tag);
$url = DI::baseUrl() . '/search?tag=' . urlencode($feature->tag);
$linktext = '#' . $feature->tag;
break;
default:
Logger::notice('Unhandled feature type', ['type' => $feature->$type, 'feature' => $feature, 'record' => $record]);
break;
}
}
if (!empty($url)) {
$text = $prefix . '[url=' . $url . ']' . $linktext . '[/url]' . $suffix;
}
}
return $text;
}
function bluesky_add_media(stdClass $embed, array $item, int $fetch_uid, int $level, int $last_poll): array
{
$type = '$type';
switch ($embed->$type) {
case 'app.bsky.embed.images#view':
foreach ($embed->images as $image) {
$media = [
'uri-id' => $item['uri-id'],
'type' => Post\Media::IMAGE,
'url' => $image->fullsize,
'preview' => $image->thumb,
'description' => $image->alt,
];
Post\Media::insert($media);
}
break;
case 'app.bsky.embed.external#view':
$media = [
'uri-id' => $item['uri-id'],
'type' => Post\Media::HTML,
'url' => $embed->external->uri,
'name' => $embed->external->title,
'description' => $embed->external->description,
];
Post\Media::insert($media);
break;
case 'app.bsky.embed.record#view':
$uri = bluesky_get_uri($embed->record);
$shared = Post::selectFirst(['uri-id'], ['uri' => $uri, 'uid' => $item['uid']]);
if (empty($shared)) {
if (empty($embed->record->value)) {
Logger::info('Record has got no value', ['record' => $embed->record]);
break;
}
$shared = bluesky_get_header($embed->record, $uri, 0, $fetch_uid);
$shared = bluesky_get_content($shared, $embed->record->value, $uri, $item['uid'], $fetch_uid, $level, $last_poll);
if (!empty($shared)) {
if (!empty($embed->record->embeds)) {
foreach ($embed->record->embeds as $single) {
$shared = bluesky_add_media($single, $shared, $fetch_uid, $level, $last_poll);
}
}
Item::insert($shared);
}
}
if (!empty($shared['uri-id'])) {
$item['quote-uri-id'] = $shared['uri-id'];
}
break;
case 'app.bsky.embed.recordWithMedia#view':
$uri = bluesky_get_uri($embed->record->record);
$shared = Post::selectFirst(['uri-id'], ['uri' => $uri, 'uid' => $item['uid']]);
if (empty($shared)) {
$shared = bluesky_get_header($embed->record->record, $uri, 0, $fetch_uid);
$shared = bluesky_get_content($shared, $embed->record->record->value, $uri, $item['uid'], $fetch_uid, $level, $last_poll);
if (!empty($shared)) {
if (!empty($embed->record->record->embeds)) {
foreach ($embed->record->record->embeds as $single) {
$shared = bluesky_add_media($single, $shared, $fetch_uid, $level, $last_poll);
}
}
Item::insert($shared);
}
}
if (!empty($shared['uri-id'])) {
$item['quote-uri-id'] = $shared['uri-id'];
}
if (!empty($embed->media)) {
$item = bluesky_add_media($embed->media, $item, $fetch_uid, $level, $last_poll);
}
break;
default:
Logger::notice('Unhandled embed type', ['type' => $embed->$type, 'embed' => $embed]);
break;
}
return $item;
}
function bluesky_get_uri(stdClass $post): string
{
if (empty($post->cid)) {
Logger::info('Invalid URI', ['post' => $post]);
return '';
}
return $post->uri . ':' . $post->cid;
}
function bluesky_get_uri_class(string $uri): ?stdClass
{
if (empty($uri)) {
return null;
}
$elements = explode(':', $uri);
if (empty($elements) || ($elements[0] != 'at')) {
$post = Post::selectFirstPost(['extid'], ['uri' => $uri]);
return bluesky_get_uri_class($post['extid'] ?? '');
}
$class = new stdClass;
$class->cid = array_pop($elements);
$class->uri = implode(':', $elements);
if ((substr_count($class->uri, '/') == 2) && (substr_count($class->cid, '/') == 2)) {
$class->uri .= ':' . $class->cid;
$class->cid = '';
}
return $class;
}
function bluesky_get_uri_parts(string $uri): ?stdClass
{
$class = bluesky_get_uri_class($uri);
if (empty($class)) {
return null;
}
$parts = explode('/', substr($class->uri, 5));
$class = new stdClass;
$class->repo = $parts[0];
$class->collection = $parts[1];
$class->rkey = $parts[2];
return $class;
}
function bluesky_fetch_missing_post(string $uri, int $uid, int $fetch_uid, int $causer, int $level, int $last_poll = 0, string $fallback = ''): string
{
$fetched_uri = bluesky_fetch_post($uri, $uid);
if (!empty($fetched_uri)) {
return $fetched_uri;
}
if (++$level > 100) {
Logger::info('Recursion level too deep', ['level' => $level, 'uid' => $uid, 'uri' => $uri, 'fallback' => $fallback]);
// When the level is too deep we will fallback to the parent uri.
// Allthough the threading won't be correct, we at least had stored all posts and won't try again
return $fallback;
}
$class = bluesky_get_uri_class($uri);
$fetch_uri = $class->uri;
Logger::debug('Fetch missing post', ['level' => $level, 'uid' => $uid, 'uri' => $uri]);
$data = bluesky_xrpc_get($fetch_uid, 'app.bsky.feed.getPostThread', ['uri' => $fetch_uri]);
if (empty($data)) {
Logger::info('Thread was not fetched', ['level' => $level, 'uid' => $uid, 'uri' => $uri, 'fallback' => $fallback]);
return $fallback;
}
Logger::debug('Reply count', ['level' => $level, 'uid' => $uid, 'uri' => $uri]);
if ($causer != 0) {
$cdata = Contact::getPublicAndUserContactID($causer, $uid);
} else {
$cdata = [];
}
return bluesky_process_thread($data->thread, $uid, $fetch_uid, $cdata, $level, $last_poll);
}
function bluesky_fetch_post(string $uri, int $uid): string
{
if (Post::exists(['uri' => $uri, 'uid' => [$uid, 0]])) {
Logger::debug('Post exists', ['uri' => $uri]);
return $uri;
}
$reply = Post::selectFirst(['uri'], ['extid' => $uri, 'uid' => [$uid, 0]]);
if (!empty($reply['uri'])) {
Logger::debug('Post with extid exists', ['uri' => $uri]);
return $reply['uri'];
}
return '';
}
function bluesky_process_thread(stdClass $thread, int $uid, int $fetch_uid, array $cdata, int $level, int $last_poll): string
{
if (empty($thread->post)) {
Logger::info('Invalid post', ['post' => $thread]);
return '';
}
$uri = bluesky_get_uri($thread->post);
$fetched_uri = bluesky_fetch_post($uri, $uid);
if (empty($fetched_uri)) {
Logger::debug('Process missing post', ['uri' => $uri]);
$item = bluesky_get_header($thread->post, $uri, $uid, $uid);
$item = bluesky_get_content($item, $thread->post->record, $uri, $uid, $fetch_uid, $level, $last_poll);
if (!empty($item)) {
$item['post-reason'] = Item::PR_FETCHED;
if (!empty($cdata['public'])) {
$item['causer-id'] = $cdata['public'];
}
if (!empty($thread->post->embed)) {
$item = bluesky_add_media($thread->post->embed, $item, $uid, $level, $last_poll);
}
$id = Item::insert($item);
if (!$id) {
Logger::info('Item has not not been stored', ['uri' => $uri]);
return '';
}
Logger::debug('Stored item', ['id' => $id, 'uri' => $uri]);
} else {
Logger::info('Post has not not been fetched', ['uri' => $uri]);
return '';
}
} else {
Logger::debug('Post exists', ['uri' => $uri]);
$uri = $fetched_uri;
}
foreach ($thread->replies ?? [] as $reply) {
$reply_uri = bluesky_process_thread($reply, $uid, $fetch_uid, $cdata, $level, $last_poll);
Logger::debug('Reply has been processed', ['uri' => $uri, 'reply' => $reply_uri]);
}
return $uri;
}
function bluesky_get_contact(stdClass $author, int $uid, int $fetch_uid): array
{
$condition = ['network' => Protocol::BLUESKY, 'uid' => 0, 'url' => $author->did];
$contact = Contact::selectFirst(['id', 'updated'], $condition);
$update = empty($contact) || $contact['updated'] < DateTimeFormat::utc('now -24 hours');
$public_fields = $fields = bluesky_get_contact_fields($author, $fetch_uid, $update);
$public_fields['uid'] = 0;
$public_fields['rel'] = Contact::NOTHING;
if (empty($contact)) {
$cid = Contact::insert($public_fields);
} else {
$cid = $contact['id'];
Contact::update($public_fields, ['id' => $cid], true);
}
if ($uid != 0) {
$condition = ['network' => Protocol::BLUESKY, 'uid' => $uid, 'url' => $author->did];
$contact = Contact::selectFirst(['id', 'rel', 'uid'], $condition);
if (!isset($fields['rel']) && isset($contact['rel'])) {
$fields['rel'] = $contact['rel'];
} elseif (!isset($fields['rel'])) {
$fields['rel'] = Contact::NOTHING;
}
}
if (($uid != 0) && ($fields['rel'] != Contact::NOTHING)) {
if (empty($contact)) {
$cid = Contact::insert($fields);
} else {
$cid = $contact['id'];
Contact::update($fields, ['id' => $cid], true);
}
Logger::debug('Get user contact', ['id' => $cid, 'uid' => $uid, 'update' => $update]);
} else {
Logger::debug('Get public contact', ['id' => $cid, 'uid' => $uid, 'update' => $update]);
}
if (!empty($author->avatar)) {
Contact::updateAvatar($cid, $author->avatar);
}
return Contact::getById($cid);
}
function bluesky_get_contact_fields(stdClass $author, int $uid, bool $update): array
{
$fields = [
'uid' => $uid,
'network' => Protocol::BLUESKY,
'priority' => 1,
'writable' => true,
'blocked' => false,
'readonly' => false,
'pending' => false,
'url' => $author->did,
'nurl' => $author->did,
'alias' => BLUESKY_WEB . '/profile/' . $author->handle,
'name' => $author->displayName ?? $author->handle,
'nick' => $author->handle,
'addr' => $author->handle,
];
if (!$update) {
Logger::debug('Got contact fields', ['uid' => $uid, 'url' => $fields['url']]);
return $fields;
}
$fields['baseurl'] = bluesky_get_pds($author->did);
if (!empty($fields['baseurl'])) {
GServer::check($fields['baseurl'], Protocol::BLUESKY);
$fields['gsid'] = GServer::getID($fields['baseurl'], true);
}
$data = bluesky_xrpc_get($uid, 'app.bsky.actor.getProfile', ['actor' => $author->did]);
if (empty($data)) {
Logger::debug('Error fetching contact fields', ['uid' => $uid, 'url' => $fields['url']]);
return $fields;
}
$fields['updated'] = DateTimeFormat::utcNow(DateTimeFormat::MYSQL);
if (!empty($data->description)) {
$fields['about'] = HTML::toBBCode($data->description);
}
if (!empty($data->banner)) {
$fields['header'] = $data->banner;
}
if (!empty($data->viewer)) {
if (!empty($data->viewer->following) && !empty($data->viewer->followedBy)) {
$fields['rel'] = Contact::FRIEND;
} elseif (!empty($data->viewer->following) && empty($data->viewer->followedBy)) {
$fields['rel'] = Contact::SHARING;
} elseif (empty($data->viewer->following) && !empty($data->viewer->followedBy)) {
$fields['rel'] = Contact::FOLLOWER;
} else {
$fields['rel'] = Contact::NOTHING;
}
}
Logger::debug('Got updated contact fields', ['uid' => $uid, 'url' => $fields['url']]);
return $fields;
}
function bluesky_get_feeds(int $uid): array
{
$type = '$type';
$preferences = bluesky_get_preferences($uid);
foreach ($preferences->preferences as $preference) {
if ($preference->$type == 'app.bsky.actor.defs#savedFeedsPref') {
return $preference->pinned ?? [];
}
}
return [];
}
function bluesky_get_preferences(int $uid): stdClass
{
$cachekey = 'bluesky:preferences:' . $uid;
$data = DI::cache()->get($cachekey);
if (!is_null($data)) {
return $data;
}
$data = bluesky_xrpc_get($uid, 'app.bsky.actor.getPreferences');
DI::cache()->set($cachekey, $data, Duration::HOUR);
return $data;
}
function bluesky_get_did(string $handle): string
{
$data = bluesky_get(BLUESKY_PDS . '/xrpc/com.atproto.identity.resolveHandle?handle=' . urlencode($handle));
if (empty($data)) {
return '';
}
Logger::debug('Got DID', ['return' => $data]);
return $data->did;
}
function bluesky_get_user_pds(int $uid): string
{
$pds = DI::pConfig()->get($uid, 'bluesky', 'pds');
if (!empty($pds)) {
return $pds;
}
$did = DI::pConfig()->get($uid, 'bluesky', 'did');
if (empty($did)) {
Logger::notice('Empty did for user', ['uid' => $uid]);
return '';
}
$pds = bluesky_get_pds($did);
DI::pConfig()->set($uid, 'bluesky', 'pds', $pds);
return $pds;
}
function bluesky_get_pds(string $did): ?string
{
$data = bluesky_get(BLUESKY_DIRECTORY . '/' . $did);
if (empty($data) || empty($data->service)) {
return null;
}
foreach ($data->service as $service) {
if (($service->id == '#atproto_pds') && ($service->type == 'AtprotoPersonalDataServer') && !empty($service->serviceEndpoint)) {
return $service->serviceEndpoint;
}
}
return null;
}
function bluesky_get_token(int $uid): string
{
$token = DI::pConfig()->get($uid, 'bluesky', 'access_token');
$created = DI::pConfig()->get($uid, 'bluesky', 'token_created');
if (empty($token)) {
return '';
}
if ($created + 300 < time()) {
return bluesky_refresh_token($uid);
}
return $token;
}
function bluesky_refresh_token(int $uid): string
{
$token = DI::pConfig()->get($uid, 'bluesky', 'refresh_token');
$data = bluesky_post($uid, '/xrpc/com.atproto.server.refreshSession', '', ['Authorization' => ['Bearer ' . $token]]);
if (empty($data)) {
return '';
}
Logger::debug('Refreshed token', ['return' => $data]);
DI::pConfig()->set($uid, 'bluesky', 'access_token', $data->accessJwt);
DI::pConfig()->set($uid, 'bluesky', 'refresh_token', $data->refreshJwt);
DI::pConfig()->set($uid, 'bluesky', 'token_created', time());
return $data->accessJwt;
}
function bluesky_create_token(int $uid, string $password): string
{
$did = DI::pConfig()->get($uid, 'bluesky', 'did');
$data = bluesky_post($uid, '/xrpc/com.atproto.server.createSession', json_encode(['identifier' => $did, 'password' => $password]), ['Content-type' => 'application/json']);
if (empty($data)) {
DI::pConfig()->set($uid, 'bluesky', 'status', BLUEKSY_STATUS_TOKEN_FAIL);
return '';
}
Logger::debug('Created token', ['return' => $data]);
DI::pConfig()->set($uid, 'bluesky', 'access_token', $data->accessJwt);
DI::pConfig()->set($uid, 'bluesky', 'refresh_token', $data->refreshJwt);
DI::pConfig()->set($uid, 'bluesky', 'token_created', time());
DI::pConfig()->set($uid, 'bluesky', 'status', BLUEKSY_STATUS_TOKEN_OK);
return $data->accessJwt;
}
function bluesky_xrpc_post(int $uid, string $url, $parameters): ?stdClass
{
return bluesky_post($uid, '/xrpc/' . $url, json_encode($parameters), ['Content-type' => 'application/json', 'Authorization' => ['Bearer ' . bluesky_get_token($uid)]]);
}
function bluesky_post(int $uid, string $url, string $params, array $headers): ?stdClass
{
try {
$curlResult = DI::httpClient()->post(bluesky_get_user_pds($uid) . $url, $params, $headers);
} catch (\Exception $e) {
Logger::notice('Exception on post', ['exception' => $e]);
DI::pConfig()->set($uid, 'bluesky', 'status', BLUEKSY_STATUS_API_FAIL);
return null;
}
if (!$curlResult->isSuccess()) {
Logger::notice('API Error', ['error' => json_decode($curlResult->getBody()) ?: $curlResult->getBody()]);
DI::pConfig()->set($uid, 'bluesky', 'status', BLUEKSY_STATUS_API_FAIL);
return null;
}
DI::pConfig()->set($uid, 'bluesky', 'status', BLUEKSY_STATUS_SUCCESS);
return json_decode($curlResult->getBody());
}
function bluesky_xrpc_get(int $uid, string $url, array $parameters = []): ?stdClass
{
if (!empty($parameters)) {
$url .= '?' . http_build_query($parameters);
}
$data = bluesky_get(bluesky_get_user_pds($uid) . '/xrpc/' . $url, HttpClientAccept::JSON, [HttpClientOptions::HEADERS => ['Authorization' => ['Bearer ' . bluesky_get_token($uid)]]]);
DI::pConfig()->set($uid, 'bluesky', 'status', is_null($data) ? BLUEKSY_STATUS_API_FAIL : BLUEKSY_STATUS_SUCCESS);
return $data;
}
function bluesky_get(string $url, string $accept_content = HttpClientAccept::DEFAULT, array $opts = []): ?stdClass
{
try {
$curlResult = DI::httpClient()->get($url, $accept_content, $opts);
} catch (\Exception $e) {
Logger::notice('Exception on get', ['exception' => $e]);
return null;
}
if (!$curlResult->isSuccess()) {
Logger::notice('API Error', ['error' => json_decode($curlResult->getBody()) ?: $curlResult->getBody()]);
return null;
}
return json_decode($curlResult->getBody());
}

16
bluesky/bluesky_feed.php Normal file
View file

@ -0,0 +1,16 @@
<?php
use Friendica\Core\Logger;
function bluesky_feed_run($argv, $argc)
{
require_once 'addon/bluesky/bluesky.php';
if ($argc != 4) {
return;
}
Logger::debug('Importing feed - start', ['user' => $argv[1], 'feed' => $argv[2], 'last_poll' => $argv[3]]);
bluesky_fetch_feed($argv[1], $argv[2], $argv[3]);
Logger::debug('Importing feed - done', ['user' => $argv[1], 'feed' => $argv[2], 'last_poll' => $argv[3]]);
}

View file

@ -0,0 +1,16 @@
<?php
use Friendica\Core\Logger;
function bluesky_notifications_run($argv, $argc)
{
require_once 'addon/bluesky/bluesky.php';
if ($argc != 3) {
return;
}
Logger::notice('importing notifications - start', ['user' => $argv[1], 'last_poll' => $argv[2]]);
bluesky_fetch_notifications($argv[1], $argv[2]);
Logger::notice('importing notifications - done', ['user' => $argv[1], 'last_poll' => $argv[2]]);
}

View file

@ -0,0 +1,16 @@
<?php
use Friendica\Core\Logger;
function bluesky_timeline_run($argv, $argc)
{
require_once 'addon/bluesky/bluesky.php';
if ($argc != 3) {
return;
}
Logger::notice('importing timeline - start', ['user' => $argv[1], 'last_poll' => $argv[2]]);
bluesky_fetch_timeline($argv[1], $argv[2]);
Logger::notice('importing timeline - done', ['user' => $argv[1], 'last_poll' => $argv[2]]);
}

116
bluesky/lang/C/messages.po Normal file
View file

@ -0,0 +1,116 @@
# ADDON bluesky
# Copyright (C)
# This file is distributed under the same license as the Friendica bluesky addon package.
#
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-12-06 06:30+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: bluesky.php:336
msgid "Enable Bluesky Post Addon"
msgstr ""
#: bluesky.php:337
msgid "Post to Bluesky by default"
msgstr ""
#: bluesky.php:338
msgid "Import the remote timeline"
msgstr ""
#: bluesky.php:339
msgid "Import the pinned feeds"
msgstr ""
#: bluesky.php:339
msgid ""
"When activated, Posts will be imported from all the feeds that you pinned in "
"Bluesky."
msgstr ""
#: bluesky.php:340
msgid "Personal Data Server"
msgstr ""
#: bluesky.php:340
msgid "The personal data server (PDS) is the system that hosts your profile."
msgstr ""
#: bluesky.php:341
msgid "Bluesky handle"
msgstr ""
#: bluesky.php:342
msgid "Bluesky DID"
msgstr ""
#: bluesky.php:342
msgid ""
"This is the unique identifier. It will be fetched automatically, when the "
"handle is entered."
msgstr ""
#: bluesky.php:343
msgid "Bluesky app password"
msgstr ""
#: bluesky.php:343
msgid ""
"Please don't add your real password here, but instead create a specific app "
"password in the Bluesky settings."
msgstr ""
#: bluesky.php:349
msgid "Bluesky Import/Export"
msgstr ""
#: bluesky.php:359
msgid ""
"You are not authenticated. Please enter your handle and the app password."
msgstr ""
#: bluesky.php:379
msgid ""
"You are authenticated to Bluesky. For security reasons the password isn't "
"stored."
msgstr ""
#: bluesky.php:381
msgid ""
"The communication with the personal data server service (PDS) is established."
msgstr ""
#: bluesky.php:383
msgid "Communication issues with the personal data server service (PDS)."
msgstr ""
#: bluesky.php:385
msgid ""
"The DID for the provided handle could not be detected. Please check if you "
"entered the correct handle."
msgstr ""
#: bluesky.php:387
msgid "The personal data server service (PDS) could not be detected."
msgstr ""
#: bluesky.php:389
msgid ""
"The authentication with the provided handle and password failed. Please "
"check if you entered the correct password."
msgstr ""
#: bluesky.php:457
msgid "Post to Bluesky"
msgstr ""

View file

@ -0,0 +1,89 @@
# ADDON bluesky
# Copyright (C)
# This file is distributed under the same license as the Friendica bluesky addon package.
#
#
# Translators:
# Tobias Diekershoff <tobias.diekershoff@gmx.net>, 2023
# haheute <haheute@posteo.de>, 2023
# Raroun, 2023
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-05-24 05:52+0000\n"
"PO-Revision-Date: 2023-05-24 06:02+0000\n"
"Last-Translator: Raroun, 2023\n"
"Language-Team: German (https://app.transifex.com/Friendica/teams/12172/de/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: de\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: bluesky.php:100
msgid ""
"You are authenticated to Bluesky. For security reasons the password isn't "
"stored."
msgstr ""
"Du bist auf Bluesky authentifiziert. Aus Sicherheitsgründen wird das "
"Passwort nicht gespeichert."
#: bluesky.php:100
msgid "You are not authenticated. Please enter the app password."
msgstr ""
"Du bist derzeit nicht authentifiziert. Bitte gib dein App Passwort ein."
#: bluesky.php:104
msgid "Enable Bluesky Post Addon"
msgstr "Bluesky Post Addon aktivieren"
#: bluesky.php:105
msgid "Post to Bluesky by default"
msgstr "Standardmäßig auf Bluesky veröffentlichen"
#: bluesky.php:106
msgid "Import the remote timeline"
msgstr "Importiere die entfernte Timeline"
#: bluesky.php:107
msgid "Bluesky host"
msgstr "Bluesky Host"
#: bluesky.php:108
msgid "Bluesky handle"
msgstr "Bluesky Handle"
#: bluesky.php:109
msgid "Bluesky DID"
msgstr "Bluesky DID"
#: bluesky.php:109
msgid ""
"This is the unique identifier. It will be fetched automatically, when the "
"handle is entered."
msgstr ""
"Sobald das Handle eingegeben ist, wird diese einzigartige Kennung "
"automatisch abgerufen."
#: bluesky.php:110
msgid "Bluesky app password"
msgstr "Bluesky App Passwort"
#: bluesky.php:110
msgid ""
"Please don't add your real password here, but instead create a specific app "
"password in the Bluesky settings."
msgstr ""
"Bitte verwende hier nicht dein echtes Passwort, sondern stattdessen ein "
"speziell für diese App in den Bluesky Einstellungen festgelegtes Passwort."
#: bluesky.php:116
msgid "Bluesky Import/Export"
msgstr "Bluesky Import/Export"
#: bluesky.php:167
msgid "Post to Bluesky"
msgstr "Auf Bluesky veröffentlichen"

View file

@ -0,0 +1,20 @@
<?php
if(! function_exists("string_plural_select_de")) {
function string_plural_select_de($n){
$n = intval($n);
return intval($n != 1);
}}
$a->strings['You are authenticated to Bluesky. For security reasons the password isn\'t stored.'] = 'Du bist auf Bluesky authentifiziert. Aus Sicherheitsgründen wird das Passwort nicht gespeichert.';
$a->strings['You are not authenticated. Please enter the app password.'] = 'Du bist derzeit nicht authentifiziert. Bitte gib dein App Passwort ein.';
$a->strings['Enable Bluesky Post Addon'] = 'Bluesky Post Addon aktivieren';
$a->strings['Post to Bluesky by default'] = 'Standardmäßig auf Bluesky veröffentlichen';
$a->strings['Import the remote timeline'] = 'Importiere die entfernte Timeline';
$a->strings['Bluesky host'] = 'Bluesky Host';
$a->strings['Bluesky handle'] = 'Bluesky Handle';
$a->strings['Bluesky DID'] = 'Bluesky DID';
$a->strings['This is the unique identifier. It will be fetched automatically, when the handle is entered.'] = 'Sobald das Handle eingegeben ist, wird diese einzigartige Kennung automatisch abgerufen.';
$a->strings['Bluesky app password'] = 'Bluesky App Passwort';
$a->strings['Please don\'t add your real password here, but instead create a specific app password in the Bluesky settings.'] = 'Bitte verwende hier nicht dein echtes Passwort, sondern stattdessen ein speziell für diese App in den Bluesky Einstellungen festgelegtes Passwort.';
$a->strings['Bluesky Import/Export'] = 'Bluesky Import/Export';
$a->strings['Post to Bluesky'] = 'Auf Bluesky veröffentlichen';

View file

@ -0,0 +1,80 @@
# ADDON bluesky
# Copyright (C)
# This file is distributed under the same license as the Friendica bluesky addon package.
#
#
# Translators:
# tslmuun, 2023
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-05-24 05:52+0000\n"
"PO-Revision-Date: 2023-05-24 06:02+0000\n"
"Last-Translator: tslmuun, 2023\n"
"Language-Team: Chinese (China) (https://app.transifex.com/Friendica/teams/12172/zh_CN/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: zh_CN\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#: bluesky.php:100
msgid ""
"You are authenticated to Bluesky. For security reasons the password isn't "
"stored."
msgstr "您已通过 Bluesky 的身份验证。 出于安全原因,不存储密码。"
#: bluesky.php:100
msgid "You are not authenticated. Please enter the app password."
msgstr "您未通过身份验证。 请输入应用密码。"
#: bluesky.php:104
msgid "Enable Bluesky Post Addon"
msgstr "启用Bluesky插件"
#: bluesky.php:105
msgid "Post to Bluesky by default"
msgstr "默认发布到Bluesky"
#: bluesky.php:106
msgid "Import the remote timeline"
msgstr "导入远程时间线"
#: bluesky.php:107
msgid "Bluesky host"
msgstr "Bluesky地址"
#: bluesky.php:108
msgid "Bluesky handle"
msgstr "Bluesky handle"
#: bluesky.php:109
msgid "Bluesky DID"
msgstr "Bluesky DID"
#: bluesky.php:109
msgid ""
"This is the unique identifier. It will be fetched automatically, when the "
"handle is entered."
msgstr "这是唯一标识符。 输入句柄时,它将自动获取。"
#: bluesky.php:110
msgid "Bluesky app password"
msgstr "Bluesky 应用密码"
#: bluesky.php:110
msgid ""
"Please don't add your real password here, but instead create a specific app "
"password in the Bluesky settings."
msgstr "请不要在此处填写您的真实密码,而是在 Bluesky 设置中创建一个特定的应用程序密码。"
#: bluesky.php:116
msgid "Bluesky Import/Export"
msgstr "Bluesky 导入/导出"
#: bluesky.php:167
msgid "Post to Bluesky"
msgstr "发布到Bluesky"

View file

@ -0,0 +1,20 @@
<?php
if(! function_exists("string_plural_select_zh_cn")) {
function string_plural_select_zh_cn($n){
$n = intval($n);
return intval(0);
}}
$a->strings['You are authenticated to Bluesky. For security reasons the password isn\'t stored.'] = '您已通过 Bluesky 的身份验证。 出于安全原因,不存储密码。';
$a->strings['You are not authenticated. Please enter the app password.'] = '您未通过身份验证。 请输入应用密码。';
$a->strings['Enable Bluesky Post Addon'] = '启用Bluesky插件';
$a->strings['Post to Bluesky by default'] = '默认发布到Bluesky';
$a->strings['Import the remote timeline'] = '导入远程时间线';
$a->strings['Bluesky host'] = 'Bluesky地址';
$a->strings['Bluesky handle'] = 'Bluesky handle';
$a->strings['Bluesky DID'] = 'Bluesky DID';
$a->strings['This is the unique identifier. It will be fetched automatically, when the handle is entered.'] = '这是唯一标识符。 输入句柄时,它将自动获取。';
$a->strings['Bluesky app password'] = 'Bluesky 应用密码';
$a->strings['Please don\'t add your real password here, but instead create a specific app password in the Bluesky settings.'] = '请不要在此处填写您的真实密码,而是在 Bluesky 设置中创建一个特定的应用程序密码。';
$a->strings['Bluesky Import/Export'] = 'Bluesky 导入/导出';
$a->strings['Post to Bluesky'] = '发布到Bluesky';

View file

@ -0,0 +1,9 @@
<p>{{$status}}</p>
{{include file="field_checkbox.tpl" field=$enable}}
{{include file="field_checkbox.tpl" field=$bydefault}}
{{include file="field_checkbox.tpl" field=$import}}
{{include file="field_checkbox.tpl" field=$import_feeds}}
{{include file="field_input.tpl" field=$pds}}
{{include file="field_input.tpl" field=$handle}}
{{include file="field_input.tpl" field=$did}}
{{include file="field_input.tpl" field=$password}}

View file

@ -5,8 +5,7 @@
#
# Translators:
# Vladimir Núñez <lapoubelle111@gmail.com>, 2019
# Walter Bulbazor, 2021
# Hypolite Petovan <hypolite@mrpetovan.com>, 2022
# Florent C., 2023
#
#, fuzzy
msgid ""
@ -15,8 +14,8 @@ msgstr ""
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-11-21 19:14-0500\n"
"PO-Revision-Date: 2018-04-07 05:23+0000\n"
"Last-Translator: Hypolite Petovan <hypolite@mrpetovan.com>, 2022\n"
"Language-Team: French (https://www.transifex.com/Friendica/teams/12172/fr/)\n"
"Last-Translator: Florent C., 2023\n"
"Language-Team: French (https://app.transifex.com/Friendica/teams/12172/fr/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
@ -25,7 +24,7 @@ msgstr ""
#: catavatar.php:48
msgid "Set default profile avatar or randomize the cat."
msgstr "Mettre l'avatar par défaut ou tirer au sort le Chat."
msgstr "Mettre l'avatar par défaut ou tirer au sort le chat."
#: catavatar.php:53
msgid "Cat Avatar Settings"
@ -33,15 +32,15 @@ msgstr "Paramètres de Chat avatar"
#: catavatar.php:56
msgid "Use Cat as Avatar"
msgstr "Utiliser Chat comme avatar"
msgstr "Utiliser ce Chat"
#: catavatar.php:57
msgid "Another random Cat!"
msgstr "Un autre chat aléatoire !"
msgstr "Un autre Chat aléatoire !"
#: catavatar.php:58
msgid "Reset to email Cat"
msgstr "Réinitialiser à Chat courriel"
msgstr "Revenir au Chat par défaut"
#: catavatar.php:77
msgid "The cat hadn't found itself."

View file

@ -5,11 +5,11 @@ function string_plural_select_fr($n){
$n = intval($n);
if (($n == 0 || $n == 1)) { return 0; } else if ($n != 0 && $n % 1000000 == 0) { return 1; } else { return 2; }
}}
$a->strings['Set default profile avatar or randomize the cat.'] = 'Mettre l\'avatar par défaut ou tirer au sort le Chat.';
$a->strings['Set default profile avatar or randomize the cat.'] = 'Mettre l\'avatar par défaut ou tirer au sort le chat.';
$a->strings['Cat Avatar Settings'] = 'Paramètres de Chat avatar';
$a->strings['Use Cat as Avatar'] = 'Utiliser Chat comme avatar';
$a->strings['Another random Cat!'] = 'Un autre chat aléatoire !';
$a->strings['Reset to email Cat'] = 'Réinitialiser à Chat courriel';
$a->strings['Use Cat as Avatar'] = 'Utiliser ce Chat';
$a->strings['Another random Cat!'] = 'Un autre Chat aléatoire !';
$a->strings['Reset to email Cat'] = 'Revenir au Chat par défaut';
$a->strings['The cat hadn\'t found itself.'] = 'Le Chat ne s\'y est pas retrouvé';
$a->strings['There was an error, the cat ran away.'] = 'Il y a eu une erreur et le chat s\'est enfui';
$a->strings['Profile Photos'] = 'Photos de profil';

View file

@ -0,0 +1,64 @@
<?php
/**
* Name: Circle Text
* Description: Disable images in circle edit menu
* Version: 1.0
* Author: Thomas Willingham <https://kakste.com/profile/beardyunixer>
*/
use Friendica\Core\Hook;
use Friendica\Core\Renderer;
use Friendica\DI;
function circle_text_install()
{
Hook::register('addon_settings', __FILE__, 'circle_text_settings');
Hook::register('addon_settings_post', __FILE__, 'circle_text_settings_post');
}
/**
*
* Callback from the settings post function.
* $post contains the $_POST array.
* We will make sure we've got a valid user account
* and if so set our configuration setting for this person.
*
*/
function circle_text_settings_post(array $post)
{
if (!DI::userSession()->getLocalUserId() || empty($post['circle_text-submit'])) {
return;
}
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'circle_edit_image_limit', intval($post['circle_text']));
}
/**
*
* Called from the Addon Setting form.
* Add our own settings info to the page.
*
*/
function circle_text_settings(array &$data)
{
if (!DI::userSession()->getLocalUserId()) {
return;
}
$enabled = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'circle_edit_image_limit') ??
DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'groupedit_image_limit');
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/circle_text/');
$html = Renderer::replaceMacros($t, [
'$enabled' => ['circle_text', DI::l10n()->t('Use a text only (non-image) circle selector in the "circle edit" menu'), $enabled],
]);
$data = [
'addon' => 'circle_text',
'title' => DI::l10n()->t('Circle Text'),
'html' => $html,
];
}

View file

@ -0,0 +1,26 @@
# ADDON circle_text
# Copyright (C)
# This file is distributed under the same license as the Friendica circle_text addon package.
#
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-06-03 15:48-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: group_text.php:56
msgid "Use a text only (non-image) circle selector in the \"circle edit\" menu"
msgstr ""
#: group_text.php:61
msgid "Circle Text"
msgstr ""

View file

@ -0,0 +1,32 @@
# ADDON group_text
# Copyright (C)
# This file is distributed under the same license as the Friendica group_text addon package.
#
#
# Translators:
# Farida Khalaf <faridakhalaf@hotmail.com>, 2021
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-01 18:15+0100\n"
"PO-Revision-Date: 2021-02-21 02:59+0000\n"
"Last-Translator: Farida Khalaf <faridakhalaf@hotmail.com>\n"
"Language-Team: Arabic (http://www.transifex.com/Friendica/friendica/language/ar/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ar\n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"
#: group_text.php:62
msgid "Group Text"
msgstr "نص المجموعة:"
#: group_text.php:64
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
msgstr "استخدم محدد نصي للمجموعة فقط (غير مصور) في قائمة \"تعديل المجموعة\""
#: group_text.php:70
msgid "Save Settings"
msgstr "حفظ الإعدادات"

View file

@ -0,0 +1,10 @@
<?php
if(! function_exists("string_plural_select_ar")) {
function string_plural_select_ar($n){
$n = intval($n);
if ($n==0) { return 0; } else if ($n==1) { return 1; } else if ($n==2) { return 2; } else if ($n%100>=3 && $n%100<=10) { return 3; } else if ($n%100>=11 && $n%100<=99) { return 4; } else { return 5; }
}}
$a->strings['Group Text'] = 'نص المجموعة:';
$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'استخدم محدد نصي للمجموعة فقط (غير مصور) في قائمة "تعديل المجموعة"';
$a->strings['Save Settings'] = 'حفظ الإعدادات';

View file

@ -0,0 +1,36 @@
# ADDON group_text
# Copyright (C)
# This file is distributed under the same license as the Friendica group_text addon package.
#
#
# Translators:
# Joan Bar <friendica@tutanota.com>, 2019
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-02-27 05:01-0500\n"
"PO-Revision-Date: 2019-10-14 00:45+0000\n"
"Last-Translator: Joan Bar <friendica@tutanota.com>\n"
"Language-Team: Catalan (http://www.transifex.com/Friendica/friendica/language/ca/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ca\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: group_text.php:46
msgid "Group Text settings updated."
msgstr "La configuració del text del grup s'ha actualitzat."
#: group_text.php:76
msgid "Group Text"
msgstr "Missatge del grup"
#: group_text.php:78
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
msgstr "Utilitzeu un selector de grup de només text (que no sigui una imatge) al menú 'Edita grup'"
#: group_text.php:84
msgid "Submit"
msgstr "sotmetre's"

View file

@ -0,0 +1,11 @@
<?php
if(! function_exists("string_plural_select_ca")) {
function string_plural_select_ca($n){
$n = intval($n);
return intval($n != 1);
}}
$a->strings['Group Text settings updated.'] = 'La configuració del text del grup s\'ha actualitzat.';
$a->strings['Group Text'] = 'Missatge del grup';
$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Utilitzeu un selector de grup de només text (que no sigui una imatge) al menú \'Edita grup\'';
$a->strings['Submit'] = 'sotmetre\'s';

View file

@ -0,0 +1,37 @@
# ADDON group_text
# Copyright (C)
# This file is distributed under the same license as the Friendica group_text addon package.
#
#
# Translators:
# Aditoo, 2018
# michal_s <msupler@gmail.com>, 2014-2015
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-02-27 05:01-0500\n"
"PO-Revision-Date: 2018-09-12 09:47+0000\n"
"Last-Translator: Aditoo\n"
"Language-Team: Czech (http://www.transifex.com/Friendica/friendica/language/cs/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: cs\n"
"Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;\n"
#: group_text.php:46
msgid "Group Text settings updated."
msgstr "Nastavení Group Text aktualizována."
#: group_text.php:76
msgid "Group Text"
msgstr "Skupinový text"
#: group_text.php:78
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
msgstr "Použijte pouze textový (bezobrázkový) výběr skupiny v menu úpravy skupin."
#: group_text.php:84
msgid "Submit"
msgstr "Odeslat"

View file

@ -0,0 +1,11 @@
<?php
if(! function_exists("string_plural_select_cs")) {
function string_plural_select_cs($n){
$n = intval($n);
if (($n == 1 && $n % 1 == 0)) { return 0; } else if (($n >= 2 && $n <= 4 && $n % 1 == 0)) { return 1; } else if (($n % 1 != 0 )) { return 2; } else { return 3; }
}}
$a->strings['Group Text settings updated.'] = 'Nastavení Group Text aktualizována.';
$a->strings['Group Text'] = 'Skupinový text';
$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Použijte pouze textový (bezobrázkový) výběr skupiny v menu úpravy skupin.';
$a->strings['Submit'] = 'Odeslat';

View file

@ -0,0 +1,28 @@
# ADDON group_text
# Copyright (C)
# This file is distributed under the same license as the Friendica group_text addon package.
#
#
# Translators:
# Anton <dev@atjn.dk>, 2022
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-11-21 19:14-0500\n"
"PO-Revision-Date: 2014-06-23 08:35+0000\n"
"Last-Translator: Anton <dev@atjn.dk>, 2022\n"
"Language-Team: Danish (Denmark) (http://www.transifex.com/Friendica/friendica/language/da_DK/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: da_DK\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: group_text.php:58
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
msgstr "Brug en kun-tekst (intet billede) gruppevælger i grupperedigeringsmenuen"
#: group_text.php:63
msgid "Group Text"
msgstr "Gruppebesked"

View file

@ -0,0 +1,9 @@
<?php
if(! function_exists("string_plural_select_da_dk")) {
function string_plural_select_da_dk($n){
$n = intval($n);
return intval($n != 1);
}}
$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Brug en kun-tekst (intet billede) gruppevælger i grupperedigeringsmenuen';
$a->strings['Group Text'] = 'Gruppebesked';

View file

@ -0,0 +1,31 @@
# ADDON group_text
# Copyright (C)
# This file is distributed under the same license as the Friendica group_text addon package.
#
#
# Translators:
# Andreas H., 2014
# Tobias Diekershoff <tobias.diekershoff@gmx.net>, 2014
# Tobias Diekershoff <tobias.diekershoff@gmx.net>, 2021
# Ulf Rompe <transifex.com@rompe.org>, 2019
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-11-21 19:14-0500\n"
"PO-Revision-Date: 2014-06-23 08:35+0000\n"
"Last-Translator: Tobias Diekershoff <tobias.diekershoff@gmx.net>, 2021\n"
"Language-Team: German (http://app.transifex.com/Friendica/friendica/language/de/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: de\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: group_text.php:58
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
msgstr "Beim Bearbeiten von Gruppen Text statt Bilder anzeigen"
#: group_text.php:63
msgid "Group Text"
msgstr "Gruppen als Text"

View file

@ -0,0 +1,9 @@
<?php
if(! function_exists("string_plural_select_de")) {
function string_plural_select_de($n){
$n = intval($n);
return intval($n != 1);
}}
$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Beim Bearbeiten von Gruppen Text statt Bilder anzeigen';
$a->strings['Group Text'] = 'Gruppen als Text';

View file

@ -0,0 +1,5 @@
<?php
$a->strings["Group Text"] = "";
$a->strings["Use a text only (non-image) group selector in the \"group edit\" menu"] = "";
$a->strings["Submit"] = "Sendi";

View file

@ -0,0 +1,33 @@
# ADDON group_text
# Copyright (C)
# This file is distributed under the same license as the Friendica group_text addon package.
#
#
# Translators:
# Albert, 2016
# Senex Petrovic <javierruizo@hotmail.com>, 2021
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-01 18:15+0100\n"
"PO-Revision-Date: 2021-04-01 09:56+0000\n"
"Last-Translator: Senex Petrovic <javierruizo@hotmail.com>\n"
"Language-Team: Spanish (http://www.transifex.com/Friendica/friendica/language/es/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: es\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: group_text.php:62
msgid "Group Text"
msgstr "Grupo de Texto"
#: group_text.php:64
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
msgstr "Utilice sólo el selector de grupo de texto (no imagen) en el menú \"edición de grupo\""
#: group_text.php:70
msgid "Save Settings"
msgstr "Guardar Ajustes"

View file

@ -0,0 +1,10 @@
<?php
if(! function_exists("string_plural_select_es")) {
function string_plural_select_es($n){
$n = intval($n);
return intval($n != 1);
}}
$a->strings['Group Text'] = 'Grupo de Texto';
$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Utilice sólo el selector de grupo de texto (no imagen) en el menú "edición de grupo"';
$a->strings['Save Settings'] = 'Guardar Ajustes';

View file

@ -0,0 +1,37 @@
# ADDON group_text
# Copyright (C)
# This file is distributed under the same license as the Friendica group_text addon package.
#
#
# Translators:
# Kris, 2018
# Kris, 2018
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-02-27 05:01-0500\n"
"PO-Revision-Date: 2018-04-08 15:51+0000\n"
"Last-Translator: Kris\n"
"Language-Team: Finnish (Finland) (http://www.transifex.com/Friendica/friendica/language/fi_FI/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: fi_FI\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: group_text.php:46
msgid "Group Text settings updated."
msgstr "Group Text -asetukset päivitetty."
#: group_text.php:76
msgid "Group Text"
msgstr "Group Text"
#: group_text.php:78
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
msgstr ""
#: group_text.php:84
msgid "Submit"
msgstr "Lähetä"

View file

@ -0,0 +1,10 @@
<?php
if(! function_exists("string_plural_select_fi_fi")) {
function string_plural_select_fi_fi($n){
$n = intval($n);
return intval($n != 1);
}}
$a->strings['Group Text settings updated.'] = 'Group Text -asetukset päivitetty.';
$a->strings['Group Text'] = 'Group Text';
$a->strings['Submit'] = 'Lähetä';

View file

@ -0,0 +1,29 @@
# ADDON group_text
# Copyright (C)
# This file is distributed under the same license as the Friendica group_text addon package.
#
#
# Translators:
# bob lebonche <lebonche@tutanota.com>, 2021
# Hypolite Petovan <hypolite@mrpetovan.com>, 2016
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-11-21 19:14-0500\n"
"PO-Revision-Date: 2014-06-23 08:35+0000\n"
"Last-Translator: bob lebonche <lebonche@tutanota.com>, 2021\n"
"Language-Team: French (http://www.transifex.com/Friendica/friendica/language/fr/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: fr\n"
"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n"
#: group_text.php:58
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
msgstr "Utiliser uniquement un groupe de texte (pas d'image) dans le menu \"groupedit\""
#: group_text.php:63
msgid "Group Text"
msgstr "Groupe de texte"

View file

@ -0,0 +1,9 @@
<?php
if(! function_exists("string_plural_select_fr")) {
function string_plural_select_fr($n){
$n = intval($n);
if (($n == 0 || $n == 1)) { return 0; } else if ($n != 0 && $n % 1000000 == 0) { return 1; } else { return 2; }
}}
$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Utiliser uniquement un groupe de texte (pas d\'image) dans le menu "groupedit"';
$a->strings['Group Text'] = 'Groupe de texte';

View file

@ -0,0 +1,28 @@
# ADDON group_text
# Copyright (C)
# This file is distributed under the same license as the Friendica group_text addon package.
#
#
# Translators:
# Balázs Úr, 2020-2021
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-11-21 19:14-0500\n"
"PO-Revision-Date: 2014-06-23 08:35+0000\n"
"Last-Translator: Balázs Úr, 2020-2021\n"
"Language-Team: Hungarian (http://www.transifex.com/Friendica/friendica/language/hu/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: hu\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: group_text.php:58
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
msgstr "Csak szöveges (kép nélküli) csoportválasztó használata a „csoportszerkesztés” menüben"
#: group_text.php:63
msgid "Group Text"
msgstr "Csoportszöveg"

View file

@ -0,0 +1,9 @@
<?php
if(! function_exists("string_plural_select_hu")) {
function string_plural_select_hu($n){
$n = intval($n);
return intval($n != 1);
}}
$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Csak szöveges (kép nélküli) csoportválasztó használata a „csoportszerkesztés” menüben';
$a->strings['Group Text'] = 'Csoportszöveg';

View file

@ -0,0 +1,5 @@
<?php
$a->strings["Group Text"] = "";
$a->strings["Use a text only (non-image) group selector in the \"group edit\" menu"] = "";
$a->strings["Submit"] = "Senda inn";

View file

@ -0,0 +1,33 @@
# ADDON group_text
# Copyright (C)
# This file is distributed under the same license as the Friendica group_text addon package.
#
#
# Translators:
# fabrixxm <fabrix.xm@gmail.com>, 2014-2015
# Sylke Vicious <silkevicious@gmail.com>, 2021
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-01 18:15+0100\n"
"PO-Revision-Date: 2021-02-16 12:48+0000\n"
"Last-Translator: Sylke Vicious <silkevicious@gmail.com>\n"
"Language-Team: Italian (http://www.transifex.com/Friendica/friendica/language/it/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: it\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: group_text.php:62
msgid "Group Text"
msgstr "Editor Gruppi Testuale"
#: group_text.php:64
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
msgstr "Usa un selettore testuale (senza immagini) nella pagina \"modifica gruppo\""
#: group_text.php:70
msgid "Save Settings"
msgstr "Salva Impostazioni"

View file

@ -0,0 +1,10 @@
<?php
if(! function_exists("string_plural_select_it")) {
function string_plural_select_it($n){
$n = intval($n);
return intval($n != 1);
}}
$a->strings['Group Text'] = 'Editor Gruppi Testuale';
$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Usa un selettore testuale (senza immagini) nella pagina "modifica gruppo"';
$a->strings['Save Settings'] = 'Salva Impostazioni';

View file

@ -0,0 +1,5 @@
<?php
$a->strings["Group Text"] = "";
$a->strings["Use a text only (non-image) group selector in the \"group edit\" menu"] = "";
$a->strings["Submit"] = "Lagre";

View file

@ -0,0 +1,36 @@
# ADDON group_text
# Copyright (C)
# This file is distributed under the same license as the Friendica group_text addon package.
#
#
# Translators:
# Jeroen De Meerleer <me@jeroened.be>, 2018
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-02-27 05:01-0500\n"
"PO-Revision-Date: 2018-08-24 13:48+0000\n"
"Last-Translator: Jeroen De Meerleer <me@jeroened.be>\n"
"Language-Team: Dutch (http://www.transifex.com/Friendica/friendica/language/nl/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: nl\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: group_text.php:46
msgid "Group Text settings updated."
msgstr "Groupsberichten instellingen opgeslagen"
#: group_text.php:76
msgid "Group Text"
msgstr "Groepsbericht"
#: group_text.php:78
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
msgstr ""
#: group_text.php:84
msgid "Submit"
msgstr ""

View file

@ -0,0 +1,9 @@
<?php
if(! function_exists("string_plural_select_nl")) {
function string_plural_select_nl($n){
$n = intval($n);
return intval($n != 1);
}}
$a->strings['Group Text settings updated.'] = 'Groupsberichten instellingen opgeslagen';
$a->strings['Group Text'] = 'Groepsbericht';

View file

@ -0,0 +1,28 @@
# ADDON group_text
# Copyright (C)
# This file is distributed under the same license as the Friendica group_text addon package.
#
#
# Translators:
# Waldemar Stoczkowski, 2018
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-11-21 19:14-0500\n"
"PO-Revision-Date: 2014-06-23 08:35+0000\n"
"Last-Translator: Waldemar Stoczkowski, 2018\n"
"Language-Team: Polish (http://www.transifex.com/Friendica/friendica/language/pl/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: pl\n"
"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n"
#: group_text.php:58
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
msgstr "Użyj tylko tekst (bez obrazu) selektor grupy w menu \"Edycja grupy\""
#: group_text.php:63
msgid "Group Text"
msgstr "Grupuj tekst"

View file

@ -0,0 +1,9 @@
<?php
if(! function_exists("string_plural_select_pl")) {
function string_plural_select_pl($n){
$n = intval($n);
if ($n==1) { return 0; } else if (($n%10>=2 && $n%10<=4) && ($n%100<12 || $n%100>14)) { return 1; } else if ($n!=1 && ($n%10>=0 && $n%10<=1) || ($n%10>=5 && $n%10<=9) || ($n%100>=12 && $n%100<=14)) { return 2; } else { return 3; }
}}
$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Użyj tylko tekst (bez obrazu) selektor grupy w menu "Edycja grupy"';
$a->strings['Group Text'] = 'Grupuj tekst';

View file

@ -0,0 +1,5 @@
<?php
$a->strings["Group Text"] = "";
$a->strings["Use a text only (non-image) group selector in the \"group edit\" menu"] = "";
$a->strings["Submit"] = "Enviar";

View file

@ -0,0 +1,36 @@
# ADDON group_text
# Copyright (C)
# This file is distributed under the same license as the Friendica group_text addon package.
#
#
# Translators:
# Doru DEACONU <dumitrudeaconu@yahoo.com>, 2014
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-02-27 05:01-0500\n"
"PO-Revision-Date: 2014-11-27 14:15+0000\n"
"Last-Translator: Doru DEACONU <dumitrudeaconu@yahoo.com>\n"
"Language-Team: Romanian (Romania) (http://www.transifex.com/projects/p/friendica/language/ro_RO/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ro_RO\n"
"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n"
#: group_text.php:46
msgid "Group Text settings updated."
msgstr "Configurările Text Grup, au fost actualizate."
#: group_text.php:76
msgid "Group Text"
msgstr "Text Grup"
#: group_text.php:78
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
msgstr "Folosiți în meniul \"editare grup\" un selector de grup strict textual (fără-imagine)"
#: group_text.php:84
msgid "Submit"
msgstr "Trimite"

View file

@ -0,0 +1,11 @@
<?php
if(! function_exists("string_plural_select_ro")) {
function string_plural_select_ro($n){
$n = intval($n);
if ($n==1) { return 0; } else if ((($n%100>19)||(($n%100==0)&&($n!=0)))) { return 2; } else { return 1; }
}}
$a->strings['Group Text settings updated.'] = 'Configurările Text Grup, au fost actualizate.';
$a->strings['Group Text'] = 'Text Grup';
$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Folosiți în meniul "editare grup" un selector de grup strict textual (fără-imagine)';
$a->strings['Submit'] = 'Trimite';

View file

@ -0,0 +1,36 @@
# ADDON group_text
# Copyright (C)
# This file is distributed under the same license as the Friendica group_text addon package.
#
#
# Translators:
# Stanislav N. <pztrn@pztrn.name>, 2017
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-02-27 05:01-0500\n"
"PO-Revision-Date: 2017-04-08 17:26+0000\n"
"Last-Translator: Stanislav N. <pztrn@pztrn.name>\n"
"Language-Team: Russian (http://www.transifex.com/Friendica/friendica/language/ru/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ru\n"
"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n"
#: group_text.php:46
msgid "Group Text settings updated."
msgstr "Настройки Group Text обновлены."
#: group_text.php:76
msgid "Group Text"
msgstr "Group Text"
#: group_text.php:78
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
msgstr "Используйте текстовый (не изображение) селектор группы в режиме редактирования группы"
#: group_text.php:84
msgid "Submit"
msgstr "Добавить"

View file

@ -0,0 +1,11 @@
<?php
if(! function_exists("string_plural_select_ru")) {
function string_plural_select_ru($n){
$n = intval($n);
if ($n%10==1 && $n%100!=11) { return 0; } else if ($n%10>=2 && $n%10<=4 && ($n%100<12 || $n%100>14)) { return 1; } else if ($n%10==0 || ($n%10>=5 && $n%10<=9) || ($n%100>=11 && $n%100<=14)) { return 2; } else { return 3; }
}}
$a->strings['Group Text settings updated.'] = 'Настройки Group Text обновлены.';
$a->strings['Group Text'] = 'Group Text';
$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Используйте текстовый (не изображение) селектор группы в режиме редактирования группы';
$a->strings['Submit'] = 'Добавить';

View file

@ -0,0 +1,28 @@
# ADDON group_text
# Copyright (C)
# This file is distributed under the same license as the Friendica group_text addon package.
#
#
# Translators:
# Kristoffer Grundström <lovaren@gmail.com>, 2022
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-11-21 19:14-0500\n"
"PO-Revision-Date: 2022-01-16 00:35+0000\n"
"Last-Translator: Kristoffer Grundström <lovaren@gmail.com>\n"
"Language-Team: Swedish (http://www.transifex.com/Friendica/friendica/language/sv/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: sv\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: group_text.php:58
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
msgstr ""
#: group_text.php:63
msgid "Group Text"
msgstr "Grupptext"

View file

@ -0,0 +1,8 @@
<?php
if(! function_exists("string_plural_select_sv")) {
function string_plural_select_sv($n){
$n = intval($n);
return intval($n != 1);
}}
$a->strings['Group Text'] = 'Grupptext';

View file

@ -0,0 +1,6 @@
<?php
$a->strings["Group Text settings updated."] = "组正文设置更新了。";
$a->strings["Group Text"] = "正文";
$a->strings["Use a text only (non-image) group selector in the \"group edit\" menu"] = "用光正文(无图片)组选择器在「组编辑」单";
$a->strings["Submit"] = "提交";

View file

@ -0,0 +1 @@
{{include file="field_checkbox.tpl" field=$enabled}}

85
cld/README.md Normal file
View file

@ -0,0 +1,85 @@
Compact Language Detector
===
CLD2 is an advanced language dectection library with a high reliability.
This addon depends on the CLD PHP module which is not included in any Linux distribution.
It needs to be built and installed by hand, which is not totally straightforward.
Prerequisite
---
To be able to build the extension, you need the CLD module and the files for the PHP module development.
On Debian you install the packages php-dev, libcld2-dev and libcld2-0.
Make sure to have installed the correct PHP version.
Means: When you have got both PHP 8.0 and 8.2 on your system, you have to install php8.0-dev as well.
Installation
---
The original PHP extension is https://github.com/fntlnz/cld2-php-ext.
However, it doesn't support PHP8.
So https://github.com/hiteule/cld2-php-ext/tree/support-php8 has to be used.
Download the source code:
```
wget https://github.com/hiteule/cld2-php-ext/archive/refs/heads/support-php8.zip
```
Unzip it:
```
unzip support-php8.zip
```
Change into the folder:
```
cd cld2-php-ext-support-php8/
```
Configure for the PHP Api version:
```
phpize
```
(if you have got several PHP versions on your system, execute the command with the version that you run Friendica with, e.g. `phpize8.0`)
Create the Makefile:
```
./configure --with-cld2=/usr/include/cld2
```
Have a look at the line `checking for PHP includes`.
When the output (for example `/usr/include/php/20220829` doesn't match the API version that you got from `phpize`, then you have to change all the version codes in your `Makefile` afterwards)
Create the module:
```
make -j
```
Install it:
```
sudo make install
```
Change to the folder with the available modules. When you use PHP 8.2 on Debian it is:
```
cd /etc/php/8.2/mods-available
```
Create the file `cld2.ini` with this content:
```
; configuration for php cld2 module
; priority=20
extension=cld2.so
```
Enable the module for all versions and all sapi:
```
phpenmod -v ALL -s ALL cld2
```
Then restart the apache or fpm (or whatever you use) to load the changed configuration.
Call `/admin/phpinfo` on your webserver.
You then see the PHP Info.
Search for "cld2".
The module is installed, when you find it here.
**Only proceed when the module is installed**
Now you can enable the addon.

71
cld/cld.php Normal file
View file

@ -0,0 +1,71 @@
<?php
/**
* Name: Compact Language Detector
* Description: Improved language detection
* Version: 0.1
* Author: Michael Vogel <heluecht@pirati.ca>
*/
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\DI;
function cld_install()
{
Hook::register('detect_languages', __FILE__, 'cld_detect_languages');
}
function cld_detect_languages(array &$data)
{
if (!in_array('cld2', get_loaded_extensions())) {
Logger::warning('CLD2 is not installed.');
return;
}
$cld2 = new \CLD2Detector();
$cld2->setEncodingHint(CLD2Encoding::UTF8); // optional, hints about text encoding
$cld2->setPlainText(true);
$result = $cld2->detect($data['text']);
if ($data['detected']) {
$original = array_key_first($data['detected']);
} else {
$original = '';
}
$detected = DI::l10n()->toISO6391($result['language_code']);
// languages that aren't supported via the base language detection or tend to false detections
if ((strlen($detected) == 3) || in_array($detected, ['ht', 'kk', 'ku', 'ky', 'lg', 'mg', 'mk', 'mt', 'ny', 'rw', 'st', 'su', 'tg', 'ts', 'xx'])) {
return;
}
if (!$result['is_reliable']) {
Logger::debug('Unreliable detection', ['uri-id' => $data['uri-id'], 'original' => $original, 'detected' => $detected, 'name' => $result['language_name'], 'probability' => $result['language_probability'], 'text' => $data['text']]);
if (($original == $detected) && ($data['detected'][$original] < $result['language_probability'] / 100)) {
$data['detected'][$original] = $result['language_probability'] / 100;
}
return;
}
$available = array_keys(DI::l10n()->getLanguageCodes());
if (!in_array($detected, $available)) {
Logger::debug('Unsupported language', ['uri-id' => $data['uri-id'], 'original' => $original, 'detected' => $detected, 'name' => $result['language_name'], 'probability' => $result['language_probability'], 'text' => $data['text']]);
return;
}
if ($original != $detected) {
Logger::debug('Detected different language', ['uri-id' => $data['uri-id'], 'original' => $original, 'detected' => $detected, 'name' => $result['language_name'], 'probability' => $result['language_probability'], 'text' => $data['text']]);
}
$length = count($data['detected']);
if ($length > 0) {
unset($data['detected'][$detected]);
$data['detected'] = array_merge([$detected => $result['language_probability'] / 100], array_slice($data['detected'], 0, $length - 1));
} else {
$data['detected'] = [$detected => $result['language_probability'] / 100];
}
}

View file

@ -205,7 +205,7 @@ function diaspora_send(array &$b)
$b['body'] = Post\Media::addAttachmentsToBody($b['uri-id'], DI::contentItem()->addSharedPost($b));
// Dont't post if the post doesn't belong to us.
// This is a check for forum postings
// This is a check for group postings
$self = DBA::selectFirst('contact', ['id'], ['uid' => $b['uid'], 'self' => true]);
if ($b['contact-id'] != $self['id']) {

View file

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-11-21 19:17-0500\n"
"POT-Creation-Date: 2023-06-03 15:48-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -17,84 +17,84 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: diaspora.php:44
#: diaspora.php:43
msgid "Post to Diaspora"
msgstr ""
#: diaspora.php:67
#: diaspora.php:66
#, php-format
msgid ""
"Please remember: You can always be reached from Diaspora with your Friendica "
"handle <strong>%s</strong>. "
msgstr ""
#: diaspora.php:68
#: diaspora.php:67
msgid ""
"This connector is only meant if you still want to use your old Diaspora "
"account for some time. "
msgstr ""
#: diaspora.php:69
#: diaspora.php:68
#, php-format
msgid ""
"However, it is preferred that you tell your Diaspora contacts the new handle "
"<strong>%s</strong> instead."
msgstr ""
#: diaspora.php:79
#: diaspora.php:78
msgid "All aspects"
msgstr ""
#: diaspora.php:80
#: diaspora.php:79
msgid "Public"
msgstr ""
#: diaspora.php:86
#: diaspora.php:85
msgid "Post to aspect:"
msgstr ""
#: diaspora.php:87
#: diaspora.php:86
#, php-format
msgid "Connected with your Diaspora account <strong>%s</strong>"
msgstr ""
#: diaspora.php:90
#: diaspora.php:89
msgid ""
"Can't login to your Diaspora account. Please check handle (in the format "
"user@domain.tld) and password."
msgstr ""
#: diaspora.php:97
#: diaspora.php:96
msgid "Information"
msgstr ""
#: diaspora.php:98
#: diaspora.php:97
msgid "Error"
msgstr ""
#: diaspora.php:104
#: diaspora.php:103
msgid "Enable Diaspora Post Addon"
msgstr ""
#: diaspora.php:105
#: diaspora.php:104
msgid "Diaspora handle"
msgstr ""
#: diaspora.php:106
#: diaspora.php:105
msgid "Diaspora password"
msgstr ""
#: diaspora.php:106
#: diaspora.php:105
msgid ""
"Privacy notice: Your Diaspora password will be stored unencrypted to "
"authenticate you with your Diaspora pod. This means your Friendica node "
"administrator can have access to it."
msgstr ""
#: diaspora.php:108
#: diaspora.php:107
msgid "Post to Diaspora by default"
msgstr ""
#: diaspora.php:113
#: diaspora.php:112
msgid "Diaspora Export"
msgstr ""

View file

@ -4,6 +4,8 @@
* Description: Add a directory of forums hosted on your server, with verbose descriptions.
* Version: 1.1
* Author: Thomas Willingham <https://beardyunixer.com/profile/beardyunixer>
* Status: Unsupported
* Note: Please use Group Directory instead
*/
use Friendica\App;

View file

@ -4,6 +4,8 @@
* Description: Disable images in group edit menu
* Version: 1.0
* Author: Thomas Willingham <https://kakste.com/profile/beardyunixer>
* Status: Unsupported
* Note: Please use Circle Text instead
*/
use Friendica\App;

View file

@ -0,0 +1,155 @@
<?php
/**
* Name: Group Directory
* Description: Add a directory of groups hosted on your server, with verbose descriptions.
* Version: 1.1
* Author: Thomas Willingham <https://beardyunixer.com/profile/beardyunixer>
*/
use Friendica\Content\Nav;
use Friendica\Content\Pager;
use Friendica\Content\Widget;
use Friendica\Core\Hook;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Profile;
use Friendica\Model\User;
global $groupdirectory_search;
function groupdirectory_install()
{
Hook::register('app_menu', __FILE__, 'groupdirectory_app_menu');
}
/**
* This is a statement rather than an actual function definition. The simple
* existence of this method is checked to figure out if the addon offers a
* module.
*/
/**
* This is a statement rather than an actual function definition. The simple
* existence of this method is checked to figure out if the addon offers a
* module.
*/
function groupdirectory_module() {}
function groupdirectory_app_menu(array &$b)
{
$b['app_menu'][] = '<div class="app-title"><a href="groupdirectory">' . DI::l10n()->t('Group Directory') . '</a></div>';
}
function groupdirectory_init()
{
if (DI::userSession()->getLocalUserId()) {
DI::page()['aside'] .= Widget::findPeople();
}
}
function groupdirectory_post()
{
global $groupdirectory_search;
if (!empty($_POST['search'])) {
$groupdirectory_search = $_POST['search'];
}
}
function groupdirectory_content()
{
global $groupdirectory_search;
if (DI::config()->get('system', 'block_public') && !DI::userSession()->getLocalUserId() && !DI::userSession()->getRemoteUserId()) {
DI::sysmsg()->addNotice(DI::l10n()->t('Public access denied.'));
return '';
}
$o = '';
$entries = [];
Nav::setSelected('directory');
if (!empty($groupdirectory_search)) {
$search = trim($groupdirectory_search);
} else {
$search = (!empty($_GET['search']) ? trim(rawurldecode($_GET['search'])) : '');
}
$gdirpath = '';
$dirurl = DI::config()->get('system', 'directory');
if (strlen($dirurl)) {
$gdirpath = Profile::zrl($dirurl, true);
}
$sql_extra = '';
if (strlen($search)) {
$search = DBA::escape($search);
$sql_extra = " AND ((`profile`.`name` LIKE '%$search%') OR
(`user`.`nickname` LIKE '%$search%') OR
(`profile`.`about` LIKE '%$search%') OR
(`profile`.`locality` LIKE '%$search%') OR
(`profile`.`region` LIKE '%$search%') OR
(`profile`.`country-name` LIKE '%$search%') OR
(`profile`.`pub_keywords` LIKE '%$search%') OR
(`profile`.`prv_keywords` LIKE '%$search%'))";
}
$publish = DI::config()->get('system', 'publish_all') ? '' : "`publish` = 1";
$total = 0;
$cnt = DBA::fetchFirst("SELECT COUNT(*) AS `total` FROM `profile`
INNER JOIN `user` ON `user`.`uid` = `profile`.`uid`
WHERE $publish AND NOT `user`.`blocked` AND NOT `user`.`account_removed` AND `user`.`page-flags` = ? $sql_extra",
User::PAGE_FLAGS_COMMUNITY);
if (DBA::isResult($cnt)) {
$total = $cnt['total'];
}
$pager = new Pager(DI::l10n(), DI::args()->getQueryString(), 60);
$order = " ORDER BY `name` ASC ";
$limit = $pager->getStart() . "," . $pager->getItemsPerPage();
$r = DBA::p("SELECT `profile`.*, `user`.`nickname`, `user`.`timezone` , `user`.`page-flags`,
`contact`.`addr`, `contact`.`url` FROM `profile`
INNER JOIN `user` ON `user`.`uid` = `profile`.`uid`
INNER JOIN `contact` ON `contact`.`uid` = `user`.`uid`
WHERE $publish AND NOT `user`.`blocked` AND NOT `user`.`account_removed` AND `user`.`page-flags` = ? AND `contact`.`self`
$sql_extra $order LIMIT $limit", User::PAGE_FLAGS_COMMUNITY
);
if (DBA::isResult($r)) {
if (in_array('small', DI::args()->getArgv())) {
$photo = 'thumb';
} else {
$photo = 'photo';
}
while ($rr = DBA::fetch($r)) {
$entries[] = Friendica\Module\Directory::formatEntry($rr, $photo);
}
DBA::close($r);
} else {
DI::sysmsg()->addNotice(DI::l10n()->t('No entries (some entries may be hidden).'));
}
$tpl = Renderer::getMarkupTemplate('directory_header.tpl');
$o .= Renderer::replaceMacros($tpl, [
'$search' => $search,
'$globaldir' => DI::l10n()->t('Global Directory'),
'$gdirpath' => $gdirpath,
'$desc' => DI::l10n()->t('Find on this site'),
'$contacts' => $entries,
'$finding' => DI::l10n()->t('Results for:'),
'$findterm' => (strlen($search) ? $search : ""),
'$title' => DI::l10n()->t('Group Directory'),
'$search_mod' => 'groupdirectory',
'$submit' => DI::l10n()->t('Find'),
'$paginate' => $pager->renderFull($total),
]);
return $o;
}

View file

@ -0,0 +1,46 @@
# ADDON groupdirectory
# Copyright (C)
# This file is distributed under the same license as the Friendica groupdirectory addon package.
#
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-06-03 15:49-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: groupdirectory.php:40 groupdirectory.php:148
msgid "Group Directory"
msgstr ""
#: groupdirectory.php:64
msgid "Public access denied."
msgstr ""
#: groupdirectory.php:136
msgid "No entries (some entries may be hidden)."
msgstr ""
#: groupdirectory.php:142
msgid "Global Directory"
msgstr ""
#: groupdirectory.php:144
msgid "Find on this site"
msgstr ""
#: groupdirectory.php:146
msgid "Results for:"
msgstr ""
#: groupdirectory.php:150
msgid "Find"
msgstr ""

View file

@ -0,0 +1,50 @@
# ADDON forumdirectory
# Copyright (C)
# This file is distributed under the same license as the Friendica forumdirectory addon package.
#
#
# Translators:
# abidin toumi <abidin24@tutanota.com>, 2021
# ButterflyOfFire, 2019
# Farida Khalaf <faridakhalaf@hotmail.com>, 2021
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-01 18:15+0100\n"
"PO-Revision-Date: 2021-10-29 10:27+0000\n"
"Last-Translator: abidin toumi <abidin24@tutanota.com>\n"
"Language-Team: Arabic (http://www.transifex.com/Friendica/friendica/language/ar/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ar\n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"
#: forumdirectory.php:33 forumdirectory.php:137
msgid "Forum Directory"
msgstr "دليل المنتدى"
#: forumdirectory.php:53
msgid "Public access denied."
msgstr "رُفض الوصول العمومي."
#: forumdirectory.php:125
msgid "No entries (some entries may be hidden)."
msgstr "لا توجد مدخلات (قد تكون بعض المدخلات مخفية)."
#: forumdirectory.php:131
msgid "Global Directory"
msgstr "الدليل العالمي"
#: forumdirectory.php:133
msgid "Find on this site"
msgstr "ابحث في هذا الموقع"
#: forumdirectory.php:135
msgid "Results for:"
msgstr "النتائج:"
#: forumdirectory.php:139
msgid "Find"
msgstr "ابحث"

View file

@ -0,0 +1,14 @@
<?php
if(! function_exists("string_plural_select_ar")) {
function string_plural_select_ar($n){
$n = intval($n);
if ($n==0) { return 0; } else if ($n==1) { return 1; } else if ($n==2) { return 2; } else if ($n%100>=3 && $n%100<=10) { return 3; } else if ($n%100>=11 && $n%100<=99) { return 4; } else { return 5; }
}}
$a->strings['Forum Directory'] = 'دليل المنتدى';
$a->strings['Public access denied.'] = 'رُفض الوصول العمومي.';
$a->strings['No entries (some entries may be hidden).'] = 'لا توجد مدخلات (قد تكون بعض المدخلات مخفية).';
$a->strings['Global Directory'] = 'الدليل العالمي';
$a->strings['Find on this site'] = 'ابحث في هذا الموقع';
$a->strings['Results for:'] = 'النتائج:';
$a->strings['Find'] = 'ابحث';

View file

@ -0,0 +1,80 @@
# ADDON forumdirectory
# Copyright (C)
# This file is distributed under the same license as the Friendica forumdirectory addon package.
#
#
# Translators:
# Joan Bar <friendica@tutanota.com>, 2019
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-02-27 05:01-0500\n"
"PO-Revision-Date: 2019-10-18 18:57+0000\n"
"Last-Translator: Joan Bar <friendica@tutanota.com>\n"
"Language-Team: Catalan (http://www.transifex.com/Friendica/friendica/language/ca/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ca\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: forumdirectory.php:22
msgid "Forum Directory"
msgstr "Directori de fòrums"
#: forumdirectory.php:53
msgid "Public access denied."
msgstr "L'accés al públic s'ha denegat."
#: forumdirectory.php:71
msgid "Global Directory"
msgstr "Directori global"
#: forumdirectory.php:79
msgid "Find on this site"
msgstr "Cerqueu en aquest lloc"
#: forumdirectory.php:81
msgid "Finding: "
msgstr "Trobament:"
#: forumdirectory.php:82
msgid "Site Directory"
msgstr "Directori de llocs"
#: forumdirectory.php:83
msgid "Find"
msgstr "trobar"
#: forumdirectory.php:133
msgid "Age: "
msgstr "Edat:"
#: forumdirectory.php:136
msgid "Gender: "
msgstr "Gènere:"
#: forumdirectory.php:156
msgid "Location:"
msgstr "Ubicació:"
#: forumdirectory.php:158
msgid "Gender:"
msgstr "Gènere:"
#: forumdirectory.php:160
msgid "Status:"
msgstr "Estat:"
#: forumdirectory.php:162
msgid "Homepage:"
msgstr "Pàgina inicial:"
#: forumdirectory.php:164
msgid "About:"
msgstr "Sobre:"
#: forumdirectory.php:201
msgid "No entries (some entries may be hidden)."
msgstr "No hi ha entrades (algunes entrades poden estar ocultes)."

View file

@ -0,0 +1,22 @@
<?php
if(! function_exists("string_plural_select_ca")) {
function string_plural_select_ca($n){
$n = intval($n);
return intval($n != 1);
}}
$a->strings['Forum Directory'] = 'Directori de fòrums';
$a->strings['Public access denied.'] = 'L\'accés al públic s\'ha denegat.';
$a->strings['Global Directory'] = 'Directori global';
$a->strings['Find on this site'] = 'Cerqueu en aquest lloc';
$a->strings['Finding: '] = 'Trobament:';
$a->strings['Site Directory'] = 'Directori de llocs';
$a->strings['Find'] = 'trobar';
$a->strings['Age: '] = 'Edat:';
$a->strings['Gender: '] = 'Gènere:';
$a->strings['Location:'] = 'Ubicació:';
$a->strings['Gender:'] = 'Gènere:';
$a->strings['Status:'] = 'Estat:';
$a->strings['Homepage:'] = 'Pàgina inicial:';
$a->strings['About:'] = 'Sobre:';
$a->strings['No entries (some entries may be hidden).'] = 'No hi ha entrades (algunes entrades poden estar ocultes).';

View file

@ -0,0 +1,81 @@
# ADDON forumdirectory
# Copyright (C)
# This file is distributed under the same license as the Friendica forumdirectory addon package.
#
#
# Translators:
# Aditoo, 2018
# michal_s <msupler@gmail.com>, 2014
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-02-27 05:01-0500\n"
"PO-Revision-Date: 2018-09-11 19:04+0000\n"
"Last-Translator: Aditoo\n"
"Language-Team: Czech (http://www.transifex.com/Friendica/friendica/language/cs/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: cs\n"
"Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;\n"
#: forumdirectory.php:22
msgid "Forum Directory"
msgstr "Adresář fór"
#: forumdirectory.php:53
msgid "Public access denied."
msgstr "Veřejný přístup odepřen."
#: forumdirectory.php:71
msgid "Global Directory"
msgstr "Globální adresář"
#: forumdirectory.php:79
msgid "Find on this site"
msgstr "Najít na tomto webu"
#: forumdirectory.php:81
msgid "Finding: "
msgstr "Hledání: "
#: forumdirectory.php:82
msgid "Site Directory"
msgstr "Adresář serveru"
#: forumdirectory.php:83
msgid "Find"
msgstr "Najít"
#: forumdirectory.php:133
msgid "Age: "
msgstr "Věk: "
#: forumdirectory.php:136
msgid "Gender: "
msgstr "Pohlaví: "
#: forumdirectory.php:156
msgid "Location:"
msgstr "Poloha:"
#: forumdirectory.php:158
msgid "Gender:"
msgstr "Pohlaví:"
#: forumdirectory.php:160
msgid "Status:"
msgstr "Stav:"
#: forumdirectory.php:162
msgid "Homepage:"
msgstr "Domovská stránka:"
#: forumdirectory.php:164
msgid "About:"
msgstr "O mě:"
#: forumdirectory.php:201
msgid "No entries (some entries may be hidden)."
msgstr "Žádné záznamy (některé položky mohou být skryty)."

View file

@ -0,0 +1,22 @@
<?php
if(! function_exists("string_plural_select_cs")) {
function string_plural_select_cs($n){
$n = intval($n);
if (($n == 1 && $n % 1 == 0)) { return 0; } else if (($n >= 2 && $n <= 4 && $n % 1 == 0)) { return 1; } else if (($n % 1 != 0 )) { return 2; } else { return 3; }
}}
$a->strings['Forum Directory'] = 'Adresář fór';
$a->strings['Public access denied.'] = 'Veřejný přístup odepřen.';
$a->strings['Global Directory'] = 'Globální adresář';
$a->strings['Find on this site'] = 'Najít na tomto webu';
$a->strings['Finding: '] = 'Hledání: ';
$a->strings['Site Directory'] = 'Adresář serveru';
$a->strings['Find'] = 'Najít';
$a->strings['Age: '] = 'Věk: ';
$a->strings['Gender: '] = 'Pohlaví: ';
$a->strings['Location:'] = 'Poloha:';
$a->strings['Gender:'] = 'Pohlaví:';
$a->strings['Status:'] = 'Stav:';
$a->strings['Homepage:'] = 'Domovská stránka:';
$a->strings['About:'] = 'O mě:';
$a->strings['No entries (some entries may be hidden).'] = 'Žádné záznamy (některé položky mohou být skryty).';

View file

@ -0,0 +1,48 @@
# ADDON forumdirectory
# Copyright (C)
# This file is distributed under the same license as the Friendica forumdirectory addon package.
#
#
# Translators:
# Anton <dev@atjn.dk>, 2022
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-01 18:15+0100\n"
"PO-Revision-Date: 2014-06-22 12:31+0000\n"
"Last-Translator: Anton <dev@atjn.dk>, 2022\n"
"Language-Team: Danish (Denmark) (http://www.transifex.com/Friendica/friendica/language/da_DK/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: da_DK\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: forumdirectory.php:33 forumdirectory.php:137
msgid "Forum Directory"
msgstr "Forum adressebog"
#: forumdirectory.php:53
msgid "Public access denied."
msgstr "Offentlig adgang nægtet."
#: forumdirectory.php:125
msgid "No entries (some entries may be hidden)."
msgstr "Ingen poster (nogle poster er måske skjulte)."
#: forumdirectory.php:131
msgid "Global Directory"
msgstr "Global adressebog"
#: forumdirectory.php:133
msgid "Find on this site"
msgstr "Find på denne side"
#: forumdirectory.php:135
msgid "Results for:"
msgstr "Resultater for:"
#: forumdirectory.php:139
msgid "Find"
msgstr "Find"

View file

@ -0,0 +1,14 @@
<?php
if(! function_exists("string_plural_select_da_dk")) {
function string_plural_select_da_dk($n){
$n = intval($n);
return intval($n != 1);
}}
$a->strings['Forum Directory'] = 'Forum adressebog';
$a->strings['Public access denied.'] = 'Offentlig adgang nægtet.';
$a->strings['No entries (some entries may be hidden).'] = 'Ingen poster (nogle poster er måske skjulte).';
$a->strings['Global Directory'] = 'Global adressebog';
$a->strings['Find on this site'] = 'Find på denne side';
$a->strings['Results for:'] = 'Resultater for:';
$a->strings['Find'] = 'Find';

View file

@ -0,0 +1,49 @@
# ADDON forumdirectory
# Copyright (C)
# This file is distributed under the same license as the Friendica forumdirectory addon package.
#
#
# Translators:
# Tobias Diekershoff <tobias.diekershoff@gmx.net>, 2014
# Tobias Diekershoff <tobias.diekershoff@gmx.net>, 2021
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-01 18:15+0100\n"
"PO-Revision-Date: 2014-06-22 12:31+0000\n"
"Last-Translator: Tobias Diekershoff <tobias.diekershoff@gmx.net>, 2021\n"
"Language-Team: German (http://app.transifex.com/Friendica/friendica/language/de/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: de\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: forumdirectory.php:33 forumdirectory.php:137
msgid "Forum Directory"
msgstr "Foren Verzeichnis"
#: forumdirectory.php:53
msgid "Public access denied."
msgstr "Öffentlicher Zugriff verweigert."
#: forumdirectory.php:125
msgid "No entries (some entries may be hidden)."
msgstr "Keine Einträge (einige Einträge könnten versteckt sein)."
#: forumdirectory.php:131
msgid "Global Directory"
msgstr "Weltweites Verzeichnis"
#: forumdirectory.php:133
msgid "Find on this site"
msgstr "Auf diesem Server suchen"
#: forumdirectory.php:135
msgid "Results for:"
msgstr "Ergebnis für:"
#: forumdirectory.php:139
msgid "Find"
msgstr "Finde"

View file

@ -0,0 +1,14 @@
<?php
if(! function_exists("string_plural_select_de")) {
function string_plural_select_de($n){
$n = intval($n);
return intval($n != 1);
}}
$a->strings['Forum Directory'] = 'Foren Verzeichnis';
$a->strings['Public access denied.'] = 'Öffentlicher Zugriff verweigert.';
$a->strings['No entries (some entries may be hidden).'] = 'Keine Einträge (einige Einträge könnten versteckt sein).';
$a->strings['Global Directory'] = 'Weltweites Verzeichnis';
$a->strings['Find on this site'] = 'Auf diesem Server suchen';
$a->strings['Results for:'] = 'Ergebnis für:';
$a->strings['Find'] = 'Finde';

View file

@ -0,0 +1,16 @@
<?php
$a->strings["Public access denied."] = "Publika atingo ne permesita.";
$a->strings["Global Directory"] = "Tutmonda Katalogo";
$a->strings["Find on this site"] = "Trovi en ĉi retejo";
$a->strings["Finding: "] = "Trovata:";
$a->strings["Site Directory"] = "Reteja Katalogo";
$a->strings["Find"] = "Trovi";
$a->strings["Age: "] = "Aĝo:";
$a->strings["Gender: "] = "Sekso:";
$a->strings["Location:"] = "Loko:";
$a->strings["Gender:"] = "Sekso:";
$a->strings["Status:"] = "Stato:";
$a->strings["Homepage:"] = "Hejmpaĝo:";
$a->strings["About:"] = "Pri:";
$a->strings["No entries (some entries may be hidden)."] = "Neniom da afiŝoj (kelkaj afiŝoj eble ne estas videbla).";

View file

@ -0,0 +1,49 @@
# ADDON forumdirectory
# Copyright (C)
# This file is distributed under the same license as the Friendica forumdirectory addon package.
#
#
# Translators:
# Albert, 2016
# Senex Petrovic <javierruizo@hotmail.com>, 2021
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-01 18:15+0100\n"
"PO-Revision-Date: 2021-04-01 09:54+0000\n"
"Last-Translator: Senex Petrovic <javierruizo@hotmail.com>\n"
"Language-Team: Spanish (http://www.transifex.com/Friendica/friendica/language/es/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: es\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: forumdirectory.php:33 forumdirectory.php:137
msgid "Forum Directory"
msgstr "Directorio de foro"
#: forumdirectory.php:53
msgid "Public access denied."
msgstr "Acceso público denegado."
#: forumdirectory.php:125
msgid "No entries (some entries may be hidden)."
msgstr "Sin entradas (algunas entradas pueden estar ocultas)."
#: forumdirectory.php:131
msgid "Global Directory"
msgstr "Directorio global"
#: forumdirectory.php:133
msgid "Find on this site"
msgstr "Encontrar en esta página"
#: forumdirectory.php:135
msgid "Results for:"
msgstr "Resultados para:"
#: forumdirectory.php:139
msgid "Find"
msgstr "Encontrar"

View file

@ -0,0 +1,14 @@
<?php
if(! function_exists("string_plural_select_es")) {
function string_plural_select_es($n){
$n = intval($n);
return intval($n != 1);
}}
$a->strings['Forum Directory'] = 'Directorio de foro';
$a->strings['Public access denied.'] = 'Acceso público denegado.';
$a->strings['No entries (some entries may be hidden).'] = 'Sin entradas (algunas entradas pueden estar ocultas).';
$a->strings['Global Directory'] = 'Directorio global';
$a->strings['Find on this site'] = 'Encontrar en esta página';
$a->strings['Results for:'] = 'Resultados para:';
$a->strings['Find'] = 'Encontrar';

View file

@ -0,0 +1,81 @@
# ADDON forumdirectory
# Copyright (C)
# This file is distributed under the same license as the Friendica forumdirectory addon package.
#
#
# Translators:
# Kris, 2018
# Kris, 2018
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-02-27 05:01-0500\n"
"PO-Revision-Date: 2018-05-12 12:50+0000\n"
"Last-Translator: Kris\n"
"Language-Team: Finnish (Finland) (http://www.transifex.com/Friendica/friendica/language/fi_FI/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: fi_FI\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: forumdirectory.php:22
msgid "Forum Directory"
msgstr "Foorumihakemisto"
#: forumdirectory.php:53
msgid "Public access denied."
msgstr "Julkinen käyttö estetty."
#: forumdirectory.php:71
msgid "Global Directory"
msgstr "Maailmanlaajuinen hakemisto"
#: forumdirectory.php:79
msgid "Find on this site"
msgstr "Sivustohaku"
#: forumdirectory.php:81
msgid "Finding: "
msgstr ""
#: forumdirectory.php:82
msgid "Site Directory"
msgstr "Sivustoluettelo"
#: forumdirectory.php:83
msgid "Find"
msgstr "Etsi"
#: forumdirectory.php:133
msgid "Age: "
msgstr "Ikä:"
#: forumdirectory.php:136
msgid "Gender: "
msgstr "Sukupuoli:"
#: forumdirectory.php:156
msgid "Location:"
msgstr "Sijainti:"
#: forumdirectory.php:158
msgid "Gender:"
msgstr "Sukupuoli:"
#: forumdirectory.php:160
msgid "Status:"
msgstr "Tila:"
#: forumdirectory.php:162
msgid "Homepage:"
msgstr "Kotisivu:"
#: forumdirectory.php:164
msgid "About:"
msgstr "Lisätietoja:"
#: forumdirectory.php:201
msgid "No entries (some entries may be hidden)."
msgstr "Ei kohteita (jotkut kohteet saattaa olla piilotettuja)."

View file

@ -0,0 +1,21 @@
<?php
if(! function_exists("string_plural_select_fi_fi")) {
function string_plural_select_fi_fi($n){
$n = intval($n);
return intval($n != 1);
}}
$a->strings['Forum Directory'] = 'Foorumihakemisto';
$a->strings['Public access denied.'] = 'Julkinen käyttö estetty.';
$a->strings['Global Directory'] = 'Maailmanlaajuinen hakemisto';
$a->strings['Find on this site'] = 'Sivustohaku';
$a->strings['Site Directory'] = 'Sivustoluettelo';
$a->strings['Find'] = 'Etsi';
$a->strings['Age: '] = 'Ikä:';
$a->strings['Gender: '] = 'Sukupuoli:';
$a->strings['Location:'] = 'Sijainti:';
$a->strings['Gender:'] = 'Sukupuoli:';
$a->strings['Status:'] = 'Tila:';
$a->strings['Homepage:'] = 'Kotisivu:';
$a->strings['About:'] = 'Lisätietoja:';
$a->strings['No entries (some entries may be hidden).'] = 'Ei kohteita (jotkut kohteet saattaa olla piilotettuja).';

View file

@ -0,0 +1,51 @@
# ADDON forumdirectory
# Copyright (C)
# This file is distributed under the same license as the Friendica forumdirectory addon package.
#
#
# Translators:
# bob lebonche <lebonche@tutanota.com>, 2021
# Hypolite Petovan <hypolite@mrpetovan.com>, 2016
# StefOfficiel <pichard.stephane@free.fr>, 2015
# Valvin <vincent-forum@valvin.fr>, 2019
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-01 18:15+0100\n"
"PO-Revision-Date: 2014-06-22 12:31+0000\n"
"Last-Translator: bob lebonche <lebonche@tutanota.com>, 2021\n"
"Language-Team: French (http://www.transifex.com/Friendica/friendica/language/fr/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: fr\n"
"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n"
#: forumdirectory.php:33 forumdirectory.php:137
msgid "Forum Directory"
msgstr "Annuaire de Forums"
#: forumdirectory.php:53
msgid "Public access denied."
msgstr "Accès public refusé."
#: forumdirectory.php:125
msgid "No entries (some entries may be hidden)."
msgstr "Pas de résultats (certains résultats peuvent être cachés)."
#: forumdirectory.php:131
msgid "Global Directory"
msgstr "Annuaire Global"
#: forumdirectory.php:133
msgid "Find on this site"
msgstr "Trouver sur cette instance"
#: forumdirectory.php:135
msgid "Results for:"
msgstr "Résultats pour :"
#: forumdirectory.php:139
msgid "Find"
msgstr "Chercher"

View file

@ -0,0 +1,14 @@
<?php
if(! function_exists("string_plural_select_fr")) {
function string_plural_select_fr($n){
$n = intval($n);
if (($n == 0 || $n == 1)) { return 0; } else if ($n != 0 && $n % 1000000 == 0) { return 1; } else { return 2; }
}}
$a->strings['Forum Directory'] = 'Annuaire de Forums';
$a->strings['Public access denied.'] = 'Accès public refusé.';
$a->strings['No entries (some entries may be hidden).'] = 'Pas de résultats (certains résultats peuvent être cachés).';
$a->strings['Global Directory'] = 'Annuaire Global';
$a->strings['Find on this site'] = 'Trouver sur cette instance';
$a->strings['Results for:'] = 'Résultats pour :';
$a->strings['Find'] = 'Chercher';

View file

@ -0,0 +1,48 @@
# ADDON forumdirectory
# Copyright (C)
# This file is distributed under the same license as the Friendica forumdirectory addon package.
#
#
# Translators:
# Balázs Úr, 2020-2021
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-01 18:15+0100\n"
"PO-Revision-Date: 2014-06-22 12:31+0000\n"
"Last-Translator: Balázs Úr, 2020-2021\n"
"Language-Team: Hungarian (http://www.transifex.com/Friendica/friendica/language/hu/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: hu\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: forumdirectory.php:33 forumdirectory.php:137
msgid "Forum Directory"
msgstr "Fórumkönyvtár"
#: forumdirectory.php:53
msgid "Public access denied."
msgstr "Nyilvános hozzáférés megtagadva."
#: forumdirectory.php:125
msgid "No entries (some entries may be hidden)."
msgstr "Nincsenek bejegyzések (néhány bejegyzés rejtve lehet)."
#: forumdirectory.php:131
msgid "Global Directory"
msgstr "Globális könyvtár"
#: forumdirectory.php:133
msgid "Find on this site"
msgstr "Keresés ezen az oldalon"
#: forumdirectory.php:135
msgid "Results for:"
msgstr "Találatok ehhez:"
#: forumdirectory.php:139
msgid "Find"
msgstr "Keresés"

View file

@ -0,0 +1,14 @@
<?php
if(! function_exists("string_plural_select_hu")) {
function string_plural_select_hu($n){
$n = intval($n);
return intval($n != 1);
}}
$a->strings['Forum Directory'] = 'Fórumkönyvtár';
$a->strings['Public access denied.'] = 'Nyilvános hozzáférés megtagadva.';
$a->strings['No entries (some entries may be hidden).'] = 'Nincsenek bejegyzések (néhány bejegyzés rejtve lehet).';
$a->strings['Global Directory'] = 'Globális könyvtár';
$a->strings['Find on this site'] = 'Keresés ezen az oldalon';
$a->strings['Results for:'] = 'Találatok ehhez:';
$a->strings['Find'] = 'Keresés';

View file

@ -0,0 +1,16 @@
<?php
$a->strings["Public access denied."] = "Alemennings aðgangur ekki veittur.";
$a->strings["Global Directory"] = "Heims tengiliða skrá";
$a->strings["Find on this site"] = "Leita á þessum vef";
$a->strings["Finding: "] = "Niðurstöður:";
$a->strings["Site Directory"] = "Vef tengiliða skrá";
$a->strings["Find"] = "Finna";
$a->strings["Age: "] = "Aldur:";
$a->strings["Gender: "] = "Kyn:";
$a->strings["Location:"] = "Staðsetning:";
$a->strings["Gender:"] = "Kyn:";
$a->strings["Status:"] = "Staða:";
$a->strings["Homepage:"] = "Heimasíða:";
$a->strings["About:"] = "Um:";
$a->strings["No entries (some entries may be hidden)."] = "Engar færslur (sumar geta verið faldar).";

View file

@ -0,0 +1,49 @@
# ADDON forumdirectory
# Copyright (C)
# This file is distributed under the same license as the Friendica forumdirectory addon package.
#
#
# Translators:
# fabrixxm <fabrix.xm@gmail.com>, 2014
# Sylke Vicious <silkevicious@gmail.com>, 2021
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-01 18:15+0100\n"
"PO-Revision-Date: 2021-02-16 12:56+0000\n"
"Last-Translator: Sylke Vicious <silkevicious@gmail.com>\n"
"Language-Team: Italian (http://www.transifex.com/Friendica/friendica/language/it/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: it\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: forumdirectory.php:33 forumdirectory.php:137
msgid "Forum Directory"
msgstr "Elenco Forum"
#: forumdirectory.php:53
msgid "Public access denied."
msgstr "Accesso negato."
#: forumdirectory.php:125
msgid "No entries (some entries may be hidden)."
msgstr "Nessuna voce (qualche voce potrebbe essere nascosta)."
#: forumdirectory.php:131
msgid "Global Directory"
msgstr "Elenco globale"
#: forumdirectory.php:133
msgid "Find on this site"
msgstr "Cerca nel sito"
#: forumdirectory.php:135
msgid "Results for:"
msgstr "Risultati per:"
#: forumdirectory.php:139
msgid "Find"
msgstr "Trova"

View file

@ -0,0 +1,14 @@
<?php
if(! function_exists("string_plural_select_it")) {
function string_plural_select_it($n){
$n = intval($n);
return intval($n != 1);
}}
$a->strings['Forum Directory'] = 'Elenco Forum';
$a->strings['Public access denied.'] = 'Accesso negato.';
$a->strings['No entries (some entries may be hidden).'] = 'Nessuna voce (qualche voce potrebbe essere nascosta).';
$a->strings['Global Directory'] = 'Elenco globale';
$a->strings['Find on this site'] = 'Cerca nel sito';
$a->strings['Results for:'] = 'Risultati per:';
$a->strings['Find'] = 'Trova';

View file

@ -0,0 +1,17 @@
<?php
$a->strings["Forum Directory"] = "";
$a->strings["Public access denied."] = "Offentlig tilgang ikke tillatt.";
$a->strings["Global Directory"] = "Global katalog";
$a->strings["Find on this site"] = "";
$a->strings["Finding: "] = "Fant:";
$a->strings["Site Directory"] = "Stedets katalog";
$a->strings["Find"] = "Finn";
$a->strings["Age: "] = "Alder:";
$a->strings["Gender: "] = "Kjønn:";
$a->strings["Location:"] = "Plassering:";
$a->strings["Gender:"] = "Kjønn:";
$a->strings["Status:"] = "Status:";
$a->strings["Homepage:"] = "Hjemmeside:";
$a->strings["About:"] = "Om:";
$a->strings["No entries (some entries may be hidden)."] = "Ingen oppføringer (noen oppføringer kan være skjulte).";

View file

@ -0,0 +1,80 @@
# ADDON forumdirectory
# Copyright (C)
# This file is distributed under the same license as the Friendica forumdirectory addon package.
#
#
# Translators:
# Jeroen De Meerleer <me@jeroened.be>, 2018
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-02-27 05:01-0500\n"
"PO-Revision-Date: 2018-08-24 13:21+0000\n"
"Last-Translator: Jeroen De Meerleer <me@jeroened.be>\n"
"Language-Team: Dutch (http://www.transifex.com/Friendica/friendica/language/nl/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: nl\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: forumdirectory.php:22
msgid "Forum Directory"
msgstr "Forum index"
#: forumdirectory.php:53
msgid "Public access denied."
msgstr "Publieke toegang geweigerd"
#: forumdirectory.php:71
msgid "Global Directory"
msgstr "Globaal overzicht"
#: forumdirectory.php:79
msgid "Find on this site"
msgstr "Zoeken"
#: forumdirectory.php:81
msgid "Finding: "
msgstr "Zoeken..."
#: forumdirectory.php:82
msgid "Site Directory"
msgstr "Site overzicht"
#: forumdirectory.php:83
msgid "Find"
msgstr "Zoek"
#: forumdirectory.php:133
msgid "Age: "
msgstr "Leeftijd:"
#: forumdirectory.php:136
msgid "Gender: "
msgstr "Geslacht:"
#: forumdirectory.php:156
msgid "Location:"
msgstr "Woonplaats:"
#: forumdirectory.php:158
msgid "Gender:"
msgstr "Geslacht:"
#: forumdirectory.php:160
msgid "Status:"
msgstr "Status:"
#: forumdirectory.php:162
msgid "Homepage:"
msgstr "Website:"
#: forumdirectory.php:164
msgid "About:"
msgstr "Over:"
#: forumdirectory.php:201
msgid "No entries (some entries may be hidden)."
msgstr "Geen berichten (sommige berichten kunnen verborgen zijn)."

View file

@ -0,0 +1,22 @@
<?php
if(! function_exists("string_plural_select_nl")) {
function string_plural_select_nl($n){
$n = intval($n);
return intval($n != 1);
}}
$a->strings['Forum Directory'] = 'Forum index';
$a->strings['Public access denied.'] = 'Publieke toegang geweigerd';
$a->strings['Global Directory'] = 'Globaal overzicht';
$a->strings['Find on this site'] = 'Zoeken';
$a->strings['Finding: '] = 'Zoeken...';
$a->strings['Site Directory'] = 'Site overzicht';
$a->strings['Find'] = 'Zoek';
$a->strings['Age: '] = 'Leeftijd:';
$a->strings['Gender: '] = 'Geslacht:';
$a->strings['Location:'] = 'Woonplaats:';
$a->strings['Gender:'] = 'Geslacht:';
$a->strings['Status:'] = 'Status:';
$a->strings['Homepage:'] = 'Website:';
$a->strings['About:'] = 'Over:';
$a->strings['No entries (some entries may be hidden).'] = 'Geen berichten (sommige berichten kunnen verborgen zijn).';

View file

@ -0,0 +1,50 @@
# ADDON forumdirectory
# Copyright (C)
# This file is distributed under the same license as the Friendica forumdirectory addon package.
#
#
# Translators:
# TORminator <dominik+foss@danelski.pl>, 2015
# Piotr Strębski <strebski@gmail.com>, 2022
# Waldemar Stoczkowski, 2018
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-01 18:15+0100\n"
"PO-Revision-Date: 2014-06-22 12:31+0000\n"
"Last-Translator: Piotr Strębski <strebski@gmail.com>, 2022\n"
"Language-Team: Polish (http://www.transifex.com/Friendica/friendica/language/pl/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: pl\n"
"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n"
#: forumdirectory.php:33 forumdirectory.php:137
msgid "Forum Directory"
msgstr "Katalog forum"
#: forumdirectory.php:53
msgid "Public access denied."
msgstr "Odmowa dostępu publicznego."
#: forumdirectory.php:125
msgid "No entries (some entries may be hidden)."
msgstr "Brak wpisów (niektóre wpisy mogą być ukryte)."
#: forumdirectory.php:131
msgid "Global Directory"
msgstr "Globalny katalog"
#: forumdirectory.php:133
msgid "Find on this site"
msgstr "Znajdź na tej stronie"
#: forumdirectory.php:135
msgid "Results for:"
msgstr "Wyniki dla:"
#: forumdirectory.php:139
msgid "Find"
msgstr "Szukaj"

View file

@ -0,0 +1,14 @@
<?php
if(! function_exists("string_plural_select_pl")) {
function string_plural_select_pl($n){
$n = intval($n);
if ($n==1) { return 0; } else if (($n%10>=2 && $n%10<=4) && ($n%100<12 || $n%100>14)) { return 1; } else if ($n!=1 && ($n%10>=0 && $n%10<=1) || ($n%10>=5 && $n%10<=9) || ($n%100>=12 && $n%100<=14)) { return 2; } else { return 3; }
}}
$a->strings['Forum Directory'] = 'Katalog forum';
$a->strings['Public access denied.'] = 'Odmowa dostępu publicznego.';
$a->strings['No entries (some entries may be hidden).'] = 'Brak wpisów (niektóre wpisy mogą być ukryte).';
$a->strings['Global Directory'] = 'Globalny katalog';
$a->strings['Find on this site'] = 'Znajdź na tej stronie';
$a->strings['Results for:'] = 'Wyniki dla:';
$a->strings['Find'] = 'Szukaj';

View file

@ -0,0 +1,80 @@
# ADDON forumdirectory
# Copyright (C)
# This file is distributed under the same license as the Friendica forumdirectory addon package.
#
#
# Translators:
# Beatriz Vital <vitalb@riseup.net>, 2016
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-02-27 05:01-0500\n"
"PO-Revision-Date: 2016-08-19 17:03+0000\n"
"Last-Translator: Beatriz Vital <vitalb@riseup.net>\n"
"Language-Team: Portuguese (Brazil) (http://www.transifex.com/Friendica/friendica/language/pt_BR/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: pt_BR\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: forumdirectory.php:22
msgid "Forum Directory"
msgstr "Diretório de Fóruns"
#: forumdirectory.php:53
msgid "Public access denied."
msgstr "Acesso do público negado."
#: forumdirectory.php:71
msgid "Global Directory"
msgstr "Diretório Global"
#: forumdirectory.php:79
msgid "Find on this site"
msgstr "Procurar neste site"
#: forumdirectory.php:81
msgid "Finding: "
msgstr "Procurando:"
#: forumdirectory.php:82
msgid "Site Directory"
msgstr "Diretório do Site"
#: forumdirectory.php:83
msgid "Find"
msgstr "Procurar"
#: forumdirectory.php:133
msgid "Age: "
msgstr "Idade:"
#: forumdirectory.php:136
msgid "Gender: "
msgstr "Sexo:"
#: forumdirectory.php:156
msgid "Location:"
msgstr "Local:"
#: forumdirectory.php:158
msgid "Gender:"
msgstr "Sexo:"
#: forumdirectory.php:160
msgid "Status:"
msgstr "Estado:"
#: forumdirectory.php:162
msgid "Homepage:"
msgstr "Página principal:"
#: forumdirectory.php:164
msgid "About:"
msgstr "Sobre:"
#: forumdirectory.php:201
msgid "No entries (some entries may be hidden)."
msgstr "Sem resultados (alguns resultados podem estar ocultos)."

View file

@ -0,0 +1,22 @@
<?php
if(! function_exists("string_plural_select_pt_br")) {
function string_plural_select_pt_br($n){
$n = intval($n);
return intval($n > 1);
}}
$a->strings['Forum Directory'] = 'Diretório de Fóruns';
$a->strings['Public access denied.'] = 'Acesso do público negado.';
$a->strings['Global Directory'] = 'Diretório Global';
$a->strings['Find on this site'] = 'Procurar neste site';
$a->strings['Finding: '] = 'Procurando:';
$a->strings['Site Directory'] = 'Diretório do Site';
$a->strings['Find'] = 'Procurar';
$a->strings['Age: '] = 'Idade:';
$a->strings['Gender: '] = 'Sexo:';
$a->strings['Location:'] = 'Local:';
$a->strings['Gender:'] = 'Sexo:';
$a->strings['Status:'] = 'Estado:';
$a->strings['Homepage:'] = 'Página principal:';
$a->strings['About:'] = 'Sobre:';
$a->strings['No entries (some entries may be hidden).'] = 'Sem resultados (alguns resultados podem estar ocultos).';

View file

@ -0,0 +1,79 @@
# ADDON forumdirectory
# Copyright (C)
# This file is distributed under the same license as the Friendica forumdirectory addon package.
#
#
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-02-27 05:01-0500\n"
"PO-Revision-Date: 2014-07-08 11:49+0000\n"
"Last-Translator: Arian - Cazare Muncitori <arianserv@gmail.com>\n"
"Language-Team: Romanian (Romania) (http://www.transifex.com/projects/p/friendica/language/ro_RO/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ro_RO\n"
"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n"
#: forumdirectory.php:22
msgid "Forum Directory"
msgstr "Director Forum"
#: forumdirectory.php:53
msgid "Public access denied."
msgstr "Acces public refuzat."
#: forumdirectory.php:71
msgid "Global Directory"
msgstr "Director Global"
#: forumdirectory.php:79
msgid "Find on this site"
msgstr "Căutați pe acest site"
#: forumdirectory.php:81
msgid "Finding: "
msgstr "Căutare:"
#: forumdirectory.php:82
msgid "Site Directory"
msgstr "Director Site"
#: forumdirectory.php:83
msgid "Find"
msgstr "Căutați"
#: forumdirectory.php:133
msgid "Age: "
msgstr "Vârsta:"
#: forumdirectory.php:136
msgid "Gender: "
msgstr "Sex:"
#: forumdirectory.php:156
msgid "Location:"
msgstr "Locație:"
#: forumdirectory.php:158
msgid "Gender:"
msgstr "Sex:"
#: forumdirectory.php:160
msgid "Status:"
msgstr "Status:"
#: forumdirectory.php:162
msgid "Homepage:"
msgstr "Pagină web:"
#: forumdirectory.php:164
msgid "About:"
msgstr "Despre:"
#: forumdirectory.php:201
msgid "No entries (some entries may be hidden)."
msgstr "Fără înregistrări (unele înregistrări pot fi ascunse)."

View file

@ -0,0 +1,22 @@
<?php
if(! function_exists("string_plural_select_ro")) {
function string_plural_select_ro($n){
$n = intval($n);
if ($n==1) { return 0; } else if ((($n%100>19)||(($n%100==0)&&($n!=0)))) { return 2; } else { return 1; }
}}
$a->strings['Forum Directory'] = 'Director Forum';
$a->strings['Public access denied.'] = 'Acces public refuzat.';
$a->strings['Global Directory'] = 'Director Global';
$a->strings['Find on this site'] = 'Căutați pe acest site';
$a->strings['Finding: '] = 'Căutare:';
$a->strings['Site Directory'] = 'Director Site';
$a->strings['Find'] = 'Căutați';
$a->strings['Age: '] = 'Vârsta:';
$a->strings['Gender: '] = 'Sex:';
$a->strings['Location:'] = 'Locație:';
$a->strings['Gender:'] = 'Sex:';
$a->strings['Status:'] = 'Status:';
$a->strings['Homepage:'] = 'Pagină web:';
$a->strings['About:'] = 'Despre:';
$a->strings['No entries (some entries may be hidden).'] = 'Fără înregistrări (unele înregistrări pot fi ascunse).';

View file

@ -0,0 +1,80 @@
# ADDON forumdirectory
# Copyright (C)
# This file is distributed under the same license as the Friendica forumdirectory addon package.
#
#
# Translators:
# Stanislav N. <pztrn@pztrn.name>, 2017
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-02-27 05:01-0500\n"
"PO-Revision-Date: 2017-04-08 17:12+0000\n"
"Last-Translator: Stanislav N. <pztrn@pztrn.name>\n"
"Language-Team: Russian (http://www.transifex.com/Friendica/friendica/language/ru/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ru\n"
"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n"
#: forumdirectory.php:22
msgid "Forum Directory"
msgstr "Каталог форумов"
#: forumdirectory.php:53
msgid "Public access denied."
msgstr "Свободный доступ закрыт."
#: forumdirectory.php:71
msgid "Global Directory"
msgstr "Глобальный каталог"
#: forumdirectory.php:79
msgid "Find on this site"
msgstr "Найти на этом сайте"
#: forumdirectory.php:81
msgid "Finding: "
msgstr "Результат поиска: "
#: forumdirectory.php:82
msgid "Site Directory"
msgstr "Каталог сайта"
#: forumdirectory.php:83
msgid "Find"
msgstr "Найти"
#: forumdirectory.php:133
msgid "Age: "
msgstr "Возраст: "
#: forumdirectory.php:136
msgid "Gender: "
msgstr "Пол: "
#: forumdirectory.php:156
msgid "Location:"
msgstr "Откуда:"
#: forumdirectory.php:158
msgid "Gender:"
msgstr "Пол:"
#: forumdirectory.php:160
msgid "Status:"
msgstr "Статус:"
#: forumdirectory.php:162
msgid "Homepage:"
msgstr "Домашняя страничка:"
#: forumdirectory.php:164
msgid "About:"
msgstr "О себе:"
#: forumdirectory.php:201
msgid "No entries (some entries may be hidden)."
msgstr "Нет записей (некоторые записи могут быть скрыты)."

View file

@ -0,0 +1,22 @@
<?php
if(! function_exists("string_plural_select_ru")) {
function string_plural_select_ru($n){
$n = intval($n);
if ($n%10==1 && $n%100!=11) { return 0; } else if ($n%10>=2 && $n%10<=4 && ($n%100<12 || $n%100>14)) { return 1; } else if ($n%10==0 || ($n%10>=5 && $n%10<=9) || ($n%100>=11 && $n%100<=14)) { return 2; } else { return 3; }
}}
$a->strings['Forum Directory'] = 'Каталог форумов';
$a->strings['Public access denied.'] = 'Свободный доступ закрыт.';
$a->strings['Global Directory'] = 'Глобальный каталог';
$a->strings['Find on this site'] = 'Найти на этом сайте';
$a->strings['Finding: '] = 'Результат поиска: ';
$a->strings['Site Directory'] = 'Каталог сайта';
$a->strings['Find'] = 'Найти';
$a->strings['Age: '] = 'Возраст: ';
$a->strings['Gender: '] = 'Пол: ';
$a->strings['Location:'] = 'Откуда:';
$a->strings['Gender:'] = 'Пол:';
$a->strings['Status:'] = 'Статус:';
$a->strings['Homepage:'] = 'Домашняя страничка:';
$a->strings['About:'] = 'О себе:';
$a->strings['No entries (some entries may be hidden).'] = 'Нет записей (некоторые записи могут быть скрыты).';

View file

@ -0,0 +1,49 @@
# ADDON forumdirectory
# Copyright (C)
# This file is distributed under the same license as the Friendica forumdirectory addon package.
#
#
# Translators:
# Hypolite Petovan <hypolite@mrpetovan.com>, 2019
# Kristoffer Grundström <lovaren@gmail.com>, 2022
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-01 18:15+0100\n"
"PO-Revision-Date: 2022-01-15 23:39+0000\n"
"Last-Translator: Kristoffer Grundström <lovaren@gmail.com>\n"
"Language-Team: Swedish (http://www.transifex.com/Friendica/friendica/language/sv/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: sv\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: forumdirectory.php:33 forumdirectory.php:137
msgid "Forum Directory"
msgstr "Forum-mapp"
#: forumdirectory.php:53
msgid "Public access denied."
msgstr "Publik åtkomst nekades."
#: forumdirectory.php:125
msgid "No entries (some entries may be hidden)."
msgstr "Inget att visa. (Man kan välja att inte synas här)"
#: forumdirectory.php:131
msgid "Global Directory"
msgstr "Medlemskatalog för flera sajter (global)"
#: forumdirectory.php:133
msgid "Find on this site"
msgstr "Hitta på den här sidan"
#: forumdirectory.php:135
msgid "Results for:"
msgstr ""
#: forumdirectory.php:139
msgid "Find"
msgstr "Sök"

View file

@ -0,0 +1,13 @@
<?php
if(! function_exists("string_plural_select_sv")) {
function string_plural_select_sv($n){
$n = intval($n);
return intval($n != 1);
}}
$a->strings['Forum Directory'] = 'Forum-mapp';
$a->strings['Public access denied.'] = 'Publik åtkomst nekades.';
$a->strings['No entries (some entries may be hidden).'] = 'Inget att visa. (Man kan välja att inte synas här)';
$a->strings['Global Directory'] = 'Medlemskatalog för flera sajter (global)';
$a->strings['Find on this site'] = 'Hitta på den här sidan';
$a->strings['Find'] = 'Sök';

View file

@ -0,0 +1,17 @@
<?php
$a->strings["Forum Directory"] = "评坛目录";
$a->strings["Public access denied."] = "公众看拒绝";
$a->strings["Global Directory"] = "综合目录";
$a->strings["Find on this site"] = "找在这网站";
$a->strings["Finding: "] = "找着:";
$a->strings["Site Directory"] = "网站目录";
$a->strings["Find"] = "搜索";
$a->strings["Age: "] = "年纪:";
$a->strings["Gender: "] = "性别:";
$a->strings["Location:"] = "位置:";
$a->strings["Gender:"] = "性别:";
$a->strings["Status:"] = "现状:";
$a->strings["Homepage:"] = "主页:";
$a->strings["About:"] = "关于:";
$a->strings["No entries (some entries may be hidden)."] = "没有文章(有的文章会被隐藏)。";

View file

@ -180,5 +180,5 @@ function ifttt_message($uid, $item)
$link = hash('ripemd128', $item['msg']);
}
Post\Delayed::add($link, $post, Worker::PRIORITY_MEDIUM, Post\Delayed::PREPARED);
Post\Delayed::add($link, $post, Worker::PRIORITY_MEDIUM, Post\Delayed::UNPREPARED);
}

View file

@ -14,7 +14,7 @@ use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\DI;
use Friendica\Core\Config\Util\ConfigFileManager;
use Friendica\Util\Proxy as ProxyUtils;
use Friendica\Model\User;
function impressum_install()
{
@ -45,7 +45,7 @@ function obfuscate_email (string $s): string
function impressum_footer(string &$body)
{
$text = ProxyUtils::proxifyHtml(BBCode::convert(DI::config()->get('impressum', 'footer_text')));
$text = BBCode::convertForUriId(User::getSystemUriId(), DI::config()->get('impressum', 'footer_text'));
if ($text != '') {
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl() . '/addon/impressum/impressum.css" media="all" />';
@ -64,8 +64,8 @@ function impressum_show(string &$body)
$body .= '<h3>' . DI::l10n()->t('Impressum') . '</h3>';
$owner = DI::config()->get('impressum', 'owner');
$owner_profile = DI::config()->get('impressum', 'ownerprofile');
$postal = ProxyUtils::proxifyHtml(BBCode::convert(DI::config()->get('impressum', 'postal')));
$notes = ProxyUtils::proxifyHtml(BBCode::convert(DI::config()->get('impressum', 'notes')));
$postal = BBCode::convertForUriId(User::getSystemUriId(), DI::config()->get('impressum', 'postal'));
$notes = BBCode::convertForUriId(User::getSystemUriId(), DI::config()->get('impressum', 'notes'));
if ($owner) {
if ($owner_profile) {

4
invidious/README.md Normal file
View file

@ -0,0 +1,4 @@
invidious Addon for Friendica
==========================
This addon will replace "youtube.com" with the chosen Invidious instance

103
invidious/invidious.php Normal file
View file

@ -0,0 +1,103 @@
<?php
/*
* Name: invidious
* Description: Replaces links to youtube.com to an invidious instance in all displays of postings on a node.
* Version: 0.3
* Author: Matthias Ebers <https://loma.ml/profile/feb>
* Author: Michael Vogel <https://pirati.ca/profile/heluecht>
*
*/
use Friendica\Core\Hook;
use Friendica\Core\Renderer;
use Friendica\DI;
CONST INVIDIOUS_DEFAULT = 'https://invidio.us';
function invidious_install()
{
Hook::register('prepare_body_final', __FILE__, 'invidious_render');
Hook::register('addon_settings', __FILE__, 'invidious_settings');
Hook::register('addon_settings_post', __FILE__, 'invidious_settings_post');
}
/* Handle the send data from the admin settings
*/
function invidious_addon_admin_post()
{
DI::config()->set('invidious', 'server', trim($_POST['invidiousserver'], " \n\r\t\v\x00/"));
}
/* Hook into the admin settings to let the admin choose an
* invidious server to use for the replacement.
*/
function invidious_addon_admin(string &$o)
{
$invidiousserver = DI::config()->get('invidious', 'server', INVIDIOUS_DEFAULT);
$t = Renderer::getMarkupTemplate('admin.tpl', 'addon/invidious/');
$o = Renderer::replaceMacros($t, [
'$settingdescription' => DI::l10n()->t('Which Invidious server shall be used for the replacements in the post bodies? Use the URL with servername and protocol. See %s for a list of available public Invidious servers.', 'https://redirect.invidious.io'),
'$invidiousserver' => ['invidiousserver', DI::l10n()->t('Invidious server'), $invidiousserver, DI::l10n()->t('See %s for a list of available Invidious servers.', '<a href="https://api.invidious.io/">https://api.invidious.io/</a>')],
'$submit' => DI::l10n()->t('Save Settings'),
]);
}
function invidious_settings(array &$data)
{
if (!DI::userSession()->getLocalUserId()) {
return;
}
$enabled = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'invidious', 'enabled');
$server = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'invidious', 'server', DI::config()->get('invidious', 'server', INVIDIOUS_DEFAULT));
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/invidious/');
$html = Renderer::replaceMacros($t, [
'$enabled' => ['enabled', DI::l10n()->t('Replace Youtube links with links to an Invidious server'), $enabled, DI::l10n()->t('If enabled, Youtube links are replaced with the links to the specified Invidious server.')],
'$server' => ['server', DI::l10n()->t('Invidious server'), $server, DI::l10n()->t('See %s for a list of available Invidious servers.', '<a href="https://api.invidious.io/">https://api.invidious.io/</a>')],
]);
$data = [
'addon' => 'invidious',
'title' => DI::l10n()->t('Invidious Settings'),
'html' => $html,
];
}
function invidious_settings_post(array &$b)
{
if (!DI::userSession()->getLocalUserId() || empty($_POST['invidious-submit'])) {
return;
}
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'invidious', 'enabled', (bool)$_POST['enabled']);
$server = trim($_POST['server'], " \n\r\t\v\x00/");
if ($server != DI::config()->get('invidious', 'server', INVIDIOUS_DEFAULT) && !empty($server)) {
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'invidious', 'server', $server);
} else {
DI::pConfig()->delete(DI::userSession()->getLocalUserId(), 'invidious', 'server');
}
}
/*
* replace "youtube.com" with the chosen Invidious instance
*/
function invidious_render(array &$b)
{
if (!DI::userSession()->getLocalUserId() || !DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'invidious', 'enabled')) {
return;
}
$original = $b['html'];
$server = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'invidious', 'server', DI::config()->get('invidious', 'server', INVIDIOUS_DEFAULT));
$b['html'] = preg_replace("/https?:\/\/www.youtube.com\/watch\?v\=(.*?)/ism", $server . '/watch?v=$1', $b['html']);
$b['html'] = preg_replace("/https?:\/\/www.youtube.com\/embed\/(.*?)/ism", $server . '/embed/$1', $b['html']);
$b['html'] = preg_replace("/https?:\/\/www.youtube.com\/shorts\/(.*?)/ism", $server . '/shorts/$1', $b['html']);
$b['html'] = preg_replace("/https?:\/\/youtu.be\/(.*?)/ism", $server . '/watch?v=$1', $b['html']);
if ($original != $b['html']) {
$b['html'] .= '<hr><p><small>' . DI::l10n()->t('(Invidious addon enabled: YouTube links via %s)', $server) . '</small></p>';
}
}

View file

@ -0,0 +1,58 @@
# ADDON invidious
# Copyright (C)
# This file is distributed under the same license as the Friendica invidious addon package.
#
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-12-18 17:23+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: invidious.php:39
#, php-format
msgid ""
"Which Invidious server shall be used for the replacements in the post "
"bodies? Use the URL with servername and protocol. See %s for a list of "
"available public Invidious servers."
msgstr ""
#: invidious.php:40 invidious.php:57
msgid "Invidious server"
msgstr ""
#: invidious.php:40 invidious.php:57
#, php-format
msgid "See %s for a list of available Invidious servers."
msgstr ""
#: invidious.php:41
msgid "Save Settings"
msgstr ""
#: invidious.php:56
msgid "Replace Youtube links with links to an Invidious server"
msgstr ""
#: invidious.php:56
msgid ""
"If enabled, Youtube links are replaced with the links to the specified "
"Invidious server."
msgstr ""
#: invidious.php:62
msgid "Invidious Settings"
msgstr ""
#: invidious.php:101
#, php-format
msgid "(Invidious addon enabled: YouTube links via %s)"
msgstr ""

View file

@ -0,0 +1,5 @@
<p>{{$settingdescription}}</p>
{{include file="field_input.tpl" field=$invidiousserver}}
<div class="submit"><input type="submit" name="page_site" value="{{$submit}}" /></div>

View file

@ -0,0 +1,2 @@
{{include file="field_checkbox.tpl" field=$enabled}}
{{include file="field_input.tpl" field=$server}}

View file

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-03-23 23:53-0400\n"
"POT-Creation-Date: 2023-06-03 15:49-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -17,40 +17,40 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: js_upload.php:34
#: js_upload.php:37
msgid "Select files for upload"
msgstr ""
#: js_upload.php:35
#: js_upload.php:38
msgid "Drop files here to upload"
msgstr ""
#: js_upload.php:36
#: js_upload.php:39
msgid "Cancel"
msgstr ""
#: js_upload.php:37
#: js_upload.php:40
msgid "Failed"
msgstr ""
#: js_upload.php:215
#: js_upload.php:209
msgid "No files were uploaded."
msgstr ""
#: js_upload.php:221
#: js_upload.php:215
msgid "Uploaded file is empty"
msgstr ""
#: js_upload.php:233
#: js_upload.php:227
#, php-format
msgid "Image exceeds size limit of %s"
msgstr ""
#: js_upload.php:245
#: js_upload.php:239
#, php-format
msgid "File has an invalid extension, it should be one of %s."
msgstr ""
#: js_upload.php:256
#: js_upload.php:250
msgid "Upload was cancelled, or server error encountered"
msgstr ""

View file

@ -35,18 +35,18 @@
let albumElm = document.getElementById('photos-upload-album-select');
let contact_allow = document.querySelector('[name="contact_allow"]:not(:disabled)');
let group_allow = document.querySelector('[name="group_allow"]:not(:disabled)');
let contact_deny = document.querySelector('[name="contact_deny"]:not(:disabled)');
let group_deny = document.querySelector('[name="group_deny"]:not(:disabled)');
let circle_allow = document.querySelector('[name="circle_allow"]:not(:disabled)');
let contact_deny = document.querySelector('[name="contact_deny"]:not(:disabled)');
let circle_deny = document.querySelector('[name="circle_deny"]:not(:disabled)');
uploader.setParams({
newalbum : newalbumElm ? newalbumElm.value : '',
album : albumElm ? albumElm.value : '',
not_visible : document.getElementById('photos-upload-noshare').checked,
contact_allow : contact_allow ? contact_allow.value : '',
group_allow : group_allow ? group_allow.value : '',
circle_allow : circle_allow ? circle_allow.value : '',
contact_deny : contact_deny ? contact_deny.value : '',
group_deny : group_deny ? group_deny.value : '',
circle_deny : circle_deny ? circle_deny.value : '',
});
}
});

View file

@ -4,63 +4,59 @@
#
#
# Translators:
# Alexander An <ravnina@gmail.com>, 2020
# Alexander An <ravnina@gmail.com>, 2020,2023
# Stanislav N. <pztrn@pztrn.name>, 2018
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-10-03 22:02-0400\n"
"PO-Revision-Date: 2020-10-09 17:48+0000\n"
"Last-Translator: Alexander An <ravnina@gmail.com>\n"
"Language-Team: Russian (http://www.transifex.com/Friendica/friendica/language/ru/)\n"
"POT-Creation-Date: 2021-11-21 19:15-0500\n"
"PO-Revision-Date: 2015-07-25 08:05+0000\n"
"Last-Translator: Alexander An <ravnina@gmail.com>, 2020,2023\n"
"Language-Team: Russian (http://app.transifex.com/Friendica/friendica/language/ru/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ru\n"
"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n"
#: langfilter.php:52
msgid "Language Filter"
msgstr "Языковой фильтр"
#: langfilter.php:53
#: langfilter.php:49
msgid ""
"This addon tries to identify the language posts are written in. If it does "
"not match any language specified below, posts will be hidden by collapsing "
"them."
msgstr "Это дополнение пытается идентифицировать язык, на котором написаны посты. Если язык не соответствует ни одному, указанному ниже, то такие посты будут скрыты."
msgstr "Это дополнение пытается идентифицировать язык, на котором сделаны записи. Если язык не соответствует ни одному, указанному ниже, то такие посты будут свёрнуты."
#: langfilter.php:54
#: langfilter.php:50
msgid "Use the language filter"
msgstr "Использовать языковой фильтр"
#: langfilter.php:55
#: langfilter.php:51
msgid "Able to read"
msgstr "Возможность читать"
#: langfilter.php:55
#: langfilter.php:51
msgid ""
"List of abbreviations (ISO 639-1 codes) for languages you speak, comma "
"separated. For example \"de,it\"."
msgstr "Список аббревиатур (кодов по ISO 639-1 ) для языков, на которых вы говорите. Например, \"ru,en\"."
#: langfilter.php:56
#: langfilter.php:52
msgid "Minimum confidence in language detection"
msgstr "Минимальная уверенность в определении языка"
#: langfilter.php:56
#: langfilter.php:52
msgid ""
"Minimum confidence in language detection being correct, from 0 to 100. Posts"
" will not be filtered when the confidence of language detection is below "
"this percent value."
msgstr "Минимальная уверенность в правильном определении языка, от 0 до 100. Посты не будут скрыты, если уверенность в правильном определении языка в процентах ниже этого значения."
#: langfilter.php:57
#: langfilter.php:53
msgid "Minimum length of message body"
msgstr "Минимальная длина тела сообщения"
#: langfilter.php:57
#: langfilter.php:53
msgid ""
"Minimum number of characters in message body for filter to be used. Posts "
"shorter than this will not be filtered. Note: Language detection is "
@ -68,10 +64,14 @@ msgid ""
msgstr "Минимальное количество знаков в теле сообщения для применения фильтрации. Посты, длина которых меньше указанного значения, не будут отфильтрованы. Обратите внимание, что определение языка работает ненадежно для небольших постов (<200 символов)."
#: langfilter.php:58
msgid "Language Filter"
msgstr "Языковой фильтр"
#: langfilter.php:60
msgid "Save Settings"
msgstr "Сохранить настройки"
#: langfilter.php:189
#: langfilter.php:193
#, php-format
msgid "Filtered language: %s"
msgstr "Отфильтрованный язык: %s"

View file

@ -5,8 +5,7 @@ function string_plural_select_ru($n){
$n = intval($n);
if ($n%10==1 && $n%100!=11) { return 0; } else if ($n%10>=2 && $n%10<=4 && ($n%100<12 || $n%100>14)) { return 1; } else if ($n%10==0 || ($n%10>=5 && $n%10<=9) || ($n%100>=11 && $n%100<=14)) { return 2; } else { return 3; }
}}
$a->strings['Language Filter'] = 'Языковой фильтр';
$a->strings['This addon tries to identify the language posts are written in. If it does not match any language specified below, posts will be hidden by collapsing them.'] = 'Это дополнение пытается идентифицировать язык, на котором написаны посты. Если язык не соответствует ни одному, указанному ниже, то такие посты будут скрыты.';
$a->strings['This addon tries to identify the language posts are written in. If it does not match any language specified below, posts will be hidden by collapsing them.'] = 'Это дополнение пытается идентифицировать язык, на котором сделаны записи. Если язык не соответствует ни одному, указанному ниже, то такие посты будут свёрнуты.';
$a->strings['Use the language filter'] = 'Использовать языковой фильтр';
$a->strings['Able to read'] = 'Возможность читать';
$a->strings['List of abbreviations (ISO 639-1 codes) for languages you speak, comma separated. For example "de,it".'] = 'Список аббревиатур (кодов по ISO 639-1 ) для языков, на которых вы говорите. Например, "ru,en".';
@ -14,5 +13,6 @@ $a->strings['Minimum confidence in language detection'] = 'Минимальна
$a->strings['Minimum confidence in language detection being correct, from 0 to 100. Posts will not be filtered when the confidence of language detection is below this percent value.'] = 'Минимальная уверенность в правильном определении языка, от 0 до 100. Посты не будут скрыты, если уверенность в правильном определении языка в процентах ниже этого значения.';
$a->strings['Minimum length of message body'] = 'Минимальная длина тела сообщения';
$a->strings['Minimum number of characters in message body for filter to be used. Posts shorter than this will not be filtered. Note: Language detection is unreliable for short content (<200 characters).'] = 'Минимальное количество знаков в теле сообщения для применения фильтрации. Посты, длина которых меньше указанного значения, не будут отфильтрованы. Обратите внимание, что определение языка работает ненадежно для небольших постов (<200 символов).';
$a->strings['Language Filter'] = 'Языковой фильтр';
$a->strings['Save Settings'] = 'Сохранить настройки';
$a->strings['Filtered language: %s'] = 'Отфильтрованный язык: %s';

View file

@ -122,7 +122,7 @@ function langfilter_prepare_body_content_filter(&$hook_data)
$naked_body = strip_tags(
$hook_data['item']['rendered-html']
??''?: // Equivalent of !empty()
BBCode::convert($hook_data['item']['body'], false, BBCode::ACTIVITYPUB, true)
BBCode::convertForUriId($hook_data['item']['uri-id'], $hook_data['item']['body'], BBCode::ACTIVITYPUB)
);
$naked_body = preg_replace('#\s+#', ' ', trim($naked_body));
@ -163,7 +163,7 @@ function langfilter_prepare_body_content_filter(&$hook_data)
return;
}
$lang = $iso639->languageByCode1($iso2);
$lang = $iso639->languageByCode1(substr($iso2, 0, 2));
} else {
$opts = $hook_data['item']['postopts'];
if (!$opts) {

View file

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-11-21 19:17-0500\n"
"POT-Creation-Date: 2023-06-03 15:49-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -21,22 +21,22 @@ msgstr ""
msgid "Post to libertree"
msgstr ""
#: libertree.php:60
#: libertree.php:59
msgid "Enable Libertree Post Addon"
msgstr ""
#: libertree.php:61
#: libertree.php:60
msgid "Libertree site URL"
msgstr ""
#: libertree.php:62
#: libertree.php:61
msgid "Libertree API token"
msgstr ""
#: libertree.php:63
#: libertree.php:62
msgid "Post to Libertree by default"
msgstr ""
#: libertree.php:68
#: libertree.php:67
msgid "Libertree Export"
msgstr ""

View file

@ -151,7 +151,7 @@ function libertree_send(array &$b)
}
// Dont't post if the post doesn't belong to us.
// This is a check for forum postings
// This is a check for group postings
$self = DBA::selectFirst('contact', ['id'], ['uid' => $b['uid'], 'self' => true]);
if ($b['contact-id'] != $self['id']) {
return;

View file

@ -4,6 +4,7 @@
#
#
# Translators:
# Florent C., 2023
# Nicolas Derive, 2022
# ea1cd8241cb389ffb6f92bc6891eff5d_dc12308 <70dced5587d47e18d88f9298024d96f8_93383>, 2015
# StefOfficiel <pichard.stephane@free.fr>, 2015
@ -13,8 +14,8 @@ msgstr ""
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-11-21 19:15-0500\n"
"PO-Revision-Date: 2014-06-23 09:54+0000\n"
"Last-Translator: Nicolas Derive, 2022\n"
"Language-Team: French (http://www.transifex.com/Friendica/friendica/language/fr/)\n"
"Last-Translator: Florent C., 2023\n"
"Language-Team: French (http://app.transifex.com/Friendica/friendica/language/fr/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
@ -33,68 +34,72 @@ msgstr "Adresse de courriel de laquelle les éléments du flux sembleront proven
msgid "Save Settings"
msgstr "Sauvegarder les paramètres"
#: mailstream.php:301
#: mailstream.php:311
msgid "Re:"
msgstr "Re :"
#: mailstream.php:314 mailstream.php:317
#: mailstream.php:324 mailstream.php:327
msgid "Friendica post"
msgstr "Message Friendica"
#: mailstream.php:320
#: mailstream.php:330
msgid "Diaspora post"
msgstr "Message Diaspora"
#: mailstream.php:330
#: mailstream.php:340
msgid "Feed item"
msgstr "Élément du flux"
#: mailstream.php:333
#: mailstream.php:343
msgid "Email"
msgstr "Courriel"
#: mailstream.php:335
#: mailstream.php:345
msgid "Friendica Item"
msgstr "Élément de Friendica"
#: mailstream.php:404
#: mailstream.php:419
msgid "Upstream"
msgstr "En amont"
#: mailstream.php:405
#: mailstream.php:420
msgid "URI"
msgstr "URI"
#: mailstream.php:421
msgid "Local"
msgstr "Local"
#: mailstream.php:481
#: mailstream.php:499
msgid "Enabled"
msgstr "Activer"
#: mailstream.php:486
#: mailstream.php:504
msgid "Email Address"
msgstr "Adresse de courriel"
#: mailstream.php:488
#: mailstream.php:506
msgid "Leave blank to use your account email address"
msgstr "Laissez vide pour utiliser l'adresse de courriel de votre compte"
#: mailstream.php:492
#: mailstream.php:510
msgid "Exclude Likes"
msgstr "Exclure les \"j'aime\""
#: mailstream.php:494
#: mailstream.php:512
msgid "Check this to omit mailing \"Like\" notifications"
msgstr "Cochez ceci pour éviter d'envoyer les notifications des \"J'aime\""
#: mailstream.php:498
#: mailstream.php:516
msgid "Attach Images"
msgstr "Attacher les images"
#: mailstream.php:500
#: mailstream.php:518
msgid ""
"Download images in posts and attach them to the email. Useful for reading "
"email while offline."
msgstr "Télécharger les images des messages et les attacher au courriel. Utile pour les les courriels hors-ligne."
#: mailstream.php:507
#: mailstream.php:525
msgid "Mail Stream Settings"
msgstr "Paramètres de Mail Stream"

View file

@ -15,6 +15,7 @@ $a->strings['Feed item'] = 'Élément du flux';
$a->strings['Email'] = 'Courriel';
$a->strings['Friendica Item'] = 'Élément de Friendica';
$a->strings['Upstream'] = 'En amont';
$a->strings['URI'] = 'URI';
$a->strings['Local'] = 'Local';
$a->strings['Enabled'] = 'Activer';
$a->strings['Email Address'] = 'Adresse de courriel';

View file

@ -4,15 +4,15 @@
#
#
# Translators:
# Balázs Úr, 2020-2021
# Balázs Úr, 2020-2021,2023
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-11-21 19:15-0500\n"
"PO-Revision-Date: 2014-06-23 09:54+0000\n"
"Last-Translator: Balázs Úr, 2020-2021\n"
"Language-Team: Hungarian (http://www.transifex.com/Friendica/friendica/language/hu/)\n"
"Last-Translator: Balázs Úr, 2020-2021,2023\n"
"Language-Team: Hungarian (http://app.transifex.com/Friendica/friendica/language/hu/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
@ -31,68 +31,72 @@ msgstr "E-mail-cím, ahonnan úgy tűnik, hogy a folyam elemei származnak."
msgid "Save Settings"
msgstr "Beállítások mentése"
#: mailstream.php:301
#: mailstream.php:311
msgid "Re:"
msgstr "Vá:"
#: mailstream.php:314 mailstream.php:317
#: mailstream.php:324 mailstream.php:327
msgid "Friendica post"
msgstr "Friendica-bejegyzés"
#: mailstream.php:320
#: mailstream.php:330
msgid "Diaspora post"
msgstr "Diaspora-bejegyzés"
#: mailstream.php:330
#: mailstream.php:340
msgid "Feed item"
msgstr "Hírforráselem"
#: mailstream.php:333
#: mailstream.php:343
msgid "Email"
msgstr "E-mail"
#: mailstream.php:335
#: mailstream.php:345
msgid "Friendica Item"
msgstr "Friendica-elem"
#: mailstream.php:404
#: mailstream.php:419
msgid "Upstream"
msgstr "Távoli"
#: mailstream.php:405
#: mailstream.php:420
msgid "URI"
msgstr "URI"
#: mailstream.php:421
msgid "Local"
msgstr "Helyi"
#: mailstream.php:481
#: mailstream.php:499
msgid "Enabled"
msgstr "Engedélyezve"
#: mailstream.php:486
#: mailstream.php:504
msgid "Email Address"
msgstr "E-mail-cím"
#: mailstream.php:488
#: mailstream.php:506
msgid "Leave blank to use your account email address"
msgstr "Hagyja üresen a fiókja e-mail-címének használatához"
#: mailstream.php:492
#: mailstream.php:510
msgid "Exclude Likes"
msgstr "Kedvelések kizárása"
#: mailstream.php:494
#: mailstream.php:512
msgid "Check this to omit mailing \"Like\" notifications"
msgstr "Jelölje be ezt a „Tetszik” értesítések elküldésének kihagyásához"
#: mailstream.php:498
#: mailstream.php:516
msgid "Attach Images"
msgstr "Képek csatolása"
#: mailstream.php:500
#: mailstream.php:518
msgid ""
"Download images in posts and attach them to the email. Useful for reading "
"email while offline."
msgstr "Képek letöltése a bejegyzésekből és csatolás az e-mailhez. Hasznos az e-mailek kapcsolat nélküli olvasásakor."
#: mailstream.php:507
#: mailstream.php:525
msgid "Mail Stream Settings"
msgstr "Levelezőfolyam beállításai"

View file

@ -15,6 +15,7 @@ $a->strings['Feed item'] = 'Hírforráselem';
$a->strings['Email'] = 'E-mail';
$a->strings['Friendica Item'] = 'Friendica-elem';
$a->strings['Upstream'] = 'Távoli';
$a->strings['URI'] = 'URI';
$a->strings['Local'] = 'Helyi';
$a->strings['Enabled'] = 'Engedélyezve';
$a->strings['Email Address'] = 'E-mail-cím';

View file

@ -66,10 +66,9 @@ function mailstream_module() {}
/**
* Adds an item in "addon features" in the admin menu of the site
*
* @param App $a App object (unused)
* @param string $o HTML form data
*/
function mailstream_addon_admin(App $a, string &$o)
function mailstream_addon_admin(string &$o)
{
$frommail = DI::config()->get('mailstream', 'frommail');
$template = Renderer::getMarkupTemplate('admin.tpl', 'addon/mailstream/');
@ -103,14 +102,14 @@ function mailstream_addon_admin_post()
*/
function mailstream_generate_id(string $uri): string
{
$host = DI::baseUrl()->getHostname();
$host = DI::baseUrl()->getHost();
$resource = hash('md5', $uri);
$message_id = "<" . $resource . "@" . $host . ">";
Logger::debug('mailstream: Generated message ID ' . $message_id . ' for URI ' . $uri);
return $message_id;
}
function mailstream_send_hook(App $a, array $data)
function mailstream_send_hook(array $data)
{
$criteria = array('uid' => $data['uid'], 'contact-id' => $data['contact-id'], 'uri' => $data['uri']);
$item = Post::selectFirst([], $criteria);
@ -119,9 +118,28 @@ function mailstream_send_hook(App $a, array $data)
return;
}
if ($item['deleted']) {
Logger::debug('mailstream_send_hook skipping deleted item', ['guid' => $item['guid']]);
return;
}
$user = User::getById($item['uid']);
if (empty($user)) {
Logger::error('mailstream_send_hook could not fund user', ['uid' => $item['uid']]);
Logger::error('mailstream_send_hook could not find user', ['uid' => $item['uid']]);
return;
}
$contact = DBA::selectFirst('contact', [], ['id' => $item['contact-id'], 'self' => false]);
if (!DBA::isResult($contact)) {
Logger::error('mailstream_send_hook could not find contact', ['guid' => $item['guid'], 'contact-id' => $item['contact-id']]);
return;
}
if ($contact['blocked']) {
Logger::error('mailstream_send_hook contact is blocked', ['guid' => $item['guid'], 'contact-id' => $item['contact-id']]);
return;
}
if (array_key_exists('ignored', $contact) && $contact['ignored']) {
Logger::error('mailstream_send_hook contact is ignored', ['guid' => $item['guid'], 'contact-id' => $item['contact-id']]);
return;
}
@ -138,17 +156,16 @@ function mailstream_send_hook(App $a, array $data)
* mailstream is enabled and the necessary data is available, forks a
* workerqueue item to send the email.
*
* @param App $a App object (unused)
* @param array $item content of the item (may or may not already be stored in the item table)
* @return void
*/
function mailstream_post_hook(App $a, array &$item)
function mailstream_post_hook(array &$item)
{
mailstream_check_version();
if (!DI::pConfig()->get($item['uid'], 'mailstream', 'enabled')) {
Logger::debug('mailstream: not enabled.', ['item' => $item['id'], ' uid ' => $item['uid']]);
return;
Logger::debug('mailstream: not enabled for item ' . $item['id'] . ' uid ' . $item['uid']);
// return;
}
if (!$item['uid']) {
Logger::debug('mailstream: no uid for item ' . $item['id']);
@ -216,7 +233,12 @@ function mailstream_do_images(array &$item, array &$attachments)
}
$cookiejar = tempnam(System::getTempPath(), 'cookiejar-mailstream-');
$curlResult = DI::httpClient()->fetchFull($url, HttpClientAccept::DEFAULT, 0, $cookiejar);
try {
$curlResult = DI::httpClient()->fetchFull($url, HttpClientAccept::DEFAULT, 0, $cookiejar);
} catch (InvalidArgumentException $e) {
Logger::error('mailstream_do_images exception fetching url', ['url' => $url, 'item_id' => $item['id']]);
continue;
}
$attachments[$url] = [
'data' => $curlResult->getBody(),
'guid' => hash('crc32', $url),
@ -255,12 +277,13 @@ function mailstream_sender(array $item): string
* Converts a bbcode-encoded subject line into a plaintext version suitable for the subject line of an email
*
* @param string $subject bbcode-encoded subject line
* @param int $uri_id
*
* @return string plaintext subject line
*/
function mailstream_decode_subject(string $subject): string
function mailstream_decode_subject(string $subject, int $uri_id): string
{
$html = BBCode::convert($subject);
$html = BBCode::convertForUriId($uri_id, $subject);
if (!$html) {
return $subject;
}
@ -295,7 +318,7 @@ function mailstream_decode_subject(string $subject): string
function mailstream_subject(array $item): string
{
if ($item['title']) {
return mailstream_decode_subject($item['title']);
return mailstream_decode_subject($item['title'], $item['uri-id']);
}
$parent = $item['thr-parent'];
// Don't look more than 100 levels deep for a subject, in case of loops
@ -308,7 +331,7 @@ function mailstream_subject(array $item): string
break;
}
if ($parent_item['title']) {
return DI::l10n()->t('Re:') . ' ' . mailstream_decode_subject($parent_item['title']);
return DI::l10n()->t('Re:') . ' ' . mailstream_decode_subject($parent_item['title'], $item['uri-id']);
}
$parent = $parent_item['thr-parent'];
}
@ -330,7 +353,7 @@ function mailstream_subject(array $item): string
return DI::l10n()->t("Diaspora post");
}
if ($contact['network'] === 'face') {
$text = mailstream_decode_subject($item['body']);
$text = mailstream_decode_subject($item['body'], $item['uri-id']);
// For some reason these do show up in Facebook
$text = preg_replace('/\xA0$/', '', $text);
$subject = (strlen($text) > 150) ? (substr($text, 0, 140) . '...') : $text;
@ -414,7 +437,7 @@ function mailstream_send(string $message_id, array $item, array $user): bool
$template = Renderer::getMarkupTemplate('mail.tpl', 'addon/mailstream/');
$mail->AltBody = BBCode::toPlaintext($item['body']);
$item['body'] = BBCode::convertForUriId($item['uri-id'], $item['body'], BBCode::CONNECTORS);
$item['url'] = DI::baseUrl()->get() . '/display/' . $item['guid'];
$item['url'] = DI::baseUrl() . '/display/' . $item['guid'];
$mail->Body = Renderer::replaceMacros($template, [
'$upstream' => DI::l10n()->t('Upstream'),
'$uri' => DI::l10n()->t('URI'),
@ -468,7 +491,7 @@ function mailstream_convert_table_entries()
'message_id' => $ms_item_id['message-id'],
'tries' => 0);
if (!$ms_item_id['message-id'] || !strlen($ms_item_id['message-id'])) {
Logger::info('mailstream_convert_table_entries: item has no message-id.', 'item' => $ms_item_id['id'], 'uri' => $ms_item_id['uri']]);
Logger::info('mailstream_convert_table_entries: item has no message-id.', ['item' => $ms_item_id['id'], 'uri' => $ms_item_id['uri']]);
continue;
}
Logger::info('mailstream_convert_table_entries: convert item to workerqueue', $send_hook_data);
@ -480,11 +503,10 @@ function mailstream_convert_table_entries()
/**
* Form for configuring mailstream features for a user
*
* @param App $a App object
* @param array $data Hook data array
* @throws \Friendica\Network\HTTPException\ServiceUnavailableException
*/
function mailstream_addon_settings(App &$a, array &$data)
function mailstream_addon_settings(array &$data)
{
$enabled = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'mailstream', 'enabled');
$address = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'mailstream', 'address');
@ -528,11 +550,10 @@ function mailstream_addon_settings(App &$a, array &$data)
/**
* Process data submitted to user's mailstream features form
* @param App $a
* @param array $post POST data
* @return void
*/
function mailstream_addon_settings_post(App $a, array $post)
function mailstream_addon_settings_post(array $post)
{
if (!DI::userSession()->getLocalUserId() || empty($post['mailstream-submit'])) {
return;

View file

@ -11,8 +11,8 @@
}
],
"require": {
"php": ">=7.0",
"monolog/monolog": "^3.2"
"php": ">=7.3",
"monolog/monolog": "^2.9"
},
"license": "3-clause BSD license",
"config": {

53
monolog/composer.lock generated
View file

@ -4,45 +4,46 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "e812bcd051a73d1c9b19c91ec88a6a21",
"content-hash": "6fd294bd163b37ac6cc400e0f8785222",
"packages": [
{
"name": "monolog/monolog",
"version": "3.2.0",
"version": "2.9.1",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/monolog.git",
"reference": "305444bc6fb6c89e490f4b34fa6e979584d7fa81"
"reference": "f259e2b15fb95494c83f52d3caad003bbf5ffaa1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/305444bc6fb6c89e490f4b34fa6e979584d7fa81",
"reference": "305444bc6fb6c89e490f4b34fa6e979584d7fa81",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/f259e2b15fb95494c83f52d3caad003bbf5ffaa1",
"reference": "f259e2b15fb95494c83f52d3caad003bbf5ffaa1",
"shasum": ""
},
"require": {
"php": ">=8.1",
"psr/log": "^2.0 || ^3.0"
"php": ">=7.2",
"psr/log": "^1.0.1 || ^2.0 || ^3.0"
},
"provide": {
"psr/log-implementation": "3.0.0"
"psr/log-implementation": "1.0.0 || 2.0.0 || 3.0.0"
},
"require-dev": {
"aws/aws-sdk-php": "^3.0",
"aws/aws-sdk-php": "^2.4.9 || ^3.0",
"doctrine/couchdb": "~1.0@dev",
"elasticsearch/elasticsearch": "^7 || ^8",
"ext-json": "*",
"graylog2/gelf-php": "^1.4.2",
"graylog2/gelf-php": "^1.4.2 || ^2@dev",
"guzzlehttp/guzzle": "^7.4",
"guzzlehttp/psr7": "^2.2",
"mongodb/mongodb": "^1.8",
"php-amqplib/php-amqplib": "~2.4 || ^3",
"phpstan/phpstan": "^1.4",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-strict-rules": "^1.1",
"phpunit/phpunit": "^9.5.16",
"predis/predis": "^1.1",
"phpspec/prophecy": "^1.15",
"phpstan/phpstan": "^0.12.91",
"phpunit/phpunit": "^8.5.14",
"predis/predis": "^1.1 || ^2.0",
"rollbar/rollbar": "^1.3 || ^2 || ^3",
"ruflin/elastica": "^7",
"swiftmailer/swiftmailer": "^5.3|^6.0",
"symfony/mailer": "^5.4 || ^6",
"symfony/mime": "^5.4 || ^6"
},
@ -65,7 +66,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "3.x-dev"
"dev-main": "2.x-dev"
}
},
"autoload": {
@ -101,34 +102,34 @@
"type": "tidelift"
}
],
"time": "2022-07-24T12:00:55+00:00"
"time": "2023-02-06T13:44:46+00:00"
},
{
"name": "psr/log",
"version": "3.0.0",
"version": "1.1.4",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
"reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001"
"reference": "d49695b909c3b7628b6289db5479a1c204601f11"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001",
"reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001",
"url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11",
"reference": "d49695b909c3b7628b6289db5479a1c204601f11",
"shasum": ""
},
"require": {
"php": ">=8.0.0"
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.x-dev"
"dev-master": "1.1.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Log\\": "src"
"Psr\\Log\\": "Psr/Log/"
}
},
"notification-url": "https://packagist.org/downloads/",
@ -148,7 +149,7 @@
"psr",
"psr-3"
],
"time": "2021-07-14T16:46:02+00:00"
"time": "2021-05-03T11:20:27+00:00"
}
],
"packages-dev": [],
@ -158,7 +159,7 @@
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": ">=7.0"
"php": ">=7.3"
},
"platform-dev": [],
"plugin-api-version": "1.1.0"

View file

@ -5,62 +5,3 @@
* Version: 1.0
* Author: Philipp Holzer
*/
use Friendica\App;
use Friendica\Core\Hook;
use Friendica\Addon\monolog\src\IntrospectionProcessor;
use Friendica\DI;
use Psr\Log\LogLevel;
require_once __DIR__ . '/vendor/autoload.php';
function monolog_install()
{
Hook::register('logger_instance' , __FILE__, 'monolog_instance');
}
function monolog_uninstall()
{
Hook::unregister('logger_instance', __FILE__, 'monolog_instance');
}
function monolog_instance(array &$data)
{
if ($data['name'] !== 'monolog') {
return;
}
$loggerTimeZone = new \DateTimeZone('UTC');
$logger = new Monolog\Logger($data['channel']);
$logger->setTimezone($loggerTimeZone);
$logger->pushProcessor(new Monolog\Processor\PsrLogMessageProcessor());
$logger->pushProcessor(new Monolog\Processor\ProcessIdProcessor());
$logger->pushProcessor(new Monolog\Processor\UidProcessor());
$logger->pushProcessor(new IntrospectionProcessor($data['introspection'], LogLevel::DEBUG));
$stream = DI::config()->get('system', 'logfile');
// just add a stream in case it's either writable or not file
if (!is_file($stream) || is_writable($stream)) {
try {
$loglevel = Monolog\Logger::toMonologLevel($data['loglevel']);
// fallback to notice if an invalid loglevel is set
if (!is_int($loglevel)) {
$loglevel = LogLevel::NOTICE;
}
$fileHandler = new Monolog\Handler\StreamHandler($stream, $loglevel);
$formatter = new Monolog\Formatter\LineFormatter("%datetime% %channel% [%level_name%]: %message% %context% %extra%\n");
$fileHandler->setFormatter($formatter);
$logger->pushHandler($fileHandler);
} catch (\Throwable $e) {
return;
}
}
$data['storage'] = $logger;
}

View file

@ -0,0 +1,54 @@
<?php
namespace Friendica\Addon\monolog\src\Factory;
use Friendica\Addon\monolog\src\Monolog\IntrospectionProcessor;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\Logger\Factory\AbstractLoggerTypeFactory;
use Monolog\Formatter\LineFormatter;
use Monolog\Handler\StreamHandler;
use Monolog\Logger;
use Monolog\Processor\ProcessIdProcessor;
use Monolog\Processor\PsrLogMessageProcessor;
use Monolog\Processor\UidProcessor;
use Psr\Log\LoggerInterface;
use Psr\Log\LogLevel;
require_once __DIR__ . '/../../vendor/autoload.php';
class Monolog extends AbstractLoggerTypeFactory
{
public function create(IManageConfigValues $config, string $loglevel = null): LoggerInterface
{
$loggerTimeZone = new \DateTimeZone('UTC');
$logger = new Logger($this->channel);
$logger->setTimezone($loggerTimeZone);
$logger->pushProcessor(new PsrLogMessageProcessor());
$logger->pushProcessor(new ProcessIdProcessor());
$logger->pushProcessor(new UidProcessor());
$logger->pushProcessor(new IntrospectionProcessor($this->introspection, LogLevel::DEBUG));
$logfile = $config->get('system', 'logfile');
// just add a stream in case it's either writable or not file
if (is_writable($logfile)) {
$loglevel = $loglevel ?? static::mapLegacyConfigDebugLevel($config->get('system', 'loglevel'));
$loglevel = Logger::toMonologLevel($loglevel);
// fallback to notice if an invalid loglevel is set
if (!is_int($loglevel)) {
$loglevel = LogLevel::NOTICE;
}
$fileHandler = new StreamHandler($logfile, $loglevel);
$formatter = new LineFormatter("%datetime% %channel% [%level_name%]: %message% %context% %extra%\n");
$fileHandler->setFormatter($formatter);
$logger->pushHandler($fileHandler);
}
return $logger;
}
}

View file

@ -19,7 +19,7 @@
*
*/
namespace Friendica\Addon\monolog\src;
namespace Friendica\Addon\monolog\src\Monolog;
use Friendica\App\Request;
use Monolog\Handler;

View file

@ -19,11 +19,10 @@
*
*/
namespace Friendica\Addon\monolog\src;
namespace Friendica\Addon\monolog\src\Monolog;
use Friendica\Core\Logger\Util\Introspection;
use Monolog\Logger;
use Monolog\LogRecord;
use Monolog\Processor\ProcessorInterface;
/**
@ -42,19 +41,19 @@ class IntrospectionProcessor implements ProcessorInterface
public function __construct(Introspection $introspection, $level = Logger::DEBUG)
{
$this->level = Logger::toMonologLevel($level);
$introspection->addClasses(['Monolog\\']);
$introspection->addClasses(['Monolog\\', static::class]);
$this->introspection = $introspection;
}
public function __invoke(LogRecord $record): LogRecord
public function __invoke(array $record): array
{
// return if the level is not high enough
if ($record->level < $this->level) {
if ($record['level'] < $this->level) {
return $record;
}
// we should have the call source now
$record->extra = array_merge(
$record->extra,
$record['extra'] = array_merge(
$record['extra'],
$this->introspection->getRecord()
);

View file

@ -0,0 +1,29 @@
<?php
/**
* @copyright Copyright (C) 2010-2023, 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/>.
*
*/
return [
\Monolog\Logger::class => [
'instanceOf' => \Friendica\Addon\monolog\src\Factory\Monolog::class,
'call' => [
['create', [], \Dice\Dice::CHAIN_CALL],
],
],
];

View file

@ -0,0 +1,26 @@
<?php
/**
* @copyright Copyright (C) 2010-2023, 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/>.
*
*/
return [
\Psr\Log\LoggerInterface::class => [
\Monolog\Logger::class => ['monolog'],
],
];

View file

@ -26,7 +26,6 @@ return array(
'Monolog\\Formatter\\MongoDBFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php',
'Monolog\\Formatter\\NormalizerFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php',
'Monolog\\Formatter\\ScalarFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php',
'Monolog\\Formatter\\SyslogFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/SyslogFormatter.php',
'Monolog\\Formatter\\WildfireFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php',
'Monolog\\Handler\\AbstractHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/AbstractHandler.php',
'Monolog\\Handler\\AbstractProcessingHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php',
@ -92,6 +91,7 @@ return array(
'Monolog\\Handler\\SocketHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SocketHandler.php',
'Monolog\\Handler\\SqsHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SqsHandler.php',
'Monolog\\Handler\\StreamHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/StreamHandler.php',
'Monolog\\Handler\\SwiftMailerHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php',
'Monolog\\Handler\\SymfonyMailerHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SymfonyMailerHandler.php',
'Monolog\\Handler\\SyslogHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SyslogHandler.php',
'Monolog\\Handler\\SyslogUdpHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php',
@ -121,12 +121,15 @@ return array(
'Monolog\\SignalHandler' => $vendorDir . '/monolog/monolog/src/Monolog/SignalHandler.php',
'Monolog\\Test\\TestCase' => $vendorDir . '/monolog/monolog/src/Monolog/Test/TestCase.php',
'Monolog\\Utils' => $vendorDir . '/monolog/monolog/src/Monolog/Utils.php',
'Psr\\Log\\AbstractLogger' => $vendorDir . '/psr/log/src/AbstractLogger.php',
'Psr\\Log\\InvalidArgumentException' => $vendorDir . '/psr/log/src/InvalidArgumentException.php',
'Psr\\Log\\LogLevel' => $vendorDir . '/psr/log/src/LogLevel.php',
'Psr\\Log\\LoggerAwareInterface' => $vendorDir . '/psr/log/src/LoggerAwareInterface.php',
'Psr\\Log\\LoggerAwareTrait' => $vendorDir . '/psr/log/src/LoggerAwareTrait.php',
'Psr\\Log\\LoggerInterface' => $vendorDir . '/psr/log/src/LoggerInterface.php',
'Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/src/LoggerTrait.php',
'Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/src/NullLogger.php',
'Psr\\Log\\AbstractLogger' => $vendorDir . '/psr/log/Psr/Log/AbstractLogger.php',
'Psr\\Log\\InvalidArgumentException' => $vendorDir . '/psr/log/Psr/Log/InvalidArgumentException.php',
'Psr\\Log\\LogLevel' => $vendorDir . '/psr/log/Psr/Log/LogLevel.php',
'Psr\\Log\\LoggerAwareInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerAwareInterface.php',
'Psr\\Log\\LoggerAwareTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerAwareTrait.php',
'Psr\\Log\\LoggerInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerInterface.php',
'Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerTrait.php',
'Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/Psr/Log/NullLogger.php',
'Psr\\Log\\Test\\DummyTest' => $vendorDir . '/psr/log/Psr/Log/Test/DummyTest.php',
'Psr\\Log\\Test\\LoggerInterfaceTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
'Psr\\Log\\Test\\TestLogger' => $vendorDir . '/psr/log/Psr/Log/Test/TestLogger.php',
);

View file

@ -6,6 +6,6 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'Psr\\Log\\' => array($vendorDir . '/psr/log/src'),
'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
'Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'),
);

View file

@ -20,7 +20,7 @@ class ComposerStaticInitMonologAddon
public static $prefixDirsPsr4 = array (
'Psr\\Log\\' =>
array (
0 => __DIR__ . '/..' . '/psr/log/src',
0 => __DIR__ . '/..' . '/psr/log/Psr/Log',
),
'Monolog\\' =>
array (
@ -49,7 +49,6 @@ class ComposerStaticInitMonologAddon
'Monolog\\Formatter\\MongoDBFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php',
'Monolog\\Formatter\\NormalizerFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php',
'Monolog\\Formatter\\ScalarFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php',
'Monolog\\Formatter\\SyslogFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/SyslogFormatter.php',
'Monolog\\Formatter\\WildfireFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php',
'Monolog\\Handler\\AbstractHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/AbstractHandler.php',
'Monolog\\Handler\\AbstractProcessingHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php',
@ -115,6 +114,7 @@ class ComposerStaticInitMonologAddon
'Monolog\\Handler\\SocketHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SocketHandler.php',
'Monolog\\Handler\\SqsHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SqsHandler.php',
'Monolog\\Handler\\StreamHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/StreamHandler.php',
'Monolog\\Handler\\SwiftMailerHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php',
'Monolog\\Handler\\SymfonyMailerHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SymfonyMailerHandler.php',
'Monolog\\Handler\\SyslogHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SyslogHandler.php',
'Monolog\\Handler\\SyslogUdpHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php',
@ -144,14 +144,17 @@ class ComposerStaticInitMonologAddon
'Monolog\\SignalHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/SignalHandler.php',
'Monolog\\Test\\TestCase' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Test/TestCase.php',
'Monolog\\Utils' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Utils.php',
'Psr\\Log\\AbstractLogger' => __DIR__ . '/..' . '/psr/log/src/AbstractLogger.php',
'Psr\\Log\\InvalidArgumentException' => __DIR__ . '/..' . '/psr/log/src/InvalidArgumentException.php',
'Psr\\Log\\LogLevel' => __DIR__ . '/..' . '/psr/log/src/LogLevel.php',
'Psr\\Log\\LoggerAwareInterface' => __DIR__ . '/..' . '/psr/log/src/LoggerAwareInterface.php',
'Psr\\Log\\LoggerAwareTrait' => __DIR__ . '/..' . '/psr/log/src/LoggerAwareTrait.php',
'Psr\\Log\\LoggerInterface' => __DIR__ . '/..' . '/psr/log/src/LoggerInterface.php',
'Psr\\Log\\LoggerTrait' => __DIR__ . '/..' . '/psr/log/src/LoggerTrait.php',
'Psr\\Log\\NullLogger' => __DIR__ . '/..' . '/psr/log/src/NullLogger.php',
'Psr\\Log\\AbstractLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/AbstractLogger.php',
'Psr\\Log\\InvalidArgumentException' => __DIR__ . '/..' . '/psr/log/Psr/Log/InvalidArgumentException.php',
'Psr\\Log\\LogLevel' => __DIR__ . '/..' . '/psr/log/Psr/Log/LogLevel.php',
'Psr\\Log\\LoggerAwareInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerAwareInterface.php',
'Psr\\Log\\LoggerAwareTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerAwareTrait.php',
'Psr\\Log\\LoggerInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerInterface.php',
'Psr\\Log\\LoggerTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerTrait.php',
'Psr\\Log\\NullLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/NullLogger.php',
'Psr\\Log\\Test\\DummyTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/DummyTest.php',
'Psr\\Log\\Test\\LoggerInterfaceTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
'Psr\\Log\\Test\\TestLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/TestLogger.php',
);
public static function getInitializer(ClassLoader $loader)

View file

@ -1,42 +1,43 @@
[
{
"name": "monolog/monolog",
"version": "3.2.0",
"version_normalized": "3.2.0.0",
"version": "2.9.1",
"version_normalized": "2.9.1.0",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/monolog.git",
"reference": "305444bc6fb6c89e490f4b34fa6e979584d7fa81"
"reference": "f259e2b15fb95494c83f52d3caad003bbf5ffaa1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/305444bc6fb6c89e490f4b34fa6e979584d7fa81",
"reference": "305444bc6fb6c89e490f4b34fa6e979584d7fa81",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/f259e2b15fb95494c83f52d3caad003bbf5ffaa1",
"reference": "f259e2b15fb95494c83f52d3caad003bbf5ffaa1",
"shasum": ""
},
"require": {
"php": ">=8.1",
"psr/log": "^2.0 || ^3.0"
"php": ">=7.2",
"psr/log": "^1.0.1 || ^2.0 || ^3.0"
},
"provide": {
"psr/log-implementation": "3.0.0"
"psr/log-implementation": "1.0.0 || 2.0.0 || 3.0.0"
},
"require-dev": {
"aws/aws-sdk-php": "^3.0",
"aws/aws-sdk-php": "^2.4.9 || ^3.0",
"doctrine/couchdb": "~1.0@dev",
"elasticsearch/elasticsearch": "^7 || ^8",
"ext-json": "*",
"graylog2/gelf-php": "^1.4.2",
"graylog2/gelf-php": "^1.4.2 || ^2@dev",
"guzzlehttp/guzzle": "^7.4",
"guzzlehttp/psr7": "^2.2",
"mongodb/mongodb": "^1.8",
"php-amqplib/php-amqplib": "~2.4 || ^3",
"phpstan/phpstan": "^1.4",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-strict-rules": "^1.1",
"phpunit/phpunit": "^9.5.16",
"predis/predis": "^1.1",
"phpspec/prophecy": "^1.15",
"phpstan/phpstan": "^0.12.91",
"phpunit/phpunit": "^8.5.14",
"predis/predis": "^1.1 || ^2.0",
"rollbar/rollbar": "^1.3 || ^2 || ^3",
"ruflin/elastica": "^7",
"swiftmailer/swiftmailer": "^5.3|^6.0",
"symfony/mailer": "^5.4 || ^6",
"symfony/mime": "^5.4 || ^6"
},
@ -56,11 +57,11 @@
"rollbar/rollbar": "Allow sending log messages to Rollbar",
"ruflin/elastica": "Allow sending log messages to an Elastic Search server"
},
"time": "2022-07-24T12:00:55+00:00",
"time": "2023-02-06T13:44:46+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "3.x-dev"
"dev-main": "2.x-dev"
}
},
"installation-source": "dist",
@ -100,33 +101,33 @@
},
{
"name": "psr/log",
"version": "3.0.0",
"version_normalized": "3.0.0.0",
"version": "1.1.4",
"version_normalized": "1.1.4.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
"reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001"
"reference": "d49695b909c3b7628b6289db5479a1c204601f11"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001",
"reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001",
"url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11",
"reference": "d49695b909c3b7628b6289db5479a1c204601f11",
"shasum": ""
},
"require": {
"php": ">=8.0.0"
"php": ">=5.3.0"
},
"time": "2021-07-14T16:46:02+00:00",
"time": "2021-05-03T11:20:27+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.x-dev"
"dev-master": "1.1.x-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"Psr\\Log\\": "src"
"Psr\\Log\\": "Psr/Log/"
}
},
"notification-url": "https://packagist.org/downloads/",

View file

@ -1,70 +1,17 @@
### 3.2.0 (2022-07-24)
### 2.9.1 (2023-02-06)
* Deprecated `CubeHandler` and `PHPConsoleHandler` as both projects are abandoned and those should not be used anymore (#1734)
* Marked `Logger` `@final` as it should not be extended, prefer composition or talk to us if you are missing something
* Added RFC 5424 level (`7` to `0`) support to `Logger::log` and `Logger::addRecord` to increase interoperability (#1723)
* Added `SyslogFormatter` to output syslog-like files which can be consumed by tools like [lnav](https://lnav.org/) (#1689)
* Added support for `__toString` for objects which are not json serializable in `JsonFormatter` (#1733)
* Added `GoogleCloudLoggingFormatter` (#1719)
* Added support for Predis 2.x (#1732)
* Added `AmqpHandler->setExtraAttributes` to allow configuring attributes when using an AMQPExchange (#1724)
* Fixed serialization/unserialization of handlers to make sure private properties are included (#1727)
* Fixed allowInlineLineBreaks in LineFormatter causing issues with windows paths containing `\n` or `\r` sequences (#1720)
* Fixed max normalization depth not being taken into account when formatting exceptions with a deep chain of previous exceptions (#1726)
* Fixed PHP 8.2 deprecation warnings (#1722)
* Fixed rare race condition or filesystem issue where StreamHandler is unable to create the directory the log should go into yet it exists already (#1678)
* Fixed Logger not being serializable anymore (#1792)
### 3.1.0 (2022-06-09)
### 2.9.0 (2023-02-05)
* Added `$datetime` parameter to `Logger::addRecord` as low level API to allow logging into the past or future (#1682)
* Added `Logger::useLoggingLoopDetection` to allow disabling cyclic logging detection in concurrent frameworks (#1681)
* Fixed handling of fatal errors if callPrevious is disabled in ErrorHandler (#1670)
* Fixed interop issue by removing the need for a return type in ProcessorInterface (#1680)
* Marked the reusable `Monolog\Test\TestCase` class as `@internal` to make sure PHPStorm does not show it above PHPUnit, you may still use it to test your own handlers/etc though (#1677)
* Fixed RotatingFileHandler issue when the date format contained slashes (#1671)
### 3.0.0 (2022-05-10)
Changes from RC1
- The `Monolog\LevelName` enum does not exist anymore, use `Monolog\Level->getName()` instead.
### 3.0.0-RC1 (2022-05-08)
This is mostly a cleanup release offering stronger type guarantees for integrators with the
array->object/enum changes, but there is no big new feature for end users.
See [UPGRADE notes](UPGRADE.md#300) for details on all breaking changes especially if you are extending/implementing Monolog classes/interfaces.
Noteworthy BC Breaks:
- The minimum supported PHP version is now `8.1.0`.
- Log records have been converted from an array to a [`Monolog\LogRecord` object](src/Monolog/LogRecord.php)
with public (and mostly readonly) properties. e.g. instead of doing
`$record['context']` use `$record->context`.
In formatters or handlers if you rather need an array to work with you can use `$record->toArray()`
to get back a Monolog 1/2 style record array. This will contain the enum values instead of enum cases
in the `level` and `level_name` keys to be more backwards compatible and use simpler data types.
- `FormatterInterface`, `HandlerInterface`, `ProcessorInterface`, etc. changed to contain `LogRecord $record`
instead of `array $record` parameter types. If you want to support multiple Monolog versions this should
be possible by type-hinting nothing, or `array|LogRecord` if you support PHP 8.0+. You can then code
against the $record using Monolog 2 style as LogRecord implements ArrayAccess for BC.
The interfaces do not require a `LogRecord` return type even where it would be applicable, but if you only
support Monolog 3 in integration code I would recommend you use `LogRecord` return types wherever fitting
to ensure forward compatibility as it may be added in Monolog 4.
- Log levels are now enums [`Monolog\Level`](src/Monolog/Level.php) and [`Monolog\LevelName`](src/Monolog/LevelName.php)
- Removed deprecated SwiftMailerHandler, migrate to SymfonyMailerHandler instead.
- `ResettableInterface::reset()` now requires a void return type.
- All properties have had types added, which may require you to do so as well if you extended
a Monolog class and declared the same property.
New deprecations:
- `Logger::DEBUG`, `Logger::ERROR`, etc. are now deprecated in favor of the `Monolog\Level` enum.
e.g. instead of `Logger::WARNING` use `Level::Warning` if you need to pass the enum case
to Monolog or one of its handlers, or `Level::Warning->value` if you need the integer
value equal to what `Logger::WARNING` was giving you.
- `Logger::getLevelName()` is now deprecated.
* Deprecated FlowdockHandler & Formatter as the flowdock service was shutdown (#1748)
* Added support for enum context values in PsrLogMessageProcessor (#1773)
* Added graylog2/gelf-php 2.x support (#1747)
* Improved `BrowserConsoleHandler` logging to use more appropriate methods than just console.log in the browser (#1739)
* Fixed `WhatFailureGroupHandler` not catching errors happening inside `close()` (#1791)
* Fixed datetime field in `GoogleCloudLoggingFormatter` (#1758)
* Fixed infinite loop detection within Fibers (#1753)
* Fixed `AmqpHandler->setExtraAttributes` not working with buffering handler wrappers (#1781)
### 2.8.0 (2022-07-24)

View file

@ -3,8 +3,6 @@
[![Total Downloads](https://img.shields.io/packagist/dt/monolog/monolog.svg)](https://packagist.org/packages/monolog/monolog)
[![Latest Stable Version](https://img.shields.io/packagist/v/monolog/monolog.svg)](https://packagist.org/packages/monolog/monolog)
> ⚠ This is the **documentation for Monolog 3.x**, if you are using older releases
> see the documentation for [Monolog 2.x](https://github.com/Seldaek/monolog/blob/2.x/README.md) or [Monolog 1.x](https://github.com/Seldaek/monolog/blob/1.x/README.md) ⚠
Monolog sends your logs to files, sockets, inboxes, databases and various
web services. See the complete list of handlers below. Special handlers
@ -30,13 +28,12 @@ $ composer require monolog/monolog
```php
<?php
use Monolog\Level;
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
// create a log channel
$log = new Logger('name');
$log->pushHandler(new StreamHandler('path/to/your.log', Level::Warning));
$log->pushHandler(new StreamHandler('path/to/your.log', Logger::WARNING));
// add records to the log
$log->warning('Foo');
@ -53,7 +50,7 @@ $log->error('Bar');
## Support Monolog Financially
Get supported Monolog and help fund the project with the [Tidelift Subscription](https://tidelift.com/subscription/pkg/packagist-monolog-monolog?utm_source=packagist-monolog-monolog&utm_medium=referral&utm_campaign=enterprise) or via [GitHub sponsorship](https://github.com/sponsors/Seldaek).
Get supported Monolog and help fund the project with the [Tidelift Subscription](https://tidelift.com/subscription/pkg/packagist-monolog-monolog?utm_source=packagist-monolog-monolog&utm_medium=referral&utm_campaign=enterprise) or via [GitHub sponsorship](https://github.com/sponsors/Seldaek).
Tidelift delivers commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use.
@ -67,13 +64,11 @@ can also add your own there if you publish one.
### Requirements
- Monolog `^3.0` works with PHP 8.1 or above.
- Monolog `^2.5` works with PHP 7.2 or above.
- Monolog `^1.25` works with PHP 5.3 up to 8.1, but is not very maintained anymore and will not receive PHP support fixes anymore.
- Monolog `^2.0` works with PHP 7.2 or above, use Monolog `^1.25` for PHP 5.3+ support.
### Support
Monolog 1.x support is somewhat limited at this point and only important fixes will be done. You should migrate to Monolog 2 or 3 where possible to benefit from all the latest features and fixes.
Monolog 1.x support is somewhat limited at this point and only important fixes will be done. You should migrate to Monolog 2 where possible to benefit from all the latest features and fixes.
### Submitting bugs and feature requests

View file

@ -13,25 +13,26 @@
}
],
"require": {
"php": ">=8.1",
"psr/log": "^2.0 || ^3.0"
"php": ">=7.2",
"psr/log": "^1.0.1 || ^2.0 || ^3.0"
},
"require-dev": {
"ext-json": "*",
"aws/aws-sdk-php": "^3.0",
"aws/aws-sdk-php": "^2.4.9 || ^3.0",
"doctrine/couchdb": "~1.0@dev",
"elasticsearch/elasticsearch": "^7 || ^8",
"graylog2/gelf-php": "^1.4.2",
"graylog2/gelf-php": "^1.4.2 || ^2@dev",
"guzzlehttp/guzzle": "^7.4",
"guzzlehttp/psr7": "^2.2",
"mongodb/mongodb": "^1.8",
"php-amqplib/php-amqplib": "~2.4 || ^3",
"phpstan/phpstan": "^1.4",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-strict-rules": "^1.1",
"phpunit/phpunit": "^9.5.16",
"predis/predis": "^1.1",
"phpspec/prophecy": "^1.15",
"phpstan/phpstan": "^0.12.91",
"phpunit/phpunit": "^8.5.14",
"predis/predis": "^1.1 || ^2.0",
"rollbar/rollbar": "^1.3 || ^2 || ^3",
"ruflin/elastica": "^7",
"swiftmailer/swiftmailer": "^5.3|^6.0",
"symfony/mailer": "^5.4 || ^6",
"symfony/mime": "^5.4 || ^6"
},
@ -58,11 +59,11 @@
"psr-4": {"Monolog\\": "tests/Monolog"}
},
"provide": {
"psr/log-implementation": "3.0.0"
"psr/log-implementation": "1.0.0 || 2.0.0 || 3.0.0"
},
"extra": {
"branch-alias": {
"dev-main": "3.x-dev"
"dev-main": "2.x-dev"
}
},
"scripts": {
@ -72,6 +73,9 @@
"config": {
"lock": false,
"sort-packages": true,
"platform-check": false
"platform-check": false,
"allow-plugins": {
"composer/package-versions-deprecated": true
}
}
}

View file

@ -13,24 +13,34 @@ namespace Monolog\Attribute;
/**
* A reusable attribute to help configure a class or a method as a processor.
*
*
* Using it offers no guarantee: it needs to be leveraged by a Monolog third-party consumer.
*
*
* Using it with the Monolog library only has no effect at all: processors should still be turned into a callable if
* needed and manually pushed to the loggers and to the processable handlers.
*/
#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
class AsMonologProcessor
{
/** @var string|null */
public $channel = null;
/** @var string|null */
public $handler = null;
/** @var string|null */
public $method = null;
/**
* @param string|null $channel The logging channel the processor should be pushed to.
* @param string|null $handler The handler the processor should be pushed to.
* @param string|null $method The method that processes the records (if the attribute is used at the class level).
* @param string|null $channel The logging channel the processor should be pushed to.
* @param string|null $handler The handler the processor should be pushed to.
* @param string|null $method The method that processes the records (if the attribute is used at the class level).
*/
public function __construct(
public readonly ?string $channel = null,
public readonly ?string $handler = null,
public readonly ?string $method = null
?string $channel = null,
?string $handler = null,
?string $method = null
) {
$this->channel = $channel;
$this->handler = $handler;
$this->method = $method;
}
}
}

View file

@ -21,7 +21,10 @@ use DateTimeZone;
*/
class DateTimeImmutable extends \DateTimeImmutable implements \JsonSerializable
{
private bool $useMicroseconds;
/**
* @var bool
*/
private $useMicroseconds;
public function __construct(bool $useMicroseconds, ?DateTimeZone $timezone = null)
{

View file

@ -11,7 +11,6 @@
namespace Monolog;
use Closure;
use Psr\Log\LoggerInterface;
use Psr\Log\LogLevel;
@ -26,33 +25,35 @@ use Psr\Log\LogLevel;
*/
class ErrorHandler
{
private Closure|null $previousExceptionHandler = null;
/** @var LoggerInterface */
private $logger;
/** @var ?callable */
private $previousExceptionHandler = null;
/** @var array<class-string, LogLevel::*> an array of class name to LogLevel::* constant mapping */
private array $uncaughtExceptionLevelMap = [];
/** @var Closure|true|null */
private Closure|bool|null $previousErrorHandler = null;
private $uncaughtExceptionLevelMap = [];
/** @var callable|true|null */
private $previousErrorHandler = null;
/** @var array<int, LogLevel::*> an array of E_* constant to LogLevel::* constant mapping */
private array $errorLevelMap = [];
private bool $handleOnlyReportedErrors = true;
private bool $hasFatalErrorHandler = false;
private string $fatalLevel = LogLevel::ALERT;
private string|null $reservedMemory = null;
private $errorLevelMap = [];
/** @var bool */
private $handleOnlyReportedErrors = true;
/** @var bool */
private $hasFatalErrorHandler = false;
/** @var LogLevel::* */
private $fatalLevel = LogLevel::ALERT;
/** @var ?string */
private $reservedMemory = null;
/** @var ?array{type: int, message: string, file: string, line: int, trace: mixed} */
private array|null $lastFatalData = null;
private $lastFatalData = null;
/** @var int[] */
private static $fatalErrors = [E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR];
private const FATAL_ERRORS = [E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR];
public function __construct(
private LoggerInterface $logger
) {
public function __construct(LoggerInterface $logger)
{
$this->logger = $logger;
}
/**
@ -60,6 +61,7 @@ class ErrorHandler
*
* By default it will handle errors, exceptions and fatal errors
*
* @param LoggerInterface $logger
* @param array<int, LogLevel::*>|false $errorLevelMap an array of E_* constant to LogLevel::* constant mapping, or false to disable error handling
* @param array<class-string, LogLevel::*>|false $exceptionLevelMap an array of class name to LogLevel::* constant mapping, or false to disable exception handling
* @param LogLevel::*|null|false $fatalLevel a LogLevel::* constant, null to use the default LogLevel::ALERT or false to disable fatal error handling
@ -97,8 +99,8 @@ class ErrorHandler
$this->uncaughtExceptionLevelMap[$class] = $level;
}
}
if ($callPrevious && null !== $prev) {
$this->previousExceptionHandler = $prev(...);
if ($callPrevious && $prev) {
$this->previousExceptionHandler = $prev;
}
return $this;
@ -110,10 +112,10 @@ class ErrorHandler
*/
public function registerErrorHandler(array $levelMap = [], bool $callPrevious = true, int $errorTypes = -1, bool $handleOnlyReportedErrors = true): self
{
$prev = set_error_handler($this->handleError(...), $errorTypes);
$prev = set_error_handler([$this, 'handleError'], $errorTypes);
$this->errorLevelMap = array_replace($this->defaultErrorLevelMap(), $levelMap);
if ($callPrevious) {
$this->previousErrorHandler = $prev !== null ? $prev(...) : true;
$this->previousErrorHandler = $prev ?: true;
} else {
$this->previousErrorHandler = null;
}
@ -129,7 +131,7 @@ class ErrorHandler
*/
public function registerFatalHandler($level = null, int $reservedMemorySize = 20): self
{
register_shutdown_function($this->handleFatalError(...));
register_shutdown_function([$this, 'handleFatalError']);
$this->reservedMemory = str_repeat(' ', 1024 * $reservedMemorySize);
$this->fatalLevel = null === $level ? LogLevel::ALERT : $level;
@ -173,7 +175,10 @@ class ErrorHandler
];
}
private function handleException(\Throwable $e): never
/**
* @phpstan-return never
*/
private function handleException(\Throwable $e): void
{
$level = LogLevel::ERROR;
foreach ($this->uncaughtExceptionLevelMap as $class => $candidate) {
@ -189,25 +194,30 @@ class ErrorHandler
['exception' => $e]
);
if (null !== $this->previousExceptionHandler) {
if ($this->previousExceptionHandler) {
($this->previousExceptionHandler)($e);
}
if (!headers_sent() && !(bool) ini_get('display_errors')) {
if (!headers_sent() && !ini_get('display_errors')) {
http_response_code(500);
}
exit(255);
}
private function handleError(int $code, string $message, string $file = '', int $line = 0): bool
/**
* @private
*
* @param mixed[] $context
*/
public function handleError(int $code, string $message, string $file = '', int $line = 0, ?array $context = []): bool
{
if ($this->handleOnlyReportedErrors && 0 === (error_reporting() & $code)) {
if ($this->handleOnlyReportedErrors && !(error_reporting() & $code)) {
return false;
}
// fatal error codes are ignored if a fatal error handler is present as well to avoid duplicate log entries
if (!$this->hasFatalErrorHandler || !in_array($code, self::FATAL_ERRORS, true)) {
if (!$this->hasFatalErrorHandler || !in_array($code, self::$fatalErrors, true)) {
$level = $this->errorLevelMap[$code] ?? LogLevel::CRITICAL;
$this->logger->log($level, self::codeToString($code).': '.$message, ['code' => $code, 'message' => $message, 'file' => $file, 'line' => $line]);
} else {
@ -218,9 +228,8 @@ class ErrorHandler
if ($this->previousErrorHandler === true) {
return false;
}
if ($this->previousErrorHandler instanceof Closure) {
return (bool) ($this->previousErrorHandler)($code, $message, $file, $line);
} elseif ($this->previousErrorHandler) {
return (bool) ($this->previousErrorHandler)($code, $message, $file, $line, $context);
}
return true;
@ -238,7 +247,8 @@ class ErrorHandler
} else {
$lastError = error_get_last();
}
if (is_array($lastError) && in_array($lastError['type'], self::FATAL_ERRORS, true)) {
if ($lastError && in_array($lastError['type'], self::$fatalErrors, true)) {
$trace = $lastError['trace'] ?? null;
$this->logger->log(
$this->fatalLevel,
@ -254,25 +264,44 @@ class ErrorHandler
}
}
private static function codeToString(int $code): string
/**
* @param int $code
*/
private static function codeToString($code): string
{
return match ($code) {
E_ERROR => 'E_ERROR',
E_WARNING => 'E_WARNING',
E_PARSE => 'E_PARSE',
E_NOTICE => 'E_NOTICE',
E_CORE_ERROR => 'E_CORE_ERROR',
E_CORE_WARNING => 'E_CORE_WARNING',
E_COMPILE_ERROR => 'E_COMPILE_ERROR',
E_COMPILE_WARNING => 'E_COMPILE_WARNING',
E_USER_ERROR => 'E_USER_ERROR',
E_USER_WARNING => 'E_USER_WARNING',
E_USER_NOTICE => 'E_USER_NOTICE',
E_STRICT => 'E_STRICT',
E_RECOVERABLE_ERROR => 'E_RECOVERABLE_ERROR',
E_DEPRECATED => 'E_DEPRECATED',
E_USER_DEPRECATED => 'E_USER_DEPRECATED',
default => 'Unknown PHP error',
};
switch ($code) {
case E_ERROR:
return 'E_ERROR';
case E_WARNING:
return 'E_WARNING';
case E_PARSE:
return 'E_PARSE';
case E_NOTICE:
return 'E_NOTICE';
case E_CORE_ERROR:
return 'E_CORE_ERROR';
case E_CORE_WARNING:
return 'E_CORE_WARNING';
case E_COMPILE_ERROR:
return 'E_COMPILE_ERROR';
case E_COMPILE_WARNING:
return 'E_COMPILE_WARNING';
case E_USER_ERROR:
return 'E_USER_ERROR';
case E_USER_WARNING:
return 'E_USER_WARNING';
case E_USER_NOTICE:
return 'E_USER_NOTICE';
case E_STRICT:
return 'E_STRICT';
case E_RECOVERABLE_ERROR:
return 'E_RECOVERABLE_ERROR';
case E_DEPRECATED:
return 'E_DEPRECATED';
case E_USER_DEPRECATED:
return 'E_USER_DEPRECATED';
}
return 'Unknown PHP error';
}
}

View file

@ -11,8 +11,7 @@
namespace Monolog\Formatter;
use Monolog\Level;
use Monolog\LogRecord;
use Monolog\Logger;
/**
* Formats a log message according to the ChromePHP array format
@ -24,55 +23,52 @@ class ChromePHPFormatter implements FormatterInterface
/**
* Translates Monolog log levels to Wildfire levels.
*
* @return 'log'|'info'|'warn'|'error'
* @var array<int, 'log'|'info'|'warn'|'error'>
*/
private function toWildfireLevel(Level $level): string
{
return match ($level) {
Level::Debug => 'log',
Level::Info => 'info',
Level::Notice => 'info',
Level::Warning => 'warn',
Level::Error => 'error',
Level::Critical => 'error',
Level::Alert => 'error',
Level::Emergency => 'error',
};
}
private $logLevels = [
Logger::DEBUG => 'log',
Logger::INFO => 'info',
Logger::NOTICE => 'info',
Logger::WARNING => 'warn',
Logger::ERROR => 'error',
Logger::CRITICAL => 'error',
Logger::ALERT => 'error',
Logger::EMERGENCY => 'error',
];
/**
* @inheritDoc
* {@inheritDoc}
*/
public function format(LogRecord $record)
public function format(array $record)
{
// Retrieve the line and file if set and remove them from the formatted extra
$backtrace = 'unknown';
if (isset($record->extra['file'], $record->extra['line'])) {
$backtrace = $record->extra['file'].' : '.$record->extra['line'];
unset($record->extra['file'], $record->extra['line']);
if (isset($record['extra']['file'], $record['extra']['line'])) {
$backtrace = $record['extra']['file'].' : '.$record['extra']['line'];
unset($record['extra']['file'], $record['extra']['line']);
}
$message = ['message' => $record->message];
if (\count($record->context) > 0) {
$message['context'] = $record->context;
$message = ['message' => $record['message']];
if ($record['context']) {
$message['context'] = $record['context'];
}
if (\count($record->extra) > 0) {
$message['extra'] = $record->extra;
if ($record['extra']) {
$message['extra'] = $record['extra'];
}
if (count($message) === 1) {
$message = reset($message);
}
return [
$record->channel,
$record['channel'],
$message,
$backtrace,
$this->toWildfireLevel($record->level),
$this->logLevels[$record['level']],
];
}
/**
* @inheritDoc
* {@inheritDoc}
*/
public function formatBatch(array $records)
{

View file

@ -12,24 +12,25 @@
namespace Monolog\Formatter;
use Elastica\Document;
use Monolog\LogRecord;
/**
* Format a log message into an Elastica Document
*
* @author Jelle Vink <jelle.vink@gmail.com>
*
* @phpstan-import-type Record from \Monolog\Logger
*/
class ElasticaFormatter extends NormalizerFormatter
{
/**
* @var string Elastic search index name
*/
protected string $index;
protected $index;
/**
* @var string|null Elastic search document type
* @var ?string Elastic search document type
*/
protected string|null $type;
protected $type;
/**
* @param string $index Elastic Search index name
@ -45,9 +46,9 @@ class ElasticaFormatter extends NormalizerFormatter
}
/**
* @inheritDoc
* {@inheritDoc}
*/
public function format(LogRecord $record)
public function format(array $record)
{
$record = parent::format($record);
@ -71,13 +72,14 @@ class ElasticaFormatter extends NormalizerFormatter
/**
* Convert a log message into an Elastica Document
*
* @param mixed[] $record
* @phpstan-param Record $record
*/
protected function getDocument(array $record): Document
{
$document = new Document();
$document->setData($record);
if (method_exists($document, 'setType')) {
/** @phpstan-ignore-next-line */
$document->setType($this->type);
}
$document->setIndex($this->index);

View file

@ -12,7 +12,6 @@
namespace Monolog\Formatter;
use DateTimeInterface;
use Monolog\LogRecord;
/**
* Format a log message into an Elasticsearch record
@ -24,12 +23,12 @@ class ElasticsearchFormatter extends NormalizerFormatter
/**
* @var string Elasticsearch index name
*/
protected string $index;
protected $index;
/**
* @var string Elasticsearch record type
*/
protected string $type;
protected $type;
/**
* @param string $index Elasticsearch index name
@ -45,9 +44,9 @@ class ElasticsearchFormatter extends NormalizerFormatter
}
/**
* @inheritDoc
* {@inheritDoc}
*/
public function format(LogRecord $record)
public function format(array $record)
{
$record = parent::format($record);
@ -56,6 +55,8 @@ class ElasticsearchFormatter extends NormalizerFormatter
/**
* Getter index
*
* @return string
*/
public function getIndex(): string
{
@ -64,6 +65,8 @@ class ElasticsearchFormatter extends NormalizerFormatter
/**
* Getter type
*
* @return string
*/
public function getType(): string
{

View file

@ -11,18 +11,23 @@
namespace Monolog\Formatter;
use Monolog\LogRecord;
/**
* formats the record to be used in the FlowdockHandler
*
* @author Dominik Liebler <liebler.dominik@gmail.com>
* @deprecated Since 2.9.0 and 3.3.0, Flowdock was shutdown we will thus drop this handler in Monolog 4
*/
class FlowdockFormatter implements FormatterInterface
{
private string $source;
/**
* @var string
*/
private $source;
private string $sourceEmail;
/**
* @var string
*/
private $sourceEmail;
public function __construct(string $source, string $sourceEmail)
{
@ -31,41 +36,43 @@ class FlowdockFormatter implements FormatterInterface
}
/**
* @inheritDoc
* {@inheritDoc}
*
* @return mixed[]
*/
public function format(LogRecord $record): array
public function format(array $record): array
{
$tags = [
'#logs',
'#' . $record->level->toPsrLogLevel(),
'#' . $record->channel,
'#' . strtolower($record['level_name']),
'#' . $record['channel'],
];
foreach ($record->extra as $value) {
foreach ($record['extra'] as $value) {
$tags[] = '#' . $value;
}
$subject = sprintf(
'in %s: %s - %s',
$this->source,
$record->level->getName(),
$this->getShortMessage($record->message)
$record['level_name'],
$this->getShortMessage($record['message'])
);
return [
$record['flowdock'] = [
'source' => $this->source,
'from_address' => $this->sourceEmail,
'subject' => $subject,
'content' => $record->message,
'content' => $record['message'],
'tags' => $tags,
'project' => $this->source,
];
return $record;
}
/**
* @inheritDoc
* {@inheritDoc}
*
* @return mixed[][]
*/

View file

@ -12,7 +12,6 @@
namespace Monolog\Formatter;
use Monolog\Utils;
use Monolog\LogRecord;
/**
* Class FluentdFormatter
@ -40,7 +39,7 @@ class FluentdFormatter implements FormatterInterface
/**
* @var bool $levelTag should message level be a part of the fluentd tag
*/
protected bool $levelTag = false;
protected $levelTag = false;
public function __construct(bool $levelTag = false)
{
@ -56,25 +55,25 @@ class FluentdFormatter implements FormatterInterface
return $this->levelTag;
}
public function format(LogRecord $record): string
public function format(array $record): string
{
$tag = $record->channel;
$tag = $record['channel'];
if ($this->levelTag) {
$tag .= '.' . $record->level->toPsrLogLevel();
$tag .= '.' . strtolower($record['level_name']);
}
$message = [
'message' => $record->message,
'context' => $record->context,
'extra' => $record->extra,
'message' => $record['message'],
'context' => $record['context'],
'extra' => $record['extra'],
];
if (!$this->levelTag) {
$message['level'] = $record->level->value;
$message['level_name'] = $record->level->getName();
$message['level'] = $record['level'];
$message['level_name'] = $record['level_name'];
}
return Utils::jsonEncode([$tag, $record->datetime->getTimestamp(), $message]);
return Utils::jsonEncode([$tag, $record['datetime']->getTimestamp(), $message]);
}
public function formatBatch(array $records): string

View file

@ -11,28 +11,32 @@
namespace Monolog\Formatter;
use Monolog\LogRecord;
/**
* Interface for formatters
*
* @author Jordi Boggiano <j.boggiano@seld.be>
*
* @phpstan-import-type Record from \Monolog\Logger
*/
interface FormatterInterface
{
/**
* Formats a log record.
*
* @param LogRecord $record A record to format
* @return mixed The formatted record
* @param array $record A record to format
* @return mixed The formatted record
*
* @phpstan-param Record $record
*/
public function format(LogRecord $record);
public function format(array $record);
/**
* Formats a set of log records.
*
* @param array<LogRecord> $records A set of records to format
* @return mixed The formatted set of records
* @param array $records A set of records to format
* @return mixed The formatted set of records
*
* @phpstan-param Record[] $records
*/
public function formatBatch(array $records);
}

View file

@ -11,16 +11,17 @@
namespace Monolog\Formatter;
use Monolog\Level;
use Monolog\Logger;
use Gelf\Message;
use Monolog\Utils;
use Monolog\LogRecord;
/**
* Serializes a log message to GELF
* @see http://docs.graylog.org/en/latest/pages/gelf.html
*
* @author Matt Lehner <mlehner@gmail.com>
*
* @phpstan-import-type Level from \Monolog\Logger
*/
class GelfMessageFormatter extends NormalizerFormatter
{
@ -29,39 +30,45 @@ class GelfMessageFormatter extends NormalizerFormatter
/**
* @var string the name of the system for the Gelf log message
*/
protected string $systemName;
protected $systemName;
/**
* @var string a prefix for 'extra' fields from the Monolog record (optional)
*/
protected string $extraPrefix;
protected $extraPrefix;
/**
* @var string a prefix for 'context' fields from the Monolog record (optional)
*/
protected string $contextPrefix;
protected $contextPrefix;
/**
* @var int max length per field
*/
protected int $maxLength;
protected $maxLength;
/**
* @var int
*/
private $gelfVersion = 2;
/**
* Translates Monolog log levels to Graylog2 log priorities.
*
* @var array<int, int>
*
* @phpstan-var array<Level, int>
*/
private function getGraylog2Priority(Level $level): int
{
return match ($level) {
Level::Debug => 7,
Level::Info => 6,
Level::Notice => 5,
Level::Warning => 4,
Level::Error => 3,
Level::Critical => 2,
Level::Alert => 1,
Level::Emergency => 0,
};
}
private $logLevels = [
Logger::DEBUG => 7,
Logger::INFO => 6,
Logger::NOTICE => 5,
Logger::WARNING => 4,
Logger::ERROR => 3,
Logger::CRITICAL => 2,
Logger::ALERT => 1,
Logger::EMERGENCY => 0,
];
public function __construct(?string $systemName = null, ?string $extraPrefix = null, string $contextPrefix = 'ctxt_', ?int $maxLength = null)
{
@ -71,52 +78,64 @@ class GelfMessageFormatter extends NormalizerFormatter
parent::__construct('U.u');
$this->systemName = (null === $systemName || $systemName === '') ? (string) gethostname() : $systemName;
$this->systemName = (is_null($systemName) || $systemName === '') ? (string) gethostname() : $systemName;
$this->extraPrefix = null === $extraPrefix ? '' : $extraPrefix;
$this->extraPrefix = is_null($extraPrefix) ? '' : $extraPrefix;
$this->contextPrefix = $contextPrefix;
$this->maxLength = null === $maxLength ? self::DEFAULT_MAX_LENGTH : $maxLength;
$this->maxLength = is_null($maxLength) ? self::DEFAULT_MAX_LENGTH : $maxLength;
if (method_exists(Message::class, 'setFacility')) {
$this->gelfVersion = 1;
}
}
/**
* @inheritDoc
* {@inheritDoc}
*/
public function format(LogRecord $record): Message
public function format(array $record): Message
{
$context = $extra = [];
if (isset($record->context)) {
if (isset($record['context'])) {
/** @var mixed[] $context */
$context = parent::normalize($record->context);
$context = parent::normalize($record['context']);
}
if (isset($record->extra)) {
if (isset($record['extra'])) {
/** @var mixed[] $extra */
$extra = parent::normalize($record->extra);
$extra = parent::normalize($record['extra']);
}
if (!isset($record['datetime'], $record['message'], $record['level'])) {
throw new \InvalidArgumentException('The record should at least contain datetime, message and level keys, '.var_export($record, true).' given');
}
$message = new Message();
$message
->setTimestamp($record->datetime)
->setShortMessage($record->message)
->setTimestamp($record['datetime'])
->setShortMessage((string) $record['message'])
->setHost($this->systemName)
->setLevel($this->getGraylog2Priority($record->level));
->setLevel($this->logLevels[$record['level']]);
// message length + system name length + 200 for padding / metadata
$len = 200 + strlen($record->message) + strlen($this->systemName);
$len = 200 + strlen((string) $record['message']) + strlen($this->systemName);
if ($len > $this->maxLength) {
$message->setShortMessage(Utils::substr($record->message, 0, $this->maxLength));
$message->setShortMessage(Utils::substr($record['message'], 0, $this->maxLength));
}
if (isset($record->channel)) {
$message->setAdditional('facility', $record->channel);
}
if (isset($extra['line'])) {
$message->setAdditional('line', $extra['line']);
unset($extra['line']);
}
if (isset($extra['file'])) {
$message->setAdditional('file', $extra['file']);
unset($extra['file']);
if ($this->gelfVersion === 1) {
if (isset($record['channel'])) {
$message->setFacility($record['channel']);
}
if (isset($extra['line'])) {
$message->setLine($extra['line']);
unset($extra['line']);
}
if (isset($extra['file'])) {
$message->setFile($extra['file']);
unset($extra['file']);
}
} else {
$message->setAdditional('facility', $record['channel']);
}
foreach ($extra as $key => $val) {
@ -141,10 +160,13 @@ class GelfMessageFormatter extends NormalizerFormatter
$message->setAdditional($this->contextPrefix . $key, $val);
}
if (!$message->hasAdditional('file') && isset($context['exception']['file'])) {
if (1 === preg_match("/^(.+):([0-9]+)$/", $context['exception']['file'], $matches)) {
$message->setAdditional('file', $matches[1]);
$message->setAdditional('line', $matches[2]);
if ($this->gelfVersion === 1) {
/** @phpstan-ignore-next-line */
if (null === $message->getFile() && isset($context['exception']['file'])) {
if (preg_match("/^(.+):([0-9]+)$/", $context['exception']['file'], $matches)) {
$message->setFile($matches[1]);
$message->setLine($matches[2]);
}
}
}

View file

@ -17,23 +17,24 @@ use Monolog\LogRecord;
/**
* Encodes message information into JSON in a format compatible with Cloud logging.
*
* @see https://cloud.google.com/logging/docs/structured-logging
* @see https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry
*
* @author Luís Cobucci <lcobucci@gmail.com>
*/
final class GoogleCloudLoggingFormatter extends JsonFormatter
{
protected function normalizeRecord(LogRecord $record): array
/** {@inheritdoc} **/
public function format(array $record): string
{
$normalized = parent::normalizeRecord($record);
// Re-key level for GCP logging
$normalized['severity'] = $normalized['level_name'];
$normalized['timestamp'] = $record->datetime->format(DateTimeInterface::RFC3339_EXTENDED);
$record['severity'] = $record['level_name'];
$record['time'] = $record['datetime']->format(DateTimeInterface::RFC3339_EXTENDED);
// Remove keys that are not used by GCP
unset($normalized['level'], $normalized['level_name'], $normalized['datetime']);
unset($record['level'], $record['level_name'], $record['datetime']);
return $normalized;
return parent::format($record);
}
}

View file

@ -11,9 +11,8 @@
namespace Monolog\Formatter;
use Monolog\Level;
use Monolog\Logger;
use Monolog\Utils;
use Monolog\LogRecord;
/**
* Formats incoming records into an HTML table
@ -26,20 +25,19 @@ class HtmlFormatter extends NormalizerFormatter
{
/**
* Translates Monolog log levels to html color priorities.
*
* @var array<int, string>
*/
protected function getLevelColor(Level $level): string
{
return match ($level) {
Level::Debug => '#CCCCCC',
Level::Info => '#28A745',
Level::Notice => '#17A2B8',
Level::Warning => '#FFC107',
Level::Error => '#FD7E14',
Level::Critical => '#DC3545',
Level::Alert => '#821722',
Level::Emergency => '#000000',
};
}
protected $logLevels = [
Logger::DEBUG => '#CCCCCC',
Logger::INFO => '#28A745',
Logger::NOTICE => '#17A2B8',
Logger::WARNING => '#FFC107',
Logger::ERROR => '#FD7E14',
Logger::CRITICAL => '#DC3545',
Logger::ALERT => '#821722',
Logger::EMERGENCY => '#000000',
];
/**
* @param string|null $dateFormat The format of the timestamp: one supported by DateTime::format
@ -69,13 +67,15 @@ class HtmlFormatter extends NormalizerFormatter
/**
* Create a HTML h1 tag
*
* @param string $title Text to be in the h1
* @param string $title Text to be in the h1
* @param int $level Error level
* @return string
*/
protected function addTitle(string $title, Level $level): string
protected function addTitle(string $title, int $level): string
{
$title = htmlspecialchars($title, ENT_NOQUOTES, 'UTF-8');
return '<h1 style="background: '.$this->getLevelColor($level).';color: #ffffff;padding: 5px;" class="monolog-output">'.$title.'</h1>';
return '<h1 style="background: '.$this->logLevels[$level].';color: #ffffff;padding: 5px;" class="monolog-output">'.$title.'</h1>';
}
/**
@ -83,25 +83,25 @@ class HtmlFormatter extends NormalizerFormatter
*
* @return string The formatted record
*/
public function format(LogRecord $record): string
public function format(array $record): string
{
$output = $this->addTitle($record->level->getName(), $record->level);
$output = $this->addTitle($record['level_name'], $record['level']);
$output .= '<table cellspacing="1" width="100%" class="monolog-output">';
$output .= $this->addRow('Message', $record->message);
$output .= $this->addRow('Time', $this->formatDate($record->datetime));
$output .= $this->addRow('Channel', $record->channel);
if (\count($record->context) > 0) {
$output .= $this->addRow('Message', (string) $record['message']);
$output .= $this->addRow('Time', $this->formatDate($record['datetime']));
$output .= $this->addRow('Channel', $record['channel']);
if ($record['context']) {
$embeddedTable = '<table cellspacing="1" width="100%">';
foreach ($record->context as $key => $value) {
foreach ($record['context'] as $key => $value) {
$embeddedTable .= $this->addRow((string) $key, $this->convertToString($value));
}
$embeddedTable .= '</table>';
$output .= $this->addRow('Context', $embeddedTable, false);
}
if (\count($record->extra) > 0) {
if ($record['extra']) {
$embeddedTable = '<table cellspacing="1" width="100%">';
foreach ($record->extra as $key => $value) {
foreach ($record['extra'] as $key => $value) {
$embeddedTable .= $this->addRow((string) $key, $this->convertToString($value));
}
$embeddedTable .= '</table>';

View file

@ -11,9 +11,7 @@
namespace Monolog\Formatter;
use Stringable;
use Throwable;
use Monolog\LogRecord;
/**
* Encodes whatever record data is passed to it as json
@ -21,6 +19,8 @@ use Monolog\LogRecord;
* This can be useful to log to databases or remote APIs
*
* @author Jordi Boggiano <j.boggiano@seld.be>
*
* @phpstan-import-type Record from \Monolog\Logger
*/
class JsonFormatter extends NormalizerFormatter
{
@ -28,13 +28,13 @@ class JsonFormatter extends NormalizerFormatter
public const BATCH_MODE_NEWLINES = 2;
/** @var self::BATCH_MODE_* */
protected int $batchMode;
protected bool $appendNewline;
protected bool $ignoreEmptyContextAndExtra;
protected bool $includeStacktraces = false;
protected $batchMode;
/** @var bool */
protected $appendNewline;
/** @var bool */
protected $ignoreEmptyContextAndExtra;
/** @var bool */
protected $includeStacktraces = false;
/**
* @param self::BATCH_MODE_* $batchMode
@ -70,11 +70,11 @@ class JsonFormatter extends NormalizerFormatter
}
/**
* @inheritDoc
* {@inheritDoc}
*/
public function format(LogRecord $record): string
public function format(array $record): string
{
$normalized = parent::format($record);
$normalized = $this->normalize($record);
if (isset($normalized['context']) && $normalized['context'] === []) {
if ($this->ignoreEmptyContextAndExtra) {
@ -95,16 +95,23 @@ class JsonFormatter extends NormalizerFormatter
}
/**
* @inheritDoc
* {@inheritDoc}
*/
public function formatBatch(array $records): string
{
return match ($this->batchMode) {
static::BATCH_MODE_NEWLINES => $this->formatBatchNewlines($records),
default => $this->formatBatchJson($records),
};
switch ($this->batchMode) {
case static::BATCH_MODE_NEWLINES:
return $this->formatBatchNewlines($records);
case static::BATCH_MODE_JSON:
default:
return $this->formatBatchJson($records);
}
}
/**
* @return self
*/
public function includeStacktraces(bool $include = true): self
{
$this->includeStacktraces = $include;
@ -115,7 +122,7 @@ class JsonFormatter extends NormalizerFormatter
/**
* Return a JSON-encoded array of records.
*
* @phpstan-param LogRecord[] $records
* @phpstan-param Record[] $records
*/
protected function formatBatchJson(array $records): string
{
@ -126,24 +133,30 @@ class JsonFormatter extends NormalizerFormatter
* Use new lines to separate records instead of a
* JSON-encoded array.
*
* @phpstan-param LogRecord[] $records
* @phpstan-param Record[] $records
*/
protected function formatBatchNewlines(array $records): string
{
$instance = $this;
$oldNewline = $this->appendNewline;
$this->appendNewline = false;
$formatted = array_map(fn (LogRecord $record) => $this->format($record), $records);
array_walk($records, function (&$value, $key) use ($instance) {
$value = $instance->format($value);
});
$this->appendNewline = $oldNewline;
return implode("\n", $formatted);
return implode("\n", $records);
}
/**
* Normalizes given $data.
*
* @return null|scalar|array<mixed[]|scalar|null|object>|object
* @param mixed $data
*
* @return mixed
*/
protected function normalize(mixed $data, int $depth = 0): mixed
protected function normalize($data, int $depth = 0)
{
if ($depth > $this->maxNormalizeDepth) {
return 'Over '.$this->maxNormalizeDepth.' levels deep, aborting normalization';
@ -179,7 +192,7 @@ class JsonFormatter extends NormalizerFormatter
return $data;
}
if ($data instanceof Stringable) {
if (method_exists($data, '__toString')) {
return $data->__toString();
}
@ -197,7 +210,7 @@ class JsonFormatter extends NormalizerFormatter
* Normalizes given exception with or without its own stack trace based on
* `includeStacktraces` property.
*
* @inheritDoc
* {@inheritDoc}
*/
protected function normalizeException(Throwable $e, int $depth = 0): array
{

View file

@ -11,9 +11,7 @@
namespace Monolog\Formatter;
use Closure;
use Monolog\Utils;
use Monolog\LogRecord;
/**
* Formats incoming records into a one-line string
@ -27,16 +25,22 @@ class LineFormatter extends NormalizerFormatter
{
public const SIMPLE_FORMAT = "[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n";
protected string $format;
protected bool $allowInlineLineBreaks;
protected bool $ignoreEmptyContextAndExtra;
protected bool $includeStacktraces;
protected Closure|null $stacktracesParser = null;
/** @var string */
protected $format;
/** @var bool */
protected $allowInlineLineBreaks;
/** @var bool */
protected $ignoreEmptyContextAndExtra;
/** @var bool */
protected $includeStacktraces;
/** @var ?callable */
protected $stacktracesParser;
/**
* @param string|null $format The format of the message
* @param string|null $dateFormat The format of the timestamp: one supported by DateTime::format
* @param bool $allowInlineLineBreaks Whether to allow inline line breaks in log entries
* @param string|null $format The format of the message
* @param string|null $dateFormat The format of the timestamp: one supported by DateTime::format
* @param bool $allowInlineLineBreaks Whether to allow inline line breaks in log entries
* @param bool $ignoreEmptyContextAndExtra
*/
public function __construct(?string $format = null, ?string $dateFormat = null, bool $allowInlineLineBreaks = false, bool $ignoreEmptyContextAndExtra = false, bool $includeStacktraces = false)
{
@ -47,7 +51,7 @@ class LineFormatter extends NormalizerFormatter
parent::__construct($dateFormat);
}
public function includeStacktraces(bool $include = true, ?Closure $parser = null): self
public function includeStacktraces(bool $include = true, ?callable $parser = null): self
{
$this->includeStacktraces = $include;
if ($this->includeStacktraces) {
@ -73,13 +77,14 @@ class LineFormatter extends NormalizerFormatter
}
/**
* @inheritDoc
* {@inheritDoc}
*/
public function format(LogRecord $record): string
public function format(array $record): string
{
$vars = parent::format($record);
$output = $this->format;
foreach ($vars['extra'] as $var => $val) {
if (false !== strpos($output, '%extra.'.$var.'%')) {
$output = str_replace('%extra.'.$var.'%', $this->stringify($val), $output);
@ -95,12 +100,12 @@ class LineFormatter extends NormalizerFormatter
}
if ($this->ignoreEmptyContextAndExtra) {
if (\count($vars['context']) === 0) {
if (empty($vars['context'])) {
unset($vars['context']);
$output = str_replace('%context%', '', $output);
}
if (\count($vars['extra']) === 0) {
if (empty($vars['extra'])) {
unset($vars['extra']);
$output = str_replace('%extra%', '', $output);
}
@ -117,7 +122,6 @@ class LineFormatter extends NormalizerFormatter
$output = preg_replace('/%(?:extra|context)\..+?%/', '', $output);
if (null === $output) {
$pcreErrorCode = preg_last_error();
throw new \RuntimeException('Failed to run preg_replace: ' . $pcreErrorCode . ' / ' . Utils::pcreLastErrorMessage($pcreErrorCode));
}
}
@ -147,7 +151,7 @@ class LineFormatter extends NormalizerFormatter
{
$str = $this->formatException($e);
if (($previous = $e->getPrevious()) instanceof \Throwable) {
if ($previous = $e->getPrevious()) {
do {
$depth++;
if ($depth > $this->maxNormalizeDepth) {
@ -228,7 +232,7 @@ class LineFormatter extends NormalizerFormatter
{
$trace = $e->getTraceAsString();
if ($this->stacktracesParser !== null) {
if ($this->stacktracesParser) {
$trace = $this->stacktracesParserCustom($trace);
}

View file

@ -11,8 +11,6 @@
namespace Monolog\Formatter;
use Monolog\LogRecord;
/**
* Encodes message information into JSON in a format compatible with Loggly.
*
@ -35,13 +33,13 @@ class LogglyFormatter extends JsonFormatter
* @see https://www.loggly.com/docs/automated-parsing/#json
* @see \Monolog\Formatter\JsonFormatter::format()
*/
protected function normalizeRecord(LogRecord $record): array
public function format(array $record): string
{
$recordData = parent::normalizeRecord($record);
if (isset($record["datetime"]) && ($record["datetime"] instanceof \DateTimeInterface)) {
$record["timestamp"] = $record["datetime"]->format("Y-m-d\TH:i:s.uO");
unset($record["datetime"]);
}
$recordData["timestamp"] = $record->datetime->format("Y-m-d\TH:i:s.uO");
unset($recordData["datetime"]);
return $recordData;
return parent::format($record);
}
}

View file

@ -11,8 +11,6 @@
namespace Monolog\Formatter;
use Monolog\LogRecord;
/**
* Encodes message information into JSON in a format compatible with Logmatic.
*
@ -22,9 +20,15 @@ class LogmaticFormatter extends JsonFormatter
{
protected const MARKERS = ["sourcecode", "php"];
protected string $hostname = '';
/**
* @var string
*/
protected $hostname = '';
protected string $appName = '';
/**
* @var string
*/
protected $appname = '';
public function setHostname(string $hostname): self
{
@ -33,9 +37,9 @@ class LogmaticFormatter extends JsonFormatter
return $this;
}
public function setAppName(string $appName): self
public function setAppname(string $appname): self
{
$this->appName = $appName;
$this->appname = $appname;
return $this;
}
@ -46,19 +50,17 @@ class LogmaticFormatter extends JsonFormatter
* @see http://doc.logmatic.io/docs/basics-to-send-data
* @see \Monolog\Formatter\JsonFormatter::format()
*/
public function normalizeRecord(LogRecord $record): array
public function format(array $record): string
{
$record = parent::normalizeRecord($record);
if ($this->hostname !== '') {
if (!empty($this->hostname)) {
$record["hostname"] = $this->hostname;
}
if ($this->appName !== '') {
$record["appname"] = $this->appName;
if (!empty($this->appname)) {
$record["appname"] = $this->appname;
}
$record["@marker"] = static::MARKERS;
return $record;
return parent::format($record);
}
}

View file

@ -11,8 +11,6 @@
namespace Monolog\Formatter;
use Monolog\LogRecord;
/**
* Serializes a log message to Logstash Event Format
*
@ -26,22 +24,22 @@ class LogstashFormatter extends NormalizerFormatter
/**
* @var string the name of the system for the Logstash log message, used to fill the @source field
*/
protected string $systemName;
protected $systemName;
/**
* @var string an application name for the Logstash log message, used to fill the @type field
*/
protected string $applicationName;
protected $applicationName;
/**
* @var string the key for 'extra' fields from the Monolog record
*/
protected string $extraKey;
protected $extraKey;
/**
* @var string the key for 'context' fields from the Monolog record
*/
protected string $contextKey;
protected $contextKey;
/**
* @param string $applicationName The application that sends the data, used as the "type" field of logstash
@ -61,38 +59,41 @@ class LogstashFormatter extends NormalizerFormatter
}
/**
* @inheritDoc
* {@inheritDoc}
*/
public function format(LogRecord $record): string
public function format(array $record): string
{
$recordData = parent::format($record);
$record = parent::format($record);
if (empty($record['datetime'])) {
$record['datetime'] = gmdate('c');
}
$message = [
'@timestamp' => $recordData['datetime'],
'@timestamp' => $record['datetime'],
'@version' => 1,
'host' => $this->systemName,
];
if (isset($recordData['message'])) {
$message['message'] = $recordData['message'];
if (isset($record['message'])) {
$message['message'] = $record['message'];
}
if (isset($recordData['channel'])) {
$message['type'] = $recordData['channel'];
$message['channel'] = $recordData['channel'];
if (isset($record['channel'])) {
$message['type'] = $record['channel'];
$message['channel'] = $record['channel'];
}
if (isset($recordData['level_name'])) {
$message['level'] = $recordData['level_name'];
if (isset($record['level_name'])) {
$message['level'] = $record['level_name'];
}
if (isset($recordData['level'])) {
$message['monolog_level'] = $recordData['level'];
if (isset($record['level'])) {
$message['monolog_level'] = $record['level'];
}
if ('' !== $this->applicationName) {
if ($this->applicationName) {
$message['type'] = $this->applicationName;
}
if (\count($recordData['extra']) > 0) {
$message[$this->extraKey] = $recordData['extra'];
if (!empty($record['extra'])) {
$message[$this->extraKey] = $record['extra'];
}
if (\count($recordData['context']) > 0) {
$message[$this->contextKey] = $recordData['context'];
if (!empty($record['context'])) {
$message[$this->contextKey] = $record['context'];
}
return $this->toJson($message) . "\n";

View file

@ -14,7 +14,6 @@ namespace Monolog\Formatter;
use MongoDB\BSON\Type;
use MongoDB\BSON\UTCDateTime;
use Monolog\Utils;
use Monolog\LogRecord;
/**
* Formats a record for use with the MongoDBHandler.
@ -23,12 +22,15 @@ use Monolog\LogRecord;
*/
class MongoDBFormatter implements FormatterInterface
{
private bool $exceptionTraceAsString;
private int $maxNestingLevel;
private bool $isLegacyMongoExt;
/** @var bool */
private $exceptionTraceAsString;
/** @var int */
private $maxNestingLevel;
/** @var bool */
private $isLegacyMongoExt;
/**
* @param int $maxNestingLevel 0 means infinite nesting, the $record itself is level 1, $record->context is 2
* @param int $maxNestingLevel 0 means infinite nesting, the $record itself is level 1, $record['context'] is 2
* @param bool $exceptionTraceAsString set to false to log exception traces as a sub documents instead of strings
*/
public function __construct(int $maxNestingLevel = 3, bool $exceptionTraceAsString = true)
@ -40,20 +42,20 @@ class MongoDBFormatter implements FormatterInterface
}
/**
* @inheritDoc
* {@inheritDoc}
*
* @return mixed[]
*/
public function format(LogRecord $record): array
public function format(array $record): array
{
/** @var mixed[] $res */
$res = $this->formatArray($record->toArray());
$res = $this->formatArray($record);
return $res;
}
/**
* @inheritDoc
* {@inheritDoc}
*
* @return array<mixed[]>
*/

View file

@ -14,7 +14,6 @@ namespace Monolog\Formatter;
use Monolog\DateTimeImmutable;
use Monolog\Utils;
use Throwable;
use Monolog\LogRecord;
/**
* Normalizes incoming records to remove objects/resources so it's easier to dump to various targets
@ -25,11 +24,15 @@ class NormalizerFormatter implements FormatterInterface
{
public const SIMPLE_DATE = "Y-m-d\TH:i:sP";
protected string $dateFormat;
protected int $maxNormalizeDepth = 9;
protected int $maxNormalizeItemCount = 1000;
/** @var string */
protected $dateFormat;
/** @var int */
protected $maxNormalizeDepth = 9;
/** @var int */
protected $maxNormalizeItemCount = 1000;
private int $jsonEncodeOptions = Utils::DEFAULT_JSON_FLAGS;
/** @var int */
private $jsonEncodeOptions = Utils::DEFAULT_JSON_FLAGS;
/**
* @param string|null $dateFormat The format of the timestamp: one supported by DateTime::format
@ -43,25 +46,17 @@ class NormalizerFormatter implements FormatterInterface
}
/**
* @inheritDoc
*/
public function format(LogRecord $record)
{
return $this->normalizeRecord($record);
}
/**
* Normalize an arbitrary value to a scalar|array|null
* {@inheritDoc}
*
* @return null|scalar|array<mixed[]|scalar|null>
* @param mixed[] $record
*/
public function normalizeValue(mixed $data): mixed
public function format(array $record)
{
return $this->normalize($data);
return $this->normalize($record);
}
/**
* @inheritDoc
* {@inheritDoc}
*/
public function formatBatch(array $records)
{
@ -129,25 +124,10 @@ class NormalizerFormatter implements FormatterInterface
}
/**
* Provided as extension point
*
* Because normalize is called with sub-values of context data etc, normalizeRecord can be
* extended when data needs to be appended on the record array but not to other normalized data.
*
* @return array<mixed[]|scalar|null>
* @param mixed $data
* @return null|scalar|array<array|scalar|null>
*/
protected function normalizeRecord(LogRecord $record): array
{
/** @var array<mixed> $normalized */
$normalized = $this->normalize($record->toArray());
return $normalized;
}
/**
* @return null|scalar|array<mixed[]|scalar|null>
*/
protected function normalize(mixed $data, int $depth = 0): mixed
protected function normalize($data, int $depth = 0)
{
if ($depth > $this->maxNormalizeDepth) {
return 'Over ' . $this->maxNormalizeDepth . ' levels deep, aborting normalization';
@ -192,14 +172,14 @@ class NormalizerFormatter implements FormatterInterface
}
if ($data instanceof \JsonSerializable) {
/** @var null|scalar|array<mixed[]|scalar|null> $value */
/** @var null|scalar|array<array|scalar|null> $value */
$value = $data->jsonSerialize();
} elseif (method_exists($data, '__toString')) {
/** @var string $value */
$value = $data->__toString();
} else {
// the rest is normalized by json encoding and decoding it
/** @var null|scalar|array<mixed[]|scalar|null> $value */
/** @var null|scalar|array<array|scalar|null> $value */
$value = json_decode($this->toJson($data, true), true);
}
@ -253,12 +233,12 @@ class NormalizerFormatter implements FormatterInterface
$trace = $e->getTrace();
foreach ($trace as $frame) {
if (isset($frame['file'], $frame['line'])) {
if (isset($frame['file'])) {
$data['trace'][] = $frame['file'].':'.$frame['line'];
}
}
if (($previous = $e->getPrevious()) instanceof \Throwable) {
if ($previous = $e->getPrevious()) {
$data['previous'] = $this->normalizeException($previous, $depth + 1);
}
@ -277,7 +257,10 @@ class NormalizerFormatter implements FormatterInterface
return Utils::jsonEncode($data, $this->jsonEncodeOptions, $ignoreErrors);
}
protected function formatDate(\DateTimeInterface $date): string
/**
* @return string
*/
protected function formatDate(\DateTimeInterface $date)
{
// in case the date format isn't custom then we defer to the custom DateTimeImmutable
// formatting logic, which will pick the right format based on whether useMicroseconds is on

View file

@ -11,10 +11,8 @@
namespace Monolog\Formatter;
use Monolog\LogRecord;
/**
* Formats data into an associative array of scalar (+ null) values.
* Formats data into an associative array of scalar values.
* Objects and arrays will be JSON encoded.
*
* @author Andrew Lawson <adlawson@gmail.com>
@ -22,21 +20,25 @@ use Monolog\LogRecord;
class ScalarFormatter extends NormalizerFormatter
{
/**
* @inheritDoc
* {@inheritDoc}
*
* @phpstan-return array<string, scalar|null> $record
*/
public function format(LogRecord $record): array
public function format(array $record): array
{
$result = [];
foreach ($record->toArray() as $key => $value) {
$result[$key] = $this->toScalar($value);
foreach ($record as $key => $value) {
$result[$key] = $this->normalizeValue($value);
}
return $result;
}
protected function toScalar(mixed $value): string|int|float|bool|null
/**
* @param mixed $value
* @return scalar|null
*/
protected function normalizeValue($value)
{
$normalized = $this->normalize($value);

View file

@ -1,66 +0,0 @@
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Formatter;
use Monolog\Level;
use Monolog\LogRecord;
/**
* Serializes a log message according to RFC 5424
*
* @author Dalibor Karlović <dalibor.karlovic@sigwin.hr>
* @author Renat Gabdullin <renatobyj@gmail.com>
*/
class SyslogFormatter extends LineFormatter
{
private const SYSLOG_FACILITY_USER = 1;
private const FORMAT = "<%extra.priority%>1 %datetime% %extra.hostname% %extra.app-name% %extra.procid% %channel% %extra.structured-data% %level_name%: %message% %context% %extra%\n";
private const NILVALUE = '-';
private string $hostname;
private int $procid;
public function __construct(private string $applicationName = self::NILVALUE)
{
parent::__construct(self::FORMAT, 'Y-m-d\TH:i:s.uP', true, true);
$this->hostname = (string) gethostname();
$this->procid = (int) getmypid();
}
public function format(LogRecord $record): string
{
$record->extra = $this->formatExtra($record);
return parent::format($record);
}
/**
* @param LogRecord $record
* @return array<string, mixed>
*/
private function formatExtra(LogRecord $record): array
{
$extra = $record->extra;
$extra['app-name'] = $this->applicationName;
$extra['hostname'] = $this->hostname;
$extra['procid'] = $this->procid;
$extra['priority'] = self::calculatePriority($record->level);
$extra['structured-data'] = self::NILVALUE;
return $extra;
}
private static function calculatePriority(Level $level): int
{
return (self::SYSLOG_FACILITY_USER * 8) + $level->toRFC5424Level();
}
}

View file

@ -11,8 +11,7 @@
namespace Monolog\Formatter;
use Monolog\Level;
use Monolog\LogRecord;
use Monolog\Logger;
/**
* Serializes a log message according to Wildfire's header requirements
@ -20,9 +19,27 @@ use Monolog\LogRecord;
* @author Eric Clemmons (@ericclemmons) <eric@uxdriven.com>
* @author Christophe Coevoet <stof@notk.org>
* @author Kirill chEbba Chebunin <iam@chebba.org>
*
* @phpstan-import-type Level from \Monolog\Logger
*/
class WildfireFormatter extends NormalizerFormatter
{
/**
* Translates Monolog log levels to Wildfire levels.
*
* @var array<Level, string>
*/
private $logLevels = [
Logger::DEBUG => 'LOG',
Logger::INFO => 'INFO',
Logger::NOTICE => 'INFO',
Logger::WARNING => 'WARN',
Logger::ERROR => 'ERROR',
Logger::CRITICAL => 'ERROR',
Logger::ALERT => 'ERROR',
Logger::EMERGENCY => 'ERROR',
];
/**
* @param string|null $dateFormat The format of the timestamp: one supported by DateTime::format
*/
@ -35,61 +52,46 @@ class WildfireFormatter extends NormalizerFormatter
}
/**
* Translates Monolog log levels to Wildfire levels.
* {@inheritDoc}
*
* @return 'LOG'|'INFO'|'WARN'|'ERROR'
* @return string
*/
private function toWildfireLevel(Level $level): string
{
return match ($level) {
Level::Debug => 'LOG',
Level::Info => 'INFO',
Level::Notice => 'INFO',
Level::Warning => 'WARN',
Level::Error => 'ERROR',
Level::Critical => 'ERROR',
Level::Alert => 'ERROR',
Level::Emergency => 'ERROR',
};
}
/**
* @inheritDoc
*/
public function format(LogRecord $record): string
public function format(array $record): string
{
// Retrieve the line and file if set and remove them from the formatted extra
$file = $line = '';
if (isset($record->extra['file'])) {
$file = $record->extra['file'];
unset($record->extra['file']);
if (isset($record['extra']['file'])) {
$file = $record['extra']['file'];
unset($record['extra']['file']);
}
if (isset($record->extra['line'])) {
$line = $record->extra['line'];
unset($record->extra['line']);
if (isset($record['extra']['line'])) {
$line = $record['extra']['line'];
unset($record['extra']['line']);
}
$message = ['message' => $record->message];
/** @var mixed[] $record */
$record = $this->normalize($record);
$message = ['message' => $record['message']];
$handleError = false;
if (count($record->context) > 0) {
$message['context'] = $this->normalize($record->context);
if ($record['context']) {
$message['context'] = $record['context'];
$handleError = true;
}
if (count($record->extra) > 0) {
$message['extra'] = $this->normalize($record->extra);
if ($record['extra']) {
$message['extra'] = $record['extra'];
$handleError = true;
}
if (count($message) === 1) {
$message = reset($message);
}
if (is_array($message) && isset($message['context']['table'])) {
if (isset($record['context']['table'])) {
$type = 'TABLE';
$label = $record->channel .': '. $record->message;
$message = $message['context']['table'];
$label = $record['channel'] .': '. $record['message'];
$message = $record['context']['table'];
} else {
$type = $this->toWildfireLevel($record->level);
$label = $record->channel;
$type = $this->logLevels[$record['level']];
$label = $record['channel'];
}
// Create JSON object describing the appearance of the message in the console
@ -112,7 +114,7 @@ class WildfireFormatter extends NormalizerFormatter
}
/**
* @inheritDoc
* {@inheritDoc}
*
* @phpstan-return never
*/
@ -122,11 +124,11 @@ class WildfireFormatter extends NormalizerFormatter
}
/**
* @inheritDoc
* {@inheritDoc}
*
* @return null|scalar|array<mixed[]|scalar|null>|object
* @return null|scalar|array<array|scalar|null>|object
*/
protected function normalize(mixed $data, int $depth = 0): mixed
protected function normalize($data, int $depth = 0)
{
if (is_object($data) && !$data instanceof \DateTimeInterface) {
return $data;

View file

@ -11,50 +11,55 @@
namespace Monolog\Handler;
use Monolog\Level;
use Monolog\Logger;
use Monolog\ResettableInterface;
use Psr\Log\LogLevel;
use Monolog\LogRecord;
/**
* Base Handler class providing basic level/bubble support
*
* @author Jordi Boggiano <j.boggiano@seld.be>
*
* @phpstan-import-type Level from \Monolog\Logger
* @phpstan-import-type LevelName from \Monolog\Logger
*/
abstract class AbstractHandler extends Handler implements ResettableInterface
{
protected Level $level = Level::Debug;
protected bool $bubble = true;
/**
* @var int
* @phpstan-var Level
*/
protected $level = Logger::DEBUG;
/** @var bool */
protected $bubble = true;
/**
* @param int|string|Level|LogLevel::* $level The minimum logging level at which this handler will be triggered
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
* @param int|string $level The minimum logging level at which this handler will be triggered
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
*
* @phpstan-param value-of<Level::VALUES>|value-of<Level::NAMES>|Level|LogLevel::* $level
* @phpstan-param Level|LevelName|LogLevel::* $level
*/
public function __construct(int|string|Level $level = Level::Debug, bool $bubble = true)
public function __construct($level = Logger::DEBUG, bool $bubble = true)
{
$this->setLevel($level);
$this->bubble = $bubble;
}
/**
* @inheritDoc
* {@inheritDoc}
*/
public function isHandling(LogRecord $record): bool
public function isHandling(array $record): bool
{
return $record->level->value >= $this->level->value;
return $record['level'] >= $this->level;
}
/**
* Sets minimum logging level at which this handler will be triggered.
*
* @param Level|LogLevel::* $level Level or level name
*
* @phpstan-param value-of<Level::VALUES>|value-of<Level::NAMES>|Level|LogLevel::* $level
* @param Level|LevelName|LogLevel::* $level Level or level name
* @return self
*/
public function setLevel(int|string|Level $level): self
public function setLevel($level): self
{
$this->level = Logger::toMonologLevel($level);
@ -63,8 +68,12 @@ abstract class AbstractHandler extends Handler implements ResettableInterface
/**
* Gets minimum logging level at which this handler will be triggered.
*
* @return int
*
* @phpstan-return Level
*/
public function getLevel(): Level
public function getLevel(): int
{
return $this->level;
}
@ -72,8 +81,9 @@ abstract class AbstractHandler extends Handler implements ResettableInterface
/**
* Sets the bubbling behavior.
*
* @param bool $bubble true means that this handler allows bubbling.
* false means that bubbling is not permitted.
* @param bool $bubble true means that this handler allows bubbling.
* false means that bubbling is not permitted.
* @return self
*/
public function setBubble(bool $bubble): self
{
@ -94,9 +104,9 @@ abstract class AbstractHandler extends Handler implements ResettableInterface
}
/**
* @inheritDoc
* {@inheritDoc}
*/
public function reset(): void
public function reset()
{
}
}

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