Commit graph

791 commits

Author SHA1 Message Date
Michael
8035bad8e2 AP: Fix a notice / avoid an error when fetched content hadn't been an array 2018-10-18 05:54:44 +00:00
Hypolite Petovan
341b83d1df Fix Undefined index: photo in ActivityPub/Receiver 2018-10-16 18:29:28 -04:00
Hypolite Petovan
cb854b8b10 Fix Undefined index: timezone in Protocol\Diaspora 2018-10-16 18:29:08 -04:00
Hypolite Petovan
2b1d15de87 Fix undefined index: id in Protocol\Diaspora 2018-10-16 18:28:27 -04:00
Michael
8d0f4710a4 Signed Diaspora posts should now be stored more reliable 2018-10-15 21:42:55 +00:00
Hypolite Petovan
ce74a4d9a1
Merge pull request #5921 from annando/ap-video
ActivityPub: Rudimentary support for videos
2018-10-14 14:05:51 -04:00
Michael
37ad4a7d22 ActivityPub: Rudimentary support for videos 2018-10-14 17:57:44 +00:00
Hypolite Petovan
59d6dd809d
Merge pull request #5906 from annando/ap-switch
OStatus contacts are now automatically converted to AP
2018-10-14 12:04:52 -04:00
Michael
6be04a73e3 The outbox is now more complete / No more duplicates in the receiver array 2018-10-14 07:47:04 +00:00
Michael
e829e074fc Location, coord and app are now processed as well 2018-10-13 21:37:39 +00:00
Michael
aab4fa0c31 The instrument is now added, updating AP contacts is now enabled 2018-10-13 20:36:44 +00:00
Michael
f60468677e We now transmit location and application as well. 2018-10-13 19:49:20 +00:00
Michael
8b9aa80aad "to" is now used for mentions, "cc" for everything else 2018-10-13 18:59:39 +00:00
Michael
efad4936b0 OStatus contacts are now automatically converted to AP 2018-10-13 18:13:01 +00:00
Michael
3c48a1f787 AP: Announce will now work 2018-10-13 16:41:29 +00:00
Michael
5af0ee1b95 We can now store it without any problem 2018-10-12 18:53:13 +00:00
Hypolite Petovan
986528b77f
Revert "We now store the diaspora comment data as well" 2018-10-12 10:35:43 -04:00
Michael
8268288953 We now store the diaspora comment data as well 2018-10-11 20:38:57 +00:00
Michael
1bf7521af8 Store conversation data directly from the AP receiver 2018-10-11 20:08:04 +00:00
Philipp Holzer
ffbc688797
Curl Response Refactoring
- refactored Network::getCurl()
- replaced every Network::getCur() execution with a Curl Response
2018-10-10 21:50:13 +02:00
Philipp Holzer
7c73e8634c
Curl Response Refactoring
- refactored Network::post()
- replaced every Network::post() execution with the new Curl container
2018-10-10 21:15:26 +02:00
Philipp Holzer
2dec8895a9
Curl Response Refactoring
- extended Curl to parse Curl Response
- refactored Network::curl()
- replaced every Network::curl() execution with the new Curl container
2018-10-10 21:08:43 +02:00
Philipp Holzer
5a02e39a65
Rename App Methods
- renamed a lot of App methods to CamelCase
- replaced direct public variables with get-/set-Methods
2018-10-10 00:16:06 +02:00
Hypolite Petovan
5f9dd11cfb
Merge pull request #5867 from annando/ap-fix-follow
AP: Switchting existing contacts to AP when receiving activities
2018-10-09 16:08:38 -04:00
Michael
0994aaf875 AP: Avoid a misleading log entry / unneeded field removed 2018-10-09 20:00:57 +00:00
Michael
c0f26ace2e AP: Switchting existing contacts to AP when receiving activities 2018-10-09 19:58:15 +00:00
Michael
b5d73f840c AP fixes: LD-signature, wrong owner for completed thres, account removal 2018-10-09 05:04:24 +00:00
Michael
4047952703 AP: Avoid an empty avatar field 2018-10-08 03:28:49 +00:00
Michael
46f77f3486 Detect the object type 2018-10-07 20:36:15 +00:00
Michael
93866b477a Several fixes 2018-10-07 19:42:04 +00:00
Michael
bd6ba98e8d Some more cleanup 2018-10-07 18:41:45 +00:00
Michael
1efca1b75d owner is now actor 2018-10-07 17:35:43 +00:00
Michael
616c4a89bd The new parsing is now active 2018-10-07 17:17:06 +00:00
Michael
36c31e4091 Switching to parsing the JSON-LD 2018-10-07 15:34:51 +00:00
Michael
3a74f3364d Switch to parsing compacted JSON data 2018-10-07 13:37:05 +00:00
Michael
192c6c8d4f Preparation for suggestions under AP 2018-10-06 18:42:26 +00:00
Michael
389a651005 Transmit the Diaspora GUID with activities (Like, Dislike, ...) 2018-10-06 14:02:23 +00:00
Hypolite Petovan
2341ce353d
Merge pull request #5842 from annando/ap-distribution
Improved AP distribution / Only process trusted content
2018-10-06 09:35:44 -04:00
Michael
a413ce15aa "name" must be plaintext 2018-10-06 13:28:17 +00:00
Michael
6b374c32a2 Improved AP distribution / Only process trusted content 2018-10-06 13:16:52 +00:00
Michael
acf31ab64b Additional check to ensure that the owner of an activity is always the author 2018-10-06 09:38:51 +00:00
Michael
510032444f The owner of a "like" should be the author 2018-10-06 08:51:52 +00:00
Michael
41123162f1 No @brief anymore 2018-10-06 04:18:40 +00:00
Hypolite Petovan
13c5bc807b
Merge pull request #5829 from annando/develop
Cache the AP delivery process
2018-10-06 00:06:47 -04:00
Michael
9dbf8d0b9d Spaces 2018-10-06 02:09:27 +00:00
Michael
51dbffd396 Cache the AP delivery process 2018-10-05 21:00:40 +00:00
Michael
5d7968bdf3 Avoid to do the follow stuff for the public user 2018-10-05 20:10:10 +00:00
Michael
5ed1c12349 Send a follow request upon contact switch to AP 2018-10-05 19:48:48 +00:00
Michael
fa7cddc669 AP Bugfix: Following a soapbox now works / rapid follow/unfollow should work now 2018-10-05 06:35:50 +00:00
Michael
3d74d412b2 Changed attachment handling to improve Mastodon compatibility 2018-10-05 04:04:37 +00:00
Michael
4368c922fb is sensitive 2018-10-04 13:08:11 +00:00
Michael
0ebfa6fc12 Added to-do 2018-10-04 12:57:42 +00:00
Michael
1c615f80c4 Improved return values 2018-10-04 12:53:41 +00:00
Michael
9171b2a0f3 It's possibly better to use context links that do exist 2018-10-04 09:46:29 +00:00
Michael
06a59c8312 Funkwhale documentation added 2018-10-04 05:29:22 +00:00
Michael
72fc89d033 Simplified attachment handling 2018-10-04 05:26:00 +00:00
Michael
f6277970fa Added some to-do 2018-10-03 19:35:01 +00:00
Michael
11a7f6c3e1 Unused "use" removed 2018-10-03 19:17:40 +00:00
Michael
cbfc3d0c28 Fix error / "about" is now converted to BBCode 2018-10-03 19:00:32 +00:00
Michael
221e197658 Tags are now transmitted as expected 2018-10-03 18:27:01 +00:00
Michael
a9a1ac808b Attachments do work now 2018-10-03 17:36:55 +00:00
Michael
78a7e130ae Another renamed function 2018-10-03 15:50:21 +00:00
Michael
8841519c0d Renamed functions 2018-10-03 15:41:51 +00:00
Michael
1fe55679fc Moved documentation 2018-10-03 09:53:12 +00:00
Michael
acd1caa114 The function is only needed in the same class 2018-10-03 09:45:54 +00:00
Michael
3ab837f3c7 Functionality is now split 2018-10-03 09:15:38 +00:00
Michael
4d2e5c2bbe AP class will be split in processor, receiver and transmitter 2018-10-03 06:15:07 +00:00
Michael
518d461a8f Issue 5811: "objects" instead of "object" 2018-10-02 20:12:38 +00:00
Michael
6020605d5c Account deletion could work now. 2018-10-01 19:22:13 +00:00
Michael
72c3a62e7f Profile update is now done via APDelivery 2018-10-01 05:44:56 +00:00
Michael
9f481c1f5e + is * 2018-09-30 20:48:29 +00:00
Michael
5456ef0185 Profile update and some more is now added 2018-09-30 20:26:30 +00:00
Michael
761bdafa34 Correct content type 2018-09-30 14:13:07 +00:00
Michael
e71f497295 Renamed 2018-09-30 08:14:05 +00:00
Michael
2fc79e3886 Superfluous, since we only fetch this data 2018-09-30 07:48:13 +00:00
Michael
82987d018a Some changes for better code quality 2018-09-30 07:21:57 +00:00
Michael
b043c7e0f2 Changed constant name to keep compatible with PHP 5 2018-09-28 15:25:20 +00:00
Michael
da79566125 Relocated function 2018-09-28 03:56:41 +00:00
Michael
793387e2b5 Only communicate with contacts that aren't pending 2018-09-27 15:26:20 +00:00
Michael
e01d5e4b31 Function naming ... 2018-09-27 11:56:05 +00:00
Michael
cb9be8a7ab UUID is now createUUID 2018-09-27 11:52:15 +00:00
Michael
5639054699 Diaspora in AP - and changed function name 2018-09-27 11:39:17 +00:00
Michael
fa868fbaf2 Some more documentation 2018-09-27 03:28:56 +00:00
Michael
897929ad40 Avoid warnings, added documentation 2018-09-26 22:45:13 +00:00
Michael
f7d7d94111 Added some doxygen headers 2018-09-26 21:38:37 +00:00
Michael
dd38b7e329 Avoid warnings 2018-09-26 20:36:47 +00:00
Michael
60b0759b50 UUID instead of GUID 2018-09-26 20:03:46 +00:00
Michael
9ec30010c5 APContact stuff is moved to an own class 2018-09-26 17:24:29 +00:00
Michael
f3814ae1fc Changed conversation url (used for AP) 2018-09-26 13:12:27 +00:00
Michael
4699741f00 Fix delivery only for comments to native networks 2018-09-26 13:00:48 +00:00
Michael
67d2f8594c Some more clean up 2018-09-26 07:42:40 +00:00
Michael
e91a1dfa8e Cleaned code 2018-09-25 21:18:37 +00:00
Michael
5e3f71680c Disabled logging 2018-09-24 21:47:10 +00:00
Michael
59c137b946 Variable fix 2018-09-24 05:35:47 +00:00
Michael
b386add315 Switch contacts from OStatus to ActivityPub 2018-09-23 22:12:12 +00:00
Michael
094c27add6 Update person, undo activity and improved security checks 2018-09-23 19:25:20 +00:00
Michael
8c7e5bb776 all endpoints are now working 2018-09-23 17:29:31 +00:00
Michael
feeec908d3 We can delete notes / changed credits 2018-09-23 09:20:25 +00:00
Michael
6df6d82427 We can now like and dislike 2018-09-23 08:52:07 +00:00
Michael
a56565fa99 AP is enabled for all users 2018-09-22 23:49:27 +00:00
Michael
ca574e1027 We can now like and dislike 2018-09-22 23:17:01 +00:00
Michael
c083ae047c Merge remote-tracking branch 'upstream/2018.08-rc' into ap1 2018-09-22 15:18:53 +00:00
Michael
214407bdc8 Improve communication 2018-09-22 14:12:54 +00:00
Michael
0dbb6313a5 Hopefully fixes relocations that hadn't been executed 2018-09-22 06:47:35 +00:00
Michael
b906b083bc The target inbox is now generated after the permission bloxk 2018-09-22 05:58:56 +00:00
Michael
71cbe56293 Use the follower collection 2018-09-22 04:49:16 +00:00
Michael
b7744ae3eb Inherit the receivers from the previous post 2018-09-22 04:39:04 +00:00
Michael
b44fc62708 Improvements to signature check, private posts do work now again 2018-09-21 22:31:33 +00:00
Michael
4c224fbddd Deliver everything to all receivers in the thread 2018-09-21 12:06:36 +00:00
Michael
5310d54c13 Fetch the receiver from the parent posting as well 2018-09-21 04:51:54 +00:00
Michael
355346298b LD signatures will now be checked when receiving messages 2018-09-21 03:39:32 +00:00
Michael
752b5fe284 Outgoing posts are now signed 2018-09-20 21:45:23 +00:00
Michael
11310f4cf0 Relocated AP signature functions, reduced magic auth functions 2018-09-20 18:16:14 +00:00
Michael
0866fbaf8c Code cleaning / wrong table for flags 2018-09-20 09:50:03 +00:00
Michael
0d51474e73 Relocated function 2018-09-20 05:37:01 +00:00
Michael
34cb0aa406 JSON-LD stuff is now in a separate file 2018-09-20 05:30:07 +00:00
Michael
f20bed67a9 Table "apcontact" is now in use / added functionality to handle JSON-LD 2018-09-20 05:00:49 +00:00
Michael
5de4afecf1 Table for AP contacts, JSON-LD parser included 2018-09-18 22:09:27 +00:00
Michael
cb073bea61 Private posts with Mastodon don't work - but this is expected 2018-09-18 19:36:27 +00:00
Michael
464650d4d7 Public posts to Pleroma do work now, limited posts to Hubzilla and Mastodon as well 2018-09-18 07:28:35 +00:00
Michael
f772ece86f New delivery module for ap 2018-09-17 21:13:08 +00:00
Michael
91d1b4de5d We now use the conversation data with AP 2018-09-17 05:51:05 +00:00
Michael
699a4140f9 Now sending does finally work - and some AP standards are improved as well 2018-09-16 20:12:48 +00:00
Michael
e4d28629e4 First posting tests 2018-09-16 17:47:00 +00:00
Michael
629cca1963 Added function to fetch missing data, code bugfixing 2018-09-16 13:04:00 +00:00
Michael
6f3b2b6586 Handling of unlisted posts, better uid detection 2018-09-16 09:06:09 +00:00
Michael
1f98414bdd Some code cleanup 2018-09-16 05:49:13 +00:00
Michael
a7f5c1f4c6 Likes work now 2018-09-15 23:06:03 +00:00
Michael
2eabe45a8e Contact reject does work now as well 2018-09-15 22:25:58 +00:00
Michael
e45206ae5d Merge remote-tracking branch 'upstream/2018.08-rc' into ap1 2018-09-15 20:49:46 +00:00
Michael
f5104f3e46 Removed harcoded host names 2018-09-15 20:48:24 +00:00
Michael
86bd283705 The whole contact handling does work now, yeah ... 2018-09-15 20:31:05 +00:00
Michael
6a8ebc8639 Contact follow and unfollow workd partially 2018-09-15 18:54:45 +00:00
Michael
96f575fe28 Processing of personal inbox enabled 2018-09-15 10:14:56 +00:00
Michael
957c70d1c6 Several improvements 2018-09-15 07:40:19 +00:00
Michael
fb5b6e4a14 New uri format for our posts that is AP compatible 2018-09-15 07:37:34 +00:00
Michael
2e7ca76e15 More fields to import / like could possibly work 2018-09-14 21:10:49 +00:00
Michael
61e2c7d20d Added AP to many network conditions / enabling inbox processing 2018-09-14 16:51:32 +00:00
Michael
c2f6b166c7 We now use the regular probing function 2018-09-13 21:57:41 +00:00
Michael
8c00e88f79 The endless saga of the fight against notices continues 2018-09-13 21:11:52 +00:00
Michael
67fa0ed433 Signature check added 2018-09-12 21:30:10 +00:00
Michael
969311cb44 Replacing the non standard "title" with "name" 2018-09-12 18:48:18 +00:00
Michael
8c07baf54b Better http answers 2018-09-12 06:01:28 +00:00
Michael
f566db52d3 And more notices ... 2018-09-11 08:04:14 +00:00
Michael
0a5476591d Activitity pub - first commit with much test code 2018-09-10 21:07:25 +00:00
Michael
6113fdc940 Issue 5733: Changing relationship values does work now again with DFRN 2018-09-06 09:20:45 +00:00
Michael
9ef1d827f3 Restore the behaviour to remove the remote contact upon termination 2018-09-05 05:02:06 +00:00
Michael
380eeaab88 Still there had been notices - must have a good camouflage 2018-08-31 05:08:22 +00:00
Tobias Diekershoff
070e1e73d6
Merge pull request #5702 from annando/and-a-notice
and now for something completely different: A removed notice
2018-08-30 06:37:39 +02:00
Michael
02da827560 and now for something completely different: A removed notice 2018-08-30 04:05:32 +00:00
Michael
9bff31f18f Issue 5691: Post dates of feeds sometimes had been wrong 2018-08-29 19:11:43 +00:00
Michael Vogel
601851f3d0 Removed notice - pokes do now work mostly (#5693) 2018-08-29 09:00:01 -04:00
Michael
5e82323456 Avoid useless contact updates 2018-08-26 07:56:33 +00:00
Roland Häder
61693419e8 Cleanups: isResult() more used, readability improved (#5608)
* [diaspora]: Maybe SimpleXMLElement is the right type-hint?

* Changes proposed + pre-renaming:
- pre-renamed $db -> $connection
- added TODOs for not allowing bad method invocations (there is a
  BadMethodCallException in SPL)

* If no record is found, below $r[0] will fail with a E_NOTICE and the code
doesn't behave as expected.

* Ops, one more left ...

* Continued:
- added documentation for Contact::updateSslPolicy() method
- added type-hint for $contact of same method
- empty lines added + TODO where the bug origins that $item has no element 'body'

* Added empty lines for better readability

* Cleaned up:
- no more x() (deprecated) usage but empty() instead
- fixed mixing of space/tab indending
- merged else/if block goether in elseif() (lesser nested code blocks)

* Re-fixed DBM -> DBA switch

* Fixes/rewrites:
- use empty()/isset() instead of deprecated x()
- merged 2 nested if() blocks into one
- avoided nested if() block inside else block by rewriting it to elseif()
- $contact_id is an integer, let's test on > 0 here
- added a lot spaces and some empty lines for better readability

* Rewrite:
- moved all CONTACT_* constants from boot.php to Contact class

* CR request:
- renamed Contact::CONTACT_IS_* -> Contact::* ;-)

* Rewrites:
- moved PAGE_* to Friendica\Model\Profile class
- fixed mixure with "Contact::* rewrite"

* Ops, one still there (return is no function)

* Rewrite to Proxy class:
- introduced new Friendica\Network\Proxy class for in exchange of proxy_*()
  functions
- moved also all PROXY_* constants there as Proxy::*
- removed now no longer needed mod/proxy.php loading as composer's auto-load
  will do this for us
- renamed those proxy_*() functions to better names:
  + proxy_init()           -> Proxy::init()         (public)
  + proxy_url()            -> Proxy::proxifyUrl()   (public)
  + proxy_parse_html()     -> Proxy::proxifyHtml()  (public)
  + proxy_is_local_image() -> Proxy::isLocalImage() (private)
  + proxy_parse_query()    -> Proxy::parseQuery()   (private)
  + proxy_img_cb()         -> Proxy::replaceUrl()   (private)

* CR request:
- moved all PAGE_* constants to Friendica\Model\Contact class
- fixed all references of both classes

* Ops, need to set $a here ...

* CR request:
- moved Proxy class to Friendica\Module
- extended BaseModule

* Ops, no need for own instance of $a when self::getApp() is around.

* Proxy-rewrite:
- proxy_url() and proxy_parse_html() are both non-module functions (now
  methods)
- so they must be splitted into a seperate class
- also the SIZE_* and DEFAULT_TIME constants are both not relevant to module

* No instances from utility classes

* Fixed error:
- proxify*() is now located in `Friendica\Util\ProxyUtils`

* Moved back to original place, ops? How did they move here? Well, it was not
intended by me.

* Removed duplicate (left-over from split) constants and static array. Thank to
MrPetovan finding it.

* Renamed ProxyUtils -> Proxy and aliased it back to ProxyUtils.

* Rewrite:
- stopped using deprecated NETWORK_* constants, now Protocol::* should be used
- still left them intact for slow/lazy developers ...

* Ops, was added accidentally ...

* Ops, why these wrong moves?

* Ops, one to much (thanks to MrPetovan)

* Ops, wrong moving ...

* moved back to original place ...

* spaces added

* empty lines add for better readability.

* convertered spaces -> tab for code indenting.

* CR request: Add space between if and brace.

* CR requests fixed + move reverted
- ops, src/Module/*.php has been moved to src/Network/ accidentally
- reverted some parts in src/Database/DBA.php as pointed out by Annando
- removed internal TODO items
- added some spaces for better readability
2018-08-24 01:05:49 -04:00
Michael Vogel
dc3d2d5988 "dba" is now "DBA". This hadn't been respected at some places (#5655)
* "dba" is now "DBA". This hadn't been respected at some places

* Cleaning up unneeded stuff
2018-08-23 09:51:58 -04:00
Michael Vogel
54aee2aaa7 Removed notices that revealed themselfes over night ... (#5645)
* Removed notices that revealed themselfes over night ...

* And more notices removed that occured over night

* One more ..

* Some more notices of the day ...
2018-08-21 17:35:09 +02:00
Michael
334c628511 And again ... notices 2018-08-20 21:20:21 +00:00
Michael Vogel
c1da44b7dc We now use a central function to fetch the importer (#5636) 2018-08-19 13:37:56 +00:00
Michael Vogel
7f3fb34c24 Some easy to replace "q" calls have been replaced by "DBA" calls (#5632)
* Some easy to replace "q" calls have been replaced by "DBA" calls

* Simplified the GUID creation

* And one in the API ...

* And OStatus has got some DBA calls more

* Just some more replaced database calls

* The event query is now simplified

* Events are now shown again

* subthread is now using the DBA calls as well

* Some more replaced database calls

* And some more replaced database calls and prevented notices

* Better use gravity

* Some more replaced database stuff

* Some more replaced database calls in DFRN.php

* The gcontact class now has got the new DBA functions as well

* The Contact class is now changed to new database functions as well

* Small correction

* We can now delete without cascade

* One more functionality is safe for future changes
2018-08-19 12:46:10 +00:00
Michael
0342f9e084 Removed notices, will it ever end? 2018-08-17 03:19:42 +00:00
Michael Vogel
1283b99c6f Removed notices in the frio theme (#5610)
* Removed notices in the frio theme

* And fixed notices in the notifications

* And some more in frio

* Null is the default value

* And some small notice in the probing removed

* Added note

* Clarified note

* And a removed notice in OStatus
2018-08-14 19:37:44 +00:00
Michael
b3931d066c Issue-5605: Fixes notice 2018-08-12 08:00:37 +00:00
Roland Häder
e06fc2aa69 Stopped using deprecated constants NETWORK_* (#5537)
* Rewrite:
- stopped using deprecated NETWORK_* constants, now Protocol::* should be used
- still left them intact for slow/lazy developers ...

* Removed deprecated NETWORK_* constants as per code reviewer's request.
2018-08-11 22:40:44 +02:00
Michael
3f612e0641 Issue 5436: Don't store tags that are too long 2018-08-06 17:11:40 +00:00
Hypolite Petovan
c13dc549ed Rename PROTOCOL_* constants to Model\Conversation::PARCEL_*
- Remove unused Conversation::PROTOCOL_GS_CONVERSATION constant
- Remove now renamed PROTOCOL_* constant declarations
2018-08-05 12:24:42 +02:00
Hypolite Petovan
c9b756674a Add CW support to shared posts in Protocol\OStatus 2018-08-04 21:40:45 +02:00
Hypolite Petovan
36975d521f Remove plural from $activityobjects variable name in Protocol\OStatus 2018-08-04 21:39:54 +02:00
Michael Vogel
2c8c803d64 Avid notices and warnings (#5546) 2018-08-02 19:07:20 +02:00
Michael Vogel
c72c64a6d8 Notices again (#5543)
* And again notices

* Notices in the directory

* Much more places

* Fix some double $

* Notice in ping

* Missing field

* Fix: We now remove deleted users from the directory

* Some more stuff

* Notices when removing users

* Added logging

* More logging

* Two more
2018-08-02 07:21:01 +02:00
Michael Vogel
1afc0ab028 Added logging and one more reason for a notice found (#5538)
* Added logging and one more reason for a notice found

* And one more
2018-08-01 08:47:18 +02:00
Michael Vogel
9d0f18c0b3 Yeah, and again notices ... (#5536)
* Yeah, and again notices ...

* And some more

* Block access without given user name

* Reformatting
2018-08-01 07:29:58 +02:00
Michael Vogel
71b1638d9a Once again, notices ... (#5535) 2018-07-31 18:39:23 +02:00
Michael Vogel
b552b711ee And some more notices removed ... (#5533)
* Fix for vanishing notes

* The field needs to be part of the selected fields ...

* And some more notes ...
2018-07-31 07:54:25 +02:00
Roland Häder
4d39164c1e [WIP] Rewrite to Proxy class: (#5507)
* Rewrite to Proxy class:
- introduced new Friendica\Network\Proxy class for in exchange of proxy_*()
  functions
- moved also all PROXY_* constants there as Proxy::*
- removed now no longer needed mod/proxy.php loading as composer's auto-load
  will do this for us
- renamed those proxy_*() functions to better names:
  + proxy_init()           -> Proxy::init()         (public)
  + proxy_url()            -> Proxy::proxifyUrl()   (public)
  + proxy_parse_html()     -> Proxy::proxifyHtml()  (public)
  + proxy_is_local_image() -> Proxy::isLocalImage() (private)
  + proxy_parse_query()    -> Proxy::parseQuery()   (private)
  + proxy_img_cb()         -> Proxy::replaceUrl()   (private)

* Ops, need to set $a here ...

* CR request:
- moved Proxy class to Friendica\Module
- extended BaseModule

* Ops, no need for own instance of $a when self::getApp() is around.

* Proxy-rewrite:
- proxy_url() and proxy_parse_html() are both non-module functions (now
  methods)
- so they must be splitted into a seperate class
- also the SIZE_* and DEFAULT_TIME constants are both not relevant to module

* No instances from utility classes

* Fixed error:
- proxify*() is now located in `Friendica\Util\ProxyUtils`

* Moved back to original place, ops? How did they move here? Well, it was not
intended by me.

* Removed duplicate (left-over from split) constants and static array. Thank to
MrPetovan finding it.

* Renamed ProxyUtils -> Proxy and aliased it back to ProxyUtils.
2018-07-30 22:06:22 -04:00
Michael Vogel
1eb8f04274 Fixing SQL error when receiving DFRN posts (#5527)
* Some more notices

* Fixed nasty to find notice in DFRN and OStatus

* And more notices ...

* Yeah, some removed notices ... again ...

* Fixing bad SQL query
2018-07-30 07:06:32 +02:00
Michael Vogel
a2cea16954 Some more notices (#5526)
* Some more notices

* Fixed nasty to find notice in DFRN and OStatus

* And more notices ...

* Yeah, some removed notices ... again ...
2018-07-30 06:41:20 +02:00
Roland Häder
650c3c18e1
Fixed fatal error about when returned 'body' field is empty:
````
PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Friendica\Protocol\PortableContact::discoverServer() must be of the type array, null given, called in /var/www/../src/Protocol/PortableContact.php on line 1664 and defined in /var/www/../src/Protocol/PortableContact.php:1765
Stack trace:
````
2018-07-29 17:34:20 +02:00
Hypolite Petovan
0902ea508d
Fix parse error in Protocol\PortableContact (#5515) 2018-07-28 08:52:57 -04:00
Roland Häder
c30ac30f29 Possible fix for #5470 - json_decode() (#5511)
* Possible fix for #5470:
- $data is not an object like stdClass but an array
- newer PHP versions doesn't allow cross-access like following:

  $object['foo'] = 123;
  $array->foo = 123;

- added type-hints for private methods for above cases
- used `if (empty($foo)) instead of just `if ($foo)` preventing some nasty
  E_NOTICE
- added some empty lines for better readability

* Rewrite:
- mixture of object/array was here, causing under newer PHP versions some E_NOTICE
- this has been now finally fixed by converting any `object` type to an
  associative `array`
- also changed `is_object()` to `is_array()`
2018-07-28 01:35:27 -04:00
Roland Häder
4a22710b3b Moved global PAGE_* to Profile class (#5500)
* Rewrites:
- moved PAGE_* to Friendica\Model\Profile class

* Fixed more rewrites from plain (global namespace) PAGE_* to Friendica\Models\Profile class

* CR request:
- moved all PAGE_* constants to Friendica\Model\Contact class
- fixed all references of both classes

* CR request:
- moved ACCOUNT_TYPE_* constants from boot.php to Contact::ACCOUNT_TYPE_*

* Just copy-pasted this code from boot.php, needs to be changed to `const ACCOUNT_TYPE_FOO = x;`

* Ops, melting brain cells here ... :-/
2018-07-27 19:25:57 -04:00
Michael Vogel
82e3163e5e Revert "Possible fix for #5470: (#5506)"
This reverts commit 1e20fd84f7.
2018-07-27 08:02:41 +02:00
Roland Häder
1e20fd84f7 Possible fix for #5470: (#5506)
- $data is not an object like stdClass but an array
- newer PHP versions doesn't allow cross-access like following:

  $object['foo'] = 123;
  $array->foo = 123;

- added type-hints for private methods for above cases
- used `if (empty($foo)) instead of just `if ($foo)` preventing some nasty
  E_NOTICE
- added some empty lines for better readability
2018-07-26 18:27:12 -04:00
Michael Vogel
986106a8f7 Item storage: Permissions aren't stored in the items anymore (#5495)
* The permission set is now used for item permissions

* Check for allow_cid, ... is superfluous. Checking for "private" is enough

* We query the permissionset

* Permissions are displayed correctly

* Changed index

* We don't store the permissions in the item table anymore

* Permission fields are now deprecated

* Reversed ...
2018-07-25 19:14:55 -04:00
Roland Häder
37253656e3 Moved CONTACT_* constants to Friendica\Model\Contact class, lesser in global namespace (#5490)
* Rewrite:
- moved all CONTACT_* constants from boot.php to Contact class

* CR request:
- renamed Contact::CONTACT_IS_* -> Contact::* ;-)
2018-07-24 22:53:46 -04:00
Michael Vogel
5a8654194a
Merge pull request #5452 from MrPetovan/bug/5443-fix-worker-notices
Fix notices in OEmbed et al.
2018-07-24 17:11:53 +02:00
Michael Vogel
be8b68aaaf Store guid and plink with event (#5485)
* Store guid and plink with event

* One space too much
2018-07-24 10:01:31 -04:00
Hypolite Petovan
adc47fc8ea Fix Undefined index: nurl in Protocol\PortableContact 2018-07-24 07:55:42 -04:00
Hypolite Petovan
41fd5bef13 Fix by reference notice in Protocol\PortableContact 2018-07-24 07:54:12 -04:00
Hypolite Petovan
a6fb3568f9 Rename dbesc to DBA::escape 2018-07-23 15:30:54 -04:00
Hypolite Petovan
ecea7425f8 Rename DBA::is_result to DBA::isResult 2018-07-23 11:04:14 -04:00
Hypolite Petovan
0ec44f3e8a Rename DBM method calls to DBA method calls 2018-07-23 11:02:24 -04:00
Hypolite Petovan
8ddb94ef06 Use DateTimeFormat::utc() instead of DBM::date() 2018-07-23 10:57:47 -04:00
Hypolite Petovan
b685ef37c9
Fix Fatal errors in Protocol\OStatus (#5466) 2018-07-23 07:48:44 -04:00
Michael Vogel
53876abfda And some more removed notices in the core (#5465) 2018-07-23 07:43:18 -04:00
Hypolite Petovan
bb99ac8111
Fix Fatal error in Protocol\Diaspora (#5460) 2018-07-22 19:22:41 -04:00
Roland Häder
c17adaf333 Uncommon logger levels in Friendica (#5453)
* "normal" is an uncommon logger level:
- changed LOGGER_NORMAL -> LOGGER_INFO
- added LOGGER_WARNING (a common logger level)

* Used constants instead of values (MrPetovan)
2018-07-22 14:07:44 -04:00
Hypolite Petovan
a202962f03
Fix yet another Fatal Error in Protocol\OStatus (#5454) 2018-07-22 13:32:34 -04:00
Hypolite Petovan
d6ccba79e0
Fix another Fatal error in Protocol\OStatus (#5451)
* Fix Fatal error in Protocol\OStatus

* Fix another Fatal error in Protocol\OStatus
2018-07-22 12:57:33 -04:00
Hypolite Petovan
3500e50be9
Fix Fatal error in Protocol\OStatus (#5450) 2018-07-22 12:52:38 -04:00
Roland Häder
0a519f5001 Fixes/tye-hints (#5449)
- added type-hints for DOMDocument, DOMXPath and array
- added missing documentation about optional parameter
- `if ($foo['bar'])` is not a good choice, better use
  `if (!empty($foo['bar']))` instead
2018-07-22 12:35:20 -04:00
Roland Häder
2e332134d4 There is no LOGGER_WARNING (triggering E_NOTICE about absent constant). Either (#5448)
declare it and push all other numbers higher or use LOGGER_NORMAL.
2018-07-22 12:33:28 -04:00
Michael Vogel
7382be2766 Some more notices (#5424) 2018-07-20 14:07:54 -04:00
Hypolite Petovan
af6dbc654f Rename Friendica\Database\dba to Friendica\Database\DBA 2018-07-20 08:19:26 -04:00
Michael
9a6a3bf1c1 Makes Diaspora working again 2018-07-20 05:10:16 +00:00
Hypolite Petovan
daa1177e3a Update use statement lists with new Friendica\Database\dba class
- Remove unused use statement
- Remove superfluous use statements (classes in the same namespace)
- Add missing use statements
2018-07-19 22:15:21 -04:00
Roland Häder
b2899d76cf Small cleanup (#5416)
- added internal TODO to decide about is_result() usage
- removed semicolon (not needed here) from SQL query
- added empty line

Signed-off-by: Roland Häder <roland@mxchange.org>
2018-07-19 18:39:05 -04:00
Michael Vogel
5af9596dde New item field "Post-type" and new table "permissionset" (#5408)
* "post-type" replaces "bookmark" and "type"

* Removed some more type

* Added index to permission set

* The permission set is now stored

* The permission set is now removed upon expiry

* Post update now stores the permission set

* New file

* Permissions are now sorted

* Changed documentation
2018-07-19 09:52:05 -04:00
Roland Häder
b05b96d04a Fixes: (#5404)
- fixed E_NOTICE in mod/follow.php
- fixed 2 E_NOTICE in src/Protocol/Diaspora.php
- added more type-hints for `array` type where known

Signed-off-by: Roland Häder <roland@mxchange.org>
2018-07-19 07:07:14 -04:00
Hypolite Petovan
762a786611 Replace direct accesses to App->config by Config::get/set calls 2018-07-16 19:38:16 -04:00
Michael
95fe08e5b9 Ensure that "follow" requests can be processed 2018-07-16 06:34:12 +00:00
Michael
78c9e29aa8 Don't accept posts from unknown owners 2018-07-16 05:48:51 +00:00
Michael Vogel
d3a2ed85fe Next item structure works (#5380)
* Use "LEFT JOIN" to always fetch the item. Needed for update routines.

* New conversion routine that now covers every item

* Post update is now activated

* We now use a hash based upon RIPEMD-320 for content and activity

* The hash doesn't contain the plink anymore

* Legacy item fields are now "null"able

* New hash function for a server unique item hash

* Introduction of the legacy mode (usage of old item fields)

* Code simplification

* We don't need the "uri" fields anymore in item-activity and item-content

* Use the "created" and not the "received" date for the hash

* Avoiding several notices

* Some more warnings removed

* Improved uri-hash / Likes on Diaspora are now getting a creation date

* Corrected the post update version

* Ensure an unique uri-hash

* Don't delete orhaned item data at the moment

* Partly reworked, due to strange behaviour

* Some more parts reworked

* Using the uri currently seems to be more reliable

* Using the uri here as well

* Use the hash values again

* Grouped item fields in different categories

* Notices again

* use the gravity (we always should)

* Added hint for disabled post updates

* Notices ...

* Issue #5337: Personal notes are displayed again

* Use the gravity again
2018-07-15 14:36:20 -04:00
Michael Vogel
0360f7197a Several more warnings ... (#5340)
* Some more warnings removed

* Even more warnings ...

* Will it ever end? ;-)

* Avoid warning in dbstructure

* Origin and OStatus ...

* There are more warnings solved ... yeah!

* And again ...

* We are not done yet

* And more ...

* And some new places ...

* And more in the feeds

* Avoid some more

* And some backend stuff

* Notifications cleared

* Some more stuff

* and again ...

* It's getting fewer ...

* Some warnings had been hidden in the notifications

* Fix the fix

* And another missing one ...

* We need the owner here, not the user

* Forgotten user

* And more ...

* And some more warnings disappeared ...

* Some more frontend warnings

* Some backend warnings removed

* Fixed sidebar for "vier"

* And more ...

* Some more ...

* And something for "remote self"

* Am I stuck in an endless loop?

* Fix: Clear tag and file field on update

* Preset page content
2018-07-10 08:27:56 -04:00
Philipp Holzer
c829e43725
moved get_guid to System::createGUID 2018-07-09 21:38:16 +02:00
Michael
6d90751110 Added missing "use 2018-07-08 13:39:48 +00:00
Michael
1d745c25a7 Some more places ... 2018-07-08 12:58:43 +00:00
Michael
7d6933c898 Avoid "Trying to get property of non-object" 2018-07-08 11:46:05 +00:00
Michael
3e797547a3 Warnings fixed 2018-07-08 09:37:05 +00:00
Michael Vogel
ff5ee74ecf
Merge branch 'develop' into item-activities 2018-07-08 06:35:50 +02:00
Michael
4d35e228c4 More item abstraction / making remote deletion work again 2018-07-07 18:14:16 +00:00
Michael
d6af9515ba Avoid storing an icid value when iaid is stored/Fix item retraction 2018-07-07 16:38:01 +00:00
Michael
32d398cc93 Unified content that is stored for a like 2018-07-06 05:39:25 +00:00
Philipp Holzer
e41e7d2edd
Fixings
- fixed test for semaphore
- fixed some issues
- changed namespace in Tests back to "src/"
- changed namings
2018-07-05 20:57:31 +02:00
Philipp Holzer
19209f6826
merged from develop and increased DB-version 2018-07-04 23:44:11 +02:00
Philipp Holzer
b07dfbb03f
Merge remote-tracking branch 'remotes/origin/develop' into lock_abstraction 2018-07-03 20:16:31 +02:00
Michael
9a9541809b Fix: Likes from OStatus got the gravity of comments 2018-07-03 04:58:34 +00:00
Michael
38160a48b0 Post update script to move old content from the item table 2018-07-01 19:02:29 +00:00
Philipp Holzer
3f7e4f5bb6
redesign of locking & caching
- New Factory "CacheDriverFactory" for Cache and Locks
- Adding Redis/Memcached Locking
- Moved Lock to Core
- other improvements
2018-06-28 22:57:17 +02:00
Michael
028c9f4da5 We now store the verb in the item-content as well 2018-06-27 19:37:13 +00:00
Michael
76dab3b2d7 Use gravity instead of verb 2018-06-27 18:09:33 +00:00
Philipp Holzer
a57e6cfa1b
Moved Lock.php back to Utils 2018-06-26 23:28:07 +02:00
Philipp Holzer
0218d16335
Lock abstraction (like the Cache)
- adding interface
- adding seperate drivers
- moving Lock to the Core package
2018-06-26 22:31:04 +02:00
Michael
d643e00d33 Standards and a new function to fetch content 2018-06-21 15:14:01 +00:00
Michael
70af2cecf2 Some of the last direct SQL calls to the item table had been changed 2018-06-21 06:21:51 +00:00
Roland Häder
8ad523fbc8
Continued a bit:
- removed/fixed whitespaces and mixture of spaces/tabs (some)
- added new-line character at end of files (POSIX-compilant)
- reverted some code which I had messed up (compared to upstream/develop)
- removed duplicate dba::update() invocation in src/Protocol/DFRN.php
- also removed no longer valid TODO

Signed-off-by: Roland Häder <roland@mxchange.org>
2018-06-20 22:19:54 +02:00
Michael
f806fa91b1
Replace old database queries with the new ones 2018-06-20 22:02:17 +02:00
Roland Haeder
593d1feca6
was a bit confusing for me or I was not sleeping to much ...
Signed-off-by: Roland Haeder <roland@mxchange.org>
2018-06-20 22:02:17 +02:00
Roland Haeder
2d744fa189
PHP5 does not support native type-hints, except array + used dbm::is_result()
Signed-off-by: Roland Haeder <roland@mxchange.org>
2018-06-20 22:02:17 +02:00
Roland Haeder
4ca26fd3bc
fixed comment and explained one
Signed-off-by: Roland Haeder <roland@mxchange.org>
2018-06-20 22:02:16 +02:00
Roland Haeder
a5dba628c4
old behaviour restored
Signed-off-by: Roland Haeder <roland@mxchange.org>
2018-06-20 22:02:16 +02:00
Roland Haeder
0e5daa86df
added curely branches + reverted back to old behaviour (may come back one day)
Signed-off-by: Roland Haeder <roland@mxchange.org>
2018-06-20 22:02:16 +02:00
Roland Haeder
ad9bd7bb72
better comment added by @Hypolite
Signed-off-by: Roland Haeder <roland@mxchange.org>
2018-06-20 22:02:16 +02:00
Roland Häder
fe77e1b538
added more curly braces + a bit more usage of dbm::is_result()
Signed-off-by: Roland Häder <roland@mxchange.org>
2018-06-20 22:02:16 +02:00
Roland Haeder
f89b999659
was a bit confusing for me or I was not sleeping to much ...
Signed-off-by: Roland Haeder <roland@mxchange.org>
2018-06-20 22:02:15 +02:00
Roland Haeder
f0b05838cb
fixed comment and explained one
Signed-off-by: Roland Haeder <roland@mxchange.org>
2018-06-20 22:02:15 +02:00
Roland Haeder
a95db714ca
added curely branches + reverted back to old behaviour (may come back one day)
Signed-off-by: Roland Haeder <roland@mxchange.org>
2018-06-20 22:02:15 +02:00
Roland Haeder
63f5598766
better comment added by @Hypolite
Signed-off-by: Roland Haeder <roland@mxchange.org>
2018-06-20 22:02:15 +02:00
Roland Haeder
9cc0d5479b
old behaviour restored
Signed-off-by: Roland Haeder <roland@mxchange.org>
2018-06-20 22:02:15 +02:00
Michael
962fbc9166 Many "fetch_first" had been replaced 2018-06-19 21:33:07 +00:00
Michael
ed00b63613 Typo 2018-06-19 13:26:03 +00:00