Commit graph

435 commits

Author SHA1 Message Date
Michael c4e381fbd7 Issue 7953: Don't show follow/unfollow on the hovercard for the "self" contact 2019-12-16 06:35:29 +00:00
Michael 49767e0555 Issue 7418: connections to forums should now work again 2019-12-09 21:19:20 +00:00
Michael 38db4d2132 Fix a notice 2019-12-08 21:41:26 +00:00
Michael 6728c58535 Mail contacts: Update public via user contact / display owner's posts 2019-12-08 05:19:15 +00:00
Michael 67a0e97f7c Avoid contact update for non federated networks 2019-11-25 08:49:14 +00:00
Michael Vogel 6ba7b5961c
Merge pull request #7798 from MrPetovan/task/rework-photo-functions
Rework photo functions
2019-11-02 21:20:38 +01:00
Hypolite Petovan 5cd8cb7134 Add unfollow link to output of Contact::photoMenu
- Add rel and pending keys to output of Contact::getDetailsByURL
- Add rel and pending keys to output of Contact::getDetailsByAddr
2019-11-02 12:48:03 -04:00
Michael 9461446374 Respect "manually-improve" during contact request 2019-11-02 16:24:54 +00:00
Michael e27ebaee48 Respect "manually improve" during contact request 2019-11-02 16:20:17 +00:00
Hypolite Petovan 03bf1dcbd3 Move Object\Image static methods to Util\Images
- Optimize imports in modified files
2019-11-02 07:48:45 -04:00
Philipp Holzer 3897c74deb
Add docs 2019-10-25 00:10:20 +02:00
Philipp Holzer 2fba7ed477
Rename namespace 2019-10-24 21:40:13 +02:00
Philipp Holzer 07cea24430
Move Activity/Namespaces defines to constants 2019-10-24 21:40:12 +02:00
Hypolite Petovan 146646c4d4 Replace deprecated calls to defaults() by ?? and ?: in src/ 2019-10-16 08:38:52 -04:00
Michael d9a74bd5dd Code transitioning from PortableContacts.php to GServer.php 2019-10-03 23:33:41 +00:00
Michael 5eeca432fe removed unused "f" parameter 2019-09-29 18:59:03 +00:00
Michael 83b00ef308 New function "isAuthenticated" 2019-09-28 18:09:11 +00:00
Michael 87462ec67f Don't use the "url" parameter on redir if it points to the same contact 2019-09-24 21:44:37 +00:00
Michael a2105c5dfe Changed documentation 2019-09-21 13:19:00 +00:00
Michael b24ef7247d Don't update the basepath on local check 2019-09-21 13:17:33 +00:00
Michael c364a77d63 Always use direct DFRN transport on local contacts 2019-09-21 12:39:07 +00:00
Michael 64f30d3627 Fix: updateFromProbe failed when updating non-federated networks 2019-09-20 21:01:52 +00:00
Michael 358cbe812a Correction: Must be inverted 2019-09-18 16:37:13 +00:00
Michael 1144863090 Changed "hidewall" behaviour 2019-09-18 05:20:33 +00:00
Michael 4223011a7d Fix a notice about a missing "pending" 2019-09-11 20:03:29 +00:00
Tobias Diekershoff 3d5d50a25b
Merge pull request #7606 from annando/fix-invalid-url
Replace not working "redir" link with a working one
2019-09-10 06:29:55 +02:00
Michael 0a0a961c52 The value is used twice, so use a variable 2019-09-10 04:04:07 +00:00
Hypolite Petovan 91b0f0465f
Merge pull request #7604 from annando/pending-contacts
Display pending contacts in the contact list
2019-09-09 13:49:51 -04:00
Michael 2dbd843ed2 Don't display ignored pending contacts, link to contact request page 2019-09-09 05:29:33 +00:00
Hypolite Petovan 69105928f5 Use destination URL when provided in Contact::magicLink 2019-09-06 08:33:19 -04:00
Michael Vogel 046b5a1eac Fix performance issues due to relay contact requests 2019-09-02 15:11:07 +02:00
Michael 6af4c90dff Fix delivery counter / archive relay contacts 2019-09-02 03:25:05 +00:00
Michael 74f12baac2 Follow up to #7582: Only update the contact when needed 2019-08-31 09:27:19 +00:00
Michael Vogel f293e352ec Renamed function parameter 2019-08-30 07:59:18 +02:00
Michael Vogel 3b92f7357c Renamed function 2019-08-30 07:52:21 +02:00
Michael Vogel 438394bc1d Type hints, corrected wrong documentation 2019-08-30 07:38:42 +02:00
Michael Vogel 481376dd6f Avoid not performing unarchiving 2019-08-29 08:41:55 +02:00
Michael Vogel 66eab2b44f Don't handle deleted contacts / removed unneeded parameter 2019-08-29 07:22:29 +02:00
Michael Vogel 503a5be06c Fixed query (not all duplicates had been found) 2019-08-29 06:55:36 +02:00
Michael Vogel ef02a1cb7b Check fpr duplicated contacts upon inserting them 2019-08-29 06:07:07 +02:00
Michael Vogel 40a7d6eb42 Merge remote-tracking branch 'upstream/2019.09-rc' into contact-dba 2019-08-29 04:14:01 +02:00
Michael Vogel 90b9ad8bed New contact table functions with check for duplicates 2019-08-28 22:27:48 +02:00
Hypolite Petovan e6f00455f3
Merge pull request #7578 from annando/archive
Don't transmit content to already archived contacts
2019-08-28 11:12:00 -04:00
Michael Vogel 96b895bc3a Changed array name, fixed bug that prevented testing most Diaspora endpoints 2019-08-28 16:54:49 +02:00
Michael Vogel 3c9834922c Check if the Diaspora endpoint is archived 2019-08-28 16:02:19 +02:00
Michael Vogel cf170c9c02 Fixed count, added to-do 2019-08-28 06:44:37 +02:00
Philipp Holzer 4733b1e5e0
Fixing PHP Fatal Error for Model\Contact (usage of non available contact) 2019-08-28 01:40:28 +02:00
Michael Vogel 9b7432781b Don't transmit content to already archived contacts 2019-08-27 21:01:11 +02:00
Michael 7d50a086e0 Issue 7559: Merge contact duplicates 2019-08-26 15:51:56 +00:00
Philipp Holzer 08be92a862
Moved BaseURL to App namespace (because similar type as Arguments/Modules/Modes) 2019-08-15 17:23:00 +02:00
Michael 1a3bf05dfb Changed "Contact::select" to "Contact::selectToArray" 2019-07-27 15:57:23 +00:00
Michael 2a213c215e Fix contact issues with fake reshares from Twitter 2019-07-23 04:26:20 +00:00
Michael e247a14d2b Added the option to only receive top level posts from people you follow 2019-07-17 21:37:13 +00:00
Michael 9ba3ee13a8 Use an insert to avoid duplicates and for analyzing 2019-07-14 10:22:19 +00:00
Michael 002963f198 Fix wrong variable 2019-07-13 07:29:56 +00:00
Michael 9b8396620b Fix duplicated contacts due to relay probing 2019-07-13 07:25:01 +00:00
Michael 7dfadf7e7e Simplify the contact update in "getIdForURL" 2019-07-12 21:07:47 +00:00
Michael 8cbdc7939e Fetch more comtact data from probing, remove duplicated contacts 2019-07-12 14:55:23 +00:00
Michael 6bb418c5a7 Use "received" instead of "created" when displaying posts in creation order 2019-07-07 21:30:33 +00:00
Michael dda86f6dfc Basepath function now uses the contact field 2019-07-05 06:41:48 +00:00
Michael be0a102333 Simplified the Contact update 2019-07-04 21:19:23 +00:00
Michael 8d6aa9914c We now handling the contact type 2019-07-04 19:31:42 +00:00
Michael ef5be9668f New fields in contact table / don't update on probe 2019-07-04 04:08:55 +00:00
Michael 7b0a9ffd89 Update gcontact when public contact is updated 2019-07-03 05:46:35 +00:00
Michael 1d7154a7d1 Update the gcontact entry when the public contact entry has changed 2019-07-02 09:06:48 +00:00
Michael ee8baf00ce Now without array_merge 2019-07-01 22:14:34 +00:00
Michael 9e3aff9ade Removed comment line 2019-07-01 18:09:40 +00:00
Michael 6041f74df6 New constant for federated protocols 2019-07-01 18:00:55 +00:00
Michael 8838a1f2d1 Avoid overwriting of avatars for feeds 2019-06-28 04:26:49 +00:00
Michael 4db3c79d04 Archive/unarchive the contacts 2019-06-27 05:03:58 +00:00
Michael bca1dc1ca4 Moving functionality to the contact model 2019-06-24 03:25:01 +00:00
Michael 857469d16a Constantly updating public contacts 2019-06-23 09:27:40 +00:00
Michael 14c28868eb Issue 6477: Use the correct content-type to resize the images 2019-06-20 20:09:33 +00:00
Michael 4ab772ed67 Issue 6477: Automatically repair self contact avatar 2019-06-19 17:05:29 +00:00
Hypolite Petovan 14725bbd6a Fix undefined index addr notices in Model\Contact::getIdForURL
- Addresses https://github.com/friendica/friendica/issues/6918#issuecomment-502393030
2019-06-15 17:16:10 -04:00
Philipp fb63274aaf
Merge pull request #7250 from MrPetovan/bug/6410-normalize-message-button
Normalize message button in profile sidebar
2019-06-12 17:56:05 +02:00
Hypolite Petovan 3aebb92cf3 Rework Profile::sidebar profile link conditions
- Now show Follow, Unfollow, Atom Feed and Message in profile sidebar more consistently with the status of the current visitor
- Remove pseudo-field contact.remoteconnect
2019-06-10 21:56:03 -04:00
Hypolite Petovan 61c79ce9ee Add new Model\Contact::canReceivePrivateMessages method 2019-06-10 21:29:11 -04:00
Hypolite Petovan 0fbfb7c970 Prevents an endless loop when only the non-public contact is available in Contact::magicLinkByContact 2019-06-10 19:10:39 -04:00
Philipp Holzer 236c0dc248
Check $contact['id']
- see https://github.com/friendica/friendica/issues/6918#issuecomment-498043313
2019-06-10 12:36:42 +02:00
Hypolite Petovan 14a78807d7 Use self::isBlocked and self:isBlockedByUser in Model\Contact::addRelationship 2019-05-20 16:34:17 -04:00
Hypolite Petovan 62dfcbb074 Prevent contact relationships with node- or user-level blocked contacts 2019-05-20 15:29:20 -04:00
Hypolite Petovan ea77f214d7 Add return value to Model\Contact::addRelationship to remove protocol-specific code from it 2019-05-20 15:29:20 -04:00
Hypolite Petovan 3114754f4b Refactor Model\Contact::addRelationship
- Remove unused parameter $item
- Replace q() call with DBA::insert
- Update check on $contact that can only be an array now
- Add moethod doc block
2019-05-20 15:29:20 -04:00
Hypolite Petovan 79cb5b1bae Add block reason editing in Model\Contact 2019-05-15 19:28:00 -04:00
Michael f04bb820ad Magic links should work again 2019-05-10 07:38:10 +00:00
Michael 626709159f Some cleaning up 2019-05-06 18:46:30 +00:00
Hypolite Petovan bb8d297ae4
Merge pull request #7097 from nupplaphil/task/mod_after_PR_fixing
Fixings for Mod-Refactorings
2019-05-05 20:28:57 -04:00
Philipp Holzer 039f9490dd
Optimized Profile::searchProfiles & Bugfix Contact::getProbeDataFromDatabase 2019-05-05 18:40:36 +02:00
Michael f3cae4bf0c Fixes notices 2019-05-05 14:12:43 +00:00
Hypolite Petovan e17db489ee
Merge pull request #7095 from annando/ap-connect
Switching from legacy DFRN connect to ActivityPub
2019-05-05 09:37:43 -04:00
Michael 0efab157c4 Reverted storing the protocol at all the time 2019-05-05 10:36:51 +00:00
Michael Vogel 2365193691 AP: Support of request messages 2019-05-05 11:17:45 +02:00
Philipp c9cce8492e
Merge pull request #7000 from MrPetovan/task/6999-no-probe-magic-link
Remove probing in magic link construction
2019-05-03 08:43:26 +02:00
Michael Vogel 33931ff15e Corrected order 2019-05-03 08:13:02 +02:00
Michael b1222e174e Ensure that an existing contact isn't archived or pending 2019-05-03 05:54:40 +00:00
Michael Vogel 949fd1e8bf Fixes undefined variable 2019-05-03 06:01:01 +02:00
Philipp Holzer c5e7abf9c5
Move mod/allfriends to src/Module/AllFriends 2019-05-02 22:03:27 +02:00
Michael a4dffee5f4 Fix wrong error message when updated a contact 2019-05-02 19:22:43 +00:00
Hypolite Petovan 71546705f8 Add Model\Contact::select method 2019-05-02 09:55:49 -04:00
Michael 28f316b7e4 Replace the legacy DFRN connection process with AP 2019-05-02 13:05:31 +00:00
Hypolite Petovan 49d12b5fae Remove probing in magic link construction
- Use Contact::getProbeDataFromDatabase and Contact::magicLinkByContact instead of Contact::getIdForURL and Contact::magicLinkbyId in Contact::magicLink
- Add default value for $cid parameter in Contact::getProbeDataFromDatabase
2019-04-12 08:50:44 -04:00
Hypolite Petovan 6a2c0b3cc7
Merge pull request #6989 from nupplaphil/task/basePath_baseUrl_fix
Automatic BaseURL determination fix
2019-04-11 04:07:20 -04:00
Michael 4e9316fc15 Fix warnings 2019-04-09 17:58:28 +00:00
Michael 8748aff110 Avoid some more warning 2019-04-09 11:44:35 +00:00
Michael d58147413f Avoid update of non native contacts, fix most warnings 2019-04-09 11:28:45 +00:00
Michael 84a6e390ab Fetch data from the given contact number, if already present 2019-04-09 08:47:57 +00:00
Michael bca7419987 Avoid overwriting existing contacts with bad data 2019-04-09 08:35:29 +00:00
Philipp Holzer 318a3ca785
Create own base URL class which holds the whole base url business logic 2019-04-09 08:31:16 +02:00
Michael 90eea919a4 New contact field "updated", fix warnings 2019-04-09 05:15:23 +00:00
Michael a2ca14def4 Removed a worker call - this needs more work 2019-04-08 21:35:00 +00:00
Michael c088249e1b Update the contact in the background 2019-04-08 21:05:33 +00:00
Michael f387d85cdb Fetch profile data from different contact tables when we won't or can't probe via network 2019-04-08 20:41:18 +00:00
Philipp Holzer 083820b107 Moving mod/feedtest to src/Module/Feedtest 2019-03-22 22:55:49 -04:00
Michael cd0d6cb626 Forums now are working with AP as well 2019-03-14 18:44:41 +00:00
Michael e89d56be6d Improved contact update from probe 2019-03-07 00:13:39 +00:00
Tobias Diekershoff bd7aaacfb0 fixing links in photoMenu 2019-02-26 10:19:08 +01:00
Michael Vogel fa5525d084
Merge pull request #6726 from MrPetovan/task/6676-fix-implicit-mentions
Fix last batch of implicit mentions issues
2019-02-24 15:40:11 +01:00
Hypolite Petovan b939faf4ef Add contact removal from all groups when blocked 2019-02-23 17:32:40 -05:00
Hypolite Petovan 7320c5e8e8 Normalize Contact::magicLinkByContact method name 2019-02-23 17:32:10 -05:00
Michael 3450f12cba Changed log calls 2019-02-21 19:32:31 +00:00
Michael 7939cacc44 The function moved from the user to the contact class 2019-02-10 17:19:10 +00:00
Hypolite Petovan 41edcd1028 Fix bad rebase in Model/Contact 2019-01-21 11:12:52 -05:00
Hypolite Petovan 3c50a11ff1 Fix wrong operators in Model\Item and Model\Contact 2019-01-21 11:12:51 -05:00
Hypolite Petovan 57ab858486 Fix calls to DBA::select missing parameters 2019-01-21 11:12:50 -05:00
Hypolite Petovan 7f2dc40601 Fix potential bugs without expected behavior change
- Fix uninitialized variables
- Fix potentially not set variables
- Fix wrong parameter default value
- Fix method scope
- Fix missing return value
2019-01-21 11:04:19 -05:00
Hypolite Petovan 3d839bb176 Move Contact::ACCOUNT_TYPE_* constants to User::ACCOUNT_TYPE_*
- Keep Contact::TYPE_* constants for comparison with contact.contact-type
2019-01-21 10:56:27 -05:00
Hypolite Petovan ad9c67663d Move Contact::Page_* constants to User::PAGE_FLAGS_* 2019-01-21 10:55:37 -05:00
Hypolite Petovan 4a95ca280d Remove unused code
- Remove commented code
- Remove unused/immediately overwritten variables
- Remove extraneous parameters
- Remove unreachable code
- Remove duplicate array keys
2019-01-21 10:48:40 -05:00
Hypolite Petovan 070aa016e0 Update more PHPDoc, including in include/ 2019-01-21 10:39:28 -05:00
Hypolite Petovan 3282ce5389 Fix PHPDoc comments project-wide 2019-01-21 10:35:51 -05:00
Hypolite Petovan 55e54bb950 Replace deprecated Addon::callHooks with Hook::callAll
- Update documentation
2019-01-21 09:50:56 -05:00
fabrixxm 8c75c26361 Use Model\Photo as much as possible
Most important is to use `Photo::delete()` to have backend
to remove data.
2019-01-21 09:12:28 -05:00
rabuzarus 528d175baa Bugfix - provide magic links for remote user in magicLink() 2019-01-18 17:50:21 +01:00
Michael c8bfa0c661 Bugfix: Private posts of contacts hadn't been displayed on the contact's page 2019-01-18 06:22:15 +00:00
Michael c359c162a7 Issue 6282: Update the contact data regularly (including the network) 2019-01-16 21:39:56 +00:00
Michael c1dec50248 Avoiding some notices 2019-01-13 18:03:13 +00:00
Michael 28f14c7d60 Don't show deleted contacts, changed "pending" behaviour 2019-01-12 13:28:14 +00:00
Michael 1a702359f1 Unfollow should now work with Pleroma again 2019-01-10 07:24:12 +00:00
Michael 6ae6a8a983 Don't show deleted contacts, set new AP contacts as "pending" until they are accepted 2019-01-09 13:23:11 +00:00
Hypolite Petovan 5e1ceb57de Escape global namespaced get_app() calls
- Add deprecated status
2019-01-03 21:27:36 -05:00
rabuzarus 67a8f9dbd4 Bugfix - the remote user also has magicLinks again 2019-01-02 17:47:53 +01:00
Hypolite Petovan acaee626f5 Remove include/ requires that are now done directly from Composer 2018-12-24 09:56:25 -05:00
Michael faa30adf68 Handles issue 6122 - the self contact will be updated when it seems to be invalid 2018-12-22 20:12:32 +00:00
Michael 8fbe0d46e9 Fix for remote authentication when visiting contact's pages 2018-12-08 20:28:01 +00:00
Michael 95c150ef28 Added to-do 2018-12-04 14:20:25 +00:00
Michael 5c20f21dd8 Improved fallback when the probing fails 2018-12-04 14:17:55 +00:00
Michael 491fc5f78a Issue 6168: "redir" now mostly use OWA 2018-12-04 07:12:55 +00:00
Hypolite Petovan c5558cc459
Merge pull request #6224 from annando/dba-delete-contact
Avoid duplicated contacts, improve contact deletion, avoid memory issues
2018-12-02 16:16:59 -05:00
Michael 066a040cc7 Avoid duplicated contacts, improve contact deletion, avoid memory issues 2018-12-02 16:25:25 +00:00
Hypolite Petovan 458981f75c Replace x() by isset(), !empty() or defaults()
- Remove extraneous parentheses around empty() calls
- Remove duplicate calls to intval(), count() or strlen() after empty()
- Replace ternary operators outputting binary value with empty() return value
- Rewrite defaults() without x()
2018-11-30 09:06:22 -05:00
Michael Vogel 3f4636d490
Merge pull request #6183 from MrPetovan/bug/6135-hide-follower-only-birthdays
Hide follower-only birthday reminders
2018-11-24 15:55:43 +01:00
Michael fb0140a62b Checking for blocked user does now check for blocked domain as well 2018-11-22 21:43:16 +00:00
Hypolite Petovan 14df030f44 Add contact conditions to getBirthdays/updateBirthdays 2018-11-22 00:15:44 -05:00
Hypolite Petovan d71e856535 Replace remaining occurrences of "0001-01-01" with DBA::NULL_DATE 2018-11-21 23:53:45 -05:00
Hypolite Petovan aaae7b56df Replace obsolete Addon::callHooks call with Hook::callAll in Model\Contact 2018-11-10 08:18:16 -05:00
Adam Magness ffc406d819 normalise_link calls
implement normaliseLink function
2018-11-08 11:28:29 -05:00
Adam Magness 991f259ecb random_string calls
implement getRandomHex function
2018-11-08 08:45:46 -05:00
Adam Magness 50da89d861 Logger Levels
update logger levels in calls
2018-10-30 09:58:45 -04:00
Adam Magness 14fde5dc9b Log function
implement log() function.
2018-10-30 09:57:14 -04:00
Hypolite Petovan 14237a9599 Move $pager and $page_offset out of App
- Move infinite scroll data output in a module hook
- Use Pager instead of paginate() and alt_pager()
2018-10-25 00:07:15 -04:00
vinzv cb75c40f4e adapted profile pic resize to 300px for whole system 2018-10-23 16:36:57 +02:00
Hypolite Petovan e511790d62 Move NULL_DATE from boot.php to DBA::NULL_DATETIME
- Add DBA::NULL_DATE constant
2018-10-22 16:50:55 -04:00
Philipp Holzer 363d00cc45
Adding $a->getBaseURL for Worker in profile_photo
Adding a TODO for Contact::magicLink
2018-10-22 22:13:39 +02:00
Philipp Holzer d00ddc01af
Split goaway to System::externalRedirectTo() and App->internalRedirect() 2018-10-22 22:13:35 +02:00
Philipp Holzer 2ef81108b3
Renamed System::redirect() to $a->redirect() 2018-10-22 22:13:22 +02:00
Michael 92816dc725 Improved loop detection 2018-10-18 03:33:08 +00:00
Michael 35da40c2cb Avoid endless loop when trying to fetch contact id 2018-10-18 03:01:34 +00:00
Hypolite Petovan 74c5f1f684
Merge pull request #5891 from JonnyTischbein/move_module_contacts
Move module contacts
2018-10-14 16:42:50 -04:00
Michael efad4936b0 OStatus contacts are now automatically converted to AP 2018-10-13 18:13:01 +00:00
Jonny Tischbein bfa05156ca change links from /contacts to /contact 2018-10-13 13:29:56 +02:00
Philipp Holzer 307286fc47
parameters and getURLpath to getURLPath 2018-10-10 01:18:47 +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
Michael fa7cddc669 AP Bugfix: Following a soapbox now works / rapid follow/unfollow should work now 2018-10-05 06:35:50 +00:00
Michael 8841519c0d Renamed functions 2018-10-03 15:41:51 +00:00
Michael 3ab837f3c7 Functionality is now split 2018-10-03 09:15:38 +00:00
Michael 6f3b2b6586 Handling of unlisted posts, better uid detection 2018-09-16 09:06:09 +00:00
Michael 2eabe45a8e Contact reject does work now as well 2018-09-15 22:25:58 +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 61e2c7d20d Added AP to many network conditions / enabling inbox processing 2018-09-14 16:51:32 +00:00
Michael 9ef1d827f3 Restore the behaviour to remove the remote contact upon termination 2018-09-05 05:02:06 +00:00
Michael a3570d0027 Fix: Missing gserver entries - show correct server platform 2018-08-30 09:52:38 +00:00
Michael Vogel edcd0a3744 Issue 4960: Ignoring and blocking of contacts should work again (#5657)
* Issue 4960: Ignoring and blocking of contacts should work again

* Renamed functions

* This function should be renamed as well.

* We now have a frontend to block and ignore public contacts

* Hide some parts for public contacts

* Removed notices, public contact is now accessible from dirfind as well

* We now show contact conversations and contact posts

* We now use a new conversation mode

* The update functionality is disabled until it will work completely

* Fixing tabs chaos

* Update after posts on the contacts page will now work

* Show connect link
2018-08-25 09:48:00 -04: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 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 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 Vogel 060e887a31 And still there are notices that have to be removed ... (#5629)
* And still there are notices that have to be removed ...

* Notice removed in ACL part

* Fix missing fields for notifications

* Fixes issue 5630
2018-08-18 08:20:50 +02:00
Michael 0342f9e084 Removed notices, will it ever end? 2018-08-17 03:19:42 +00:00
Michael 29aa90ec09 Remove contacts in the background 2018-08-12 17:15:47 +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 f82580c2ef Avoid probing for contacts if we don't want to update 2018-08-09 06:19:23 +00: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 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
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
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
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 4db98eb43d Rename DBA::inArray to DBA::toArray 2018-07-22 19:27:35 -04:00